From 492837d8c4a702c8f651ac037fc05acd62aef92d Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Tue, 15 Oct 2024 15:36:35 +0200 Subject: [PATCH 01/34] WIP --- .../mapper/ClusterStateRoleMapping.java | 76 +++++++++++++++++++ .../support/mapper/ExpressionRoleMapping.java | 7 +- .../security/authz/RoleMappingMetadata.java | 18 +++-- .../ReservedRoleMappingAction.java | 12 ++- 4 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.java new file mode 100644 index 0000000000000..4d2f7fbd2cd4e --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.java @@ -0,0 +1,76 @@ +/* + * 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.security.authc.support.mapper; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; + +import java.io.IOException; +import java.util.Objects; + +public final class ClusterStateRoleMapping implements ToXContentObject, Writeable { + + private static final String RESERVED_METADATA_PREFIX = "_es_reserved_fields"; + + private final ExpressionRoleMapping innerMapping; + + public ClusterStateRoleMapping(StreamInput in) throws IOException { + this.innerMapping = new ExpressionRoleMapping(in); + } + + public ClusterStateRoleMapping(ExpressionRoleMapping innerMapping) { + this.innerMapping = markMetadata(innerMapping); + } + + private static ExpressionRoleMapping markMetadata(ExpressionRoleMapping innerMapping) { + var metadata = innerMapping.getMetadata(); + + return innerMapping; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + innerMapping.writeTo(out); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + innerMapping.innerToXContent(builder, params, false); + builder.field("name", innerMapping.getName()); + return builder.endObject(); + } + + public ExpressionRoleMapping toExpressionRoleMapping() { + return innerMapping; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + return Objects.equals(innerMapping, ((ClusterStateRoleMapping) obj).innerMapping); + } + + @Override + public int hashCode() { + return innerMapping.hashCode(); + } + + @Override + public String toString() { + return innerMapping.toString(); + } +} 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 17088cff8718b..ffd8cb05b85f4 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 @@ -264,6 +264,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public XContentBuilder toXContent(XContentBuilder builder, Params params, boolean indexFormat) throws IOException { builder.startObject(); + innerToXContent(builder, params, indexFormat); + return builder.endObject(); + } + + public XContentBuilder innerToXContent(XContentBuilder builder, Params params, boolean indexFormat) throws IOException { builder.field(Fields.ENABLED.getPreferredName(), enabled); if (roles.isEmpty() == false) { builder.startArray(Fields.ROLES.getPreferredName()); @@ -287,7 +292,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params, boolea if (indexFormat) { builder.field(NativeRoleMappingStoreField.DOC_TYPE_FIELD, NativeRoleMappingStoreField.DOC_TYPE_ROLE_MAPPING); } - return builder.endObject(); + return builder; } public Set getRoleNames(ScriptService scriptService, ExpressionModel model) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index da6ff6ad24c34..1d680670a2c03 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -21,6 +21,7 @@ import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMapping; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import java.io.IOException; @@ -30,6 +31,7 @@ import java.util.LinkedHashSet; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.Metadata.ALL_CONTEXTS; import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; @@ -48,8 +50,7 @@ public final class RoleMappingMetadata extends AbstractNamedDiffable ExpressionRoleMapping.parse("name_not_available_after_deserialization", p), + (p, c) -> new ClusterStateRoleMapping(ExpressionRoleMapping.parse("name_not_available_after_deserialization", p)), new ParseField(TYPE) ); } @@ -60,18 +61,23 @@ public static RoleMappingMetadata getFromClusterState(ClusterState clusterState) return clusterState.metadata().custom(RoleMappingMetadata.TYPE, RoleMappingMetadata.EMPTY); } - private final Set roleMappings; + private final Set roleMappings; + // TODO remove me public RoleMappingMetadata(Set roleMappings) { + this.roleMappings = roleMappings.stream().map(ClusterStateRoleMapping::new).collect(Collectors.toSet()); + } + + public RoleMappingMetadata(Set roleMappings, boolean readyForNewFormat) { this.roleMappings = roleMappings; } public RoleMappingMetadata(StreamInput input) throws IOException { - this.roleMappings = input.readCollectionAsSet(ExpressionRoleMapping::new); + this.roleMappings = input.readCollectionAsSet(ClusterStateRoleMapping::new); } public Set getRoleMappings() { - return this.roleMappings; + return roleMappings.stream().map(ClusterStateRoleMapping::toExpressionRoleMapping).collect(Collectors.toSet()); } public boolean isEmpty() { @@ -132,7 +138,7 @@ public int hashCode() { @Override public String toString() { StringBuilder builder = new StringBuilder("RoleMapping[entries=["); - final Iterator entryList = roleMappings.iterator(); + final Iterator entryList = roleMappings.iterator(); boolean firstEntry = true; while (entryList.hasNext()) { if (firstEntry == false) { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java index 73d1a1abcdb50..19cff3d62cefc 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java @@ -14,6 +14,7 @@ import org.elasticsearch.xcontent.XContentParserConfiguration; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequestBuilder; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMapping; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; @@ -43,8 +44,9 @@ public String name() { @Override public TransformState transform(Object source, TransformState prevState) throws Exception { @SuppressWarnings("unchecked") - Set roleMappings = validate((List) source); - RoleMappingMetadata newRoleMappingMetadata = new RoleMappingMetadata(roleMappings); + Set roleMappings = validate((List) source); + RoleMappingMetadata newRoleMappingMetadata = new RoleMappingMetadata(roleMappings, true); + // check feature: if available, check if we need to re-write to cluster state. how -> put field in metadata... if (newRoleMappingMetadata.equals(RoleMappingMetadata.getFromClusterState(prevState.state()))) { return prevState; } else { @@ -71,7 +73,7 @@ public List fromXContent(XContentParser parser) throws IO return result; } - private Set validate(List roleMappings) { + private Set validate(List roleMappings) { var exceptions = new ArrayList(); for (var roleMapping : roleMappings) { // File based defined role mappings are allowed to use MetadataUtils.RESERVED_PREFIX @@ -85,6 +87,8 @@ private Set validate(List roleMapp exceptions.forEach(illegalArgumentException::addSuppressed); throw illegalArgumentException; } - return roleMappings.stream().map(PutRoleMappingRequest::getMapping).collect(Collectors.toUnmodifiableSet()); + return roleMappings.stream() + .map(putRoleMappingRequest -> new ClusterStateRoleMapping(putRoleMappingRequest.getMapping())) + .collect(Collectors.toUnmodifiableSet()); } } From e8e6b05b79d6cabe6263e464665ad41258f5039c Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Wed, 16 Oct 2024 21:19:34 +0200 Subject: [PATCH 02/34] Clean up --- .../elasticsearch/xpack/ccr/AutoFollowIT.java | 112 ++ .../xpack/ccr/CcrLicenseChecker.java | 3 +- .../ccr/action/TransportUnfollowAction.java | 3 +- .../xpack/ccr/repository/CcrRepository.java | 5 +- .../license/RemoteClusterLicenseChecker.java | 4 +- .../license/RestDeleteLicenseAction.java | 3 +- .../license/RestGetBasicStatus.java | 5 +- .../license/RestGetLicenseAction.java | 13 +- .../license/RestGetTrialStatus.java | 5 +- .../license/RestPostStartBasicLicense.java | 5 +- .../license/RestPostStartTrialLicense.java | 5 +- .../license/RestPutLicenseAction.java | 6 +- .../protocol/xpack/XPackInfoResponse.java | 22 +- .../xpack/core/ClientHelper.java | 2 +- .../xpack/core/ilm/RolloverStep.java | 2 +- .../core/ilm/WaitForRolloverReadyStep.java | 2 +- .../xpack/core/ml/action/CloseJobAction.java | 6 +- .../ml/action/GetOverallBucketsAction.java | 6 +- .../core/ml/action/StopDatafeedAction.java | 6 +- .../mapper/ClusterStateRoleMapping.java | 76 - ...terStateRoleMappingXContentTranslator.java | 67 + .../support/mapper/ExpressionRoleMapping.java | 7 +- .../security/authz/RoleMappingMetadata.java | 18 +- .../rest/RestGetCertificateInfoAction.java | 3 +- .../ilm/WaitForRolloverReadyStepTests.java | 4 +- .../RestDeprecationInfoAction.java | 8 +- .../eql/plugin/TransportEqlSearchAction.java | 22 +- .../xpack/esql/core/type/DataType.java | 6 + .../esql/core/type/DataTypeConverter.java | 4 +- .../spatial/CentroidPointAggregator.java | 14 +- .../exchange/ExchangeServiceTests.java | 2 +- .../resources/mapping-multivalue_points.json | 6 + .../src/main/resources/multivalue_points.csv | 28 +- .../main/resources/multivalue_points.csv-spec | 86 + .../src/main/resources/spatial.csv-spec | 52 +- .../esql/src/main/antlr/EsqlBaseLexer.g4 | 2 +- .../esql/src/main/antlr/EsqlBaseParser.g4 | 2 +- ...ianPointDocValuesAndConstantEvaluator.java | 67 +- ...esianPointDocValuesAndSourceEvaluator.java | 89 +- ...ceCartesianSourceAndConstantEvaluator.java | 73 +- ...anceCartesianSourceAndSourceEvaluator.java | 96 +- ...GeoPointDocValuesAndConstantEvaluator.java | 67 +- ...ceGeoPointDocValuesAndSourceEvaluator.java | 92 +- ...DistanceGeoSourceAndConstantEvaluator.java | 73 +- ...StDistanceGeoSourceAndSourceEvaluator.java | 99 +- .../xpack/esql/action/EsqlCapabilities.java | 10 + .../function/aggregate/CountDistinct.java | 2 +- .../expression/function/aggregate/Max.java | 2 +- .../expression/function/aggregate/Min.java | 2 +- .../function/scalar/conditional/Greatest.java | 6 +- .../function/scalar/conditional/Least.java | 6 +- .../convert/AbstractConvertFunction.java | 5 +- .../function/scalar/spatial/StDistance.java | 163 +- .../comparison/InsensitiveEqualsMapper.java | 2 +- .../local/EnableSpatialDistancePushdown.java | 2 +- .../xpack/esql/parser/EsqlBaseLexer.interp | 2 +- .../xpack/esql/parser/EsqlBaseLexer.java | 1690 ++++++++--------- .../xpack/esql/parser/EsqlBaseParser.interp | 2 +- .../xpack/esql/parser/EsqlBaseParser.java | 952 +++++----- .../enrich/EnrichPolicyResolverTests.java | 2 +- .../function/AbstractFunctionTestCase.java | 10 +- .../expression/function/TestCaseSupplier.java | 5 +- .../aggregate/SpatialCentroidTests.java | 56 +- .../function/fulltext/MatchTests.java | 9 +- .../function/fulltext/QueryStringTests.java | 3 +- .../scalar/convert/ToDatetimeTests.java | 10 +- .../scalar/convert/ToVersionTests.java | 2 +- .../scalar/multivalue/MvPercentileTests.java | 47 +- .../BinarySpatialFunctionTestCase.java | 11 +- .../scalar/string/AbstractTrimTests.java | 2 +- .../function/scalar/string/ConcatTests.java | 4 +- .../function/scalar/string/EndsWithTests.java | 5 +- .../function/scalar/string/LocateTests.java | 6 +- .../function/scalar/string/RLikeTests.java | 2 +- .../scalar/string/StartsWithTests.java | 5 +- .../esql/type/EsqlDataTypeConverterTests.java | 3 +- .../fleet/rest/RestFleetSearchAction.java | 12 +- .../rest/action/RestFreezeIndexAction.java | 23 - .../graph/rest/action/RestGraphAction.java | 15 +- .../inference/CreateFromDeploymentIT.java | 161 ++ .../xpack/inference/CustomElandModelIT.java | 33 +- .../xpack/inference/DefaultEndPointsIT.java | 4 +- .../inference/InferenceBaseRestTest.java | 2 +- ...ransportDeleteInferenceEndpointAction.java | 5 +- .../TransportGetInferenceModelAction.java | 72 +- .../chunking/EmbeddingRequestChunker.java | 2 +- .../BaseElasticsearchInternalService.java | 37 +- .../elasticsearch/ElasticDeployedModel.java | 45 + .../ElasticsearchInternalModel.java | 19 +- .../ElasticsearchInternalService.java | 190 +- .../ElasticsearchInternalServiceSettings.java | 54 +- ...ticsearchInternalServiceSettingsTests.java | 20 +- .../ElasticsearchInternalServiceTests.java | 34 +- .../test/30_logsdb_default_mapping.yml | 781 ++++++++ .../xpack/ml/integration/MlJobIT.java | 26 +- .../AdaptiveAllocationsScalerService.java | 3 +- .../ml/rest/RestDeleteExpiredDataAction.java | 11 +- .../xpack/ml/rest/RestMlInfoAction.java | 4 +- .../ml/rest/RestSetUpgradeModeAction.java | 8 +- .../calendar/RestDeleteCalendarAction.java | 9 +- .../RestDeleteCalendarEventAction.java | 14 +- .../calendar/RestDeleteCalendarJobAction.java | 9 +- .../calendar/RestGetCalendarEventsAction.java | 9 +- .../rest/calendar/RestGetCalendarsAction.java | 15 +- .../calendar/RestPostCalendarEventAction.java | 9 +- .../rest/calendar/RestPutCalendarAction.java | 9 +- .../calendar/RestPutCalendarJobAction.java | 9 +- .../datafeeds/RestDeleteDatafeedAction.java | 9 +- .../datafeeds/RestGetDatafeedStatsAction.java | 11 +- .../datafeeds/RestGetDatafeedsAction.java | 9 +- .../datafeeds/RestPreviewDatafeedAction.java | 19 +- .../rest/datafeeds/RestPutDatafeedAction.java | 9 +- .../datafeeds/RestStartDatafeedAction.java | 9 +- .../datafeeds/RestStopDatafeedAction.java | 8 +- .../datafeeds/RestUpdateDatafeedAction.java | 9 +- .../rest/filter/RestDeleteFilterAction.java | 9 +- .../ml/rest/filter/RestGetFiltersAction.java | 10 +- .../ml/rest/filter/RestPutFilterAction.java | 9 +- .../rest/filter/RestUpdateFilterAction.java | 9 +- ...stPutTrainedModelDefinitionPartAction.java | 14 +- .../RestPutTrainedModelVocabularyAction.java | 5 +- .../xpack/ml/rest/job/RestCloseJobAction.java | 8 +- .../ml/rest/job/RestDeleteForecastAction.java | 16 +- .../ml/rest/job/RestDeleteJobAction.java | 9 +- .../xpack/ml/rest/job/RestFlushJobAction.java | 9 +- .../ml/rest/job/RestForecastJobAction.java | 9 +- .../ml/rest/job/RestGetJobStatsAction.java | 10 +- .../xpack/ml/rest/job/RestGetJobsAction.java | 11 +- .../xpack/ml/rest/job/RestOpenJobAction.java | 9 +- .../ml/rest/job/RestPostJobUpdateAction.java | 9 +- .../xpack/ml/rest/job/RestPutJobAction.java | 9 +- .../RestDeleteModelSnapshotAction.java | 13 +- .../RestGetModelSnapshotsAction.java | 28 +- .../RestRevertModelSnapshotAction.java | 13 +- .../RestUpdateModelSnapshotAction.java | 13 +- .../ml/rest/results/RestGetBucketsAction.java | 29 +- .../rest/results/RestGetCategoriesAction.java | 27 +- .../results/RestGetInfluencersAction.java | 11 +- .../results/RestGetOverallBucketsAction.java | 10 +- .../ml/rest/results/RestGetRecordsAction.java | 11 +- .../validate/RestValidateDetectorAction.java | 8 +- .../validate/RestValidateJobConfigAction.java | 8 +- .../rest/action/RestMonitoringBulkAction.java | 6 +- .../metrics-otel@mappings.yaml | 7 +- .../metrics-otel@template.yaml | 11 - .../src/main/resources/resources.yaml | 2 +- .../rest-api-spec/test/20_logs_tests.yml | 24 + .../rest-api-spec/test/20_metrics_tests.yml | 34 + .../xpack/rank/rrf/RRFRetrieverBuilderIT.java | 50 +- .../rrf/RRFRetrieverBuilderNestedDocsIT.java | 5 +- ...rrf_retriever_search_api_compatibility.yml | 31 +- ...ith_text_similarity_reranker_retriever.yml | 6 + .../rest/RestDeleteRollupJobAction.java | 3 +- .../rollup/rest/RestGetRollupCapsAction.java | 3 +- .../rest/RestGetRollupIndexCapsAction.java | 5 +- .../rollup/rest/RestGetRollupJobsAction.java | 3 +- .../rollup/rest/RestPutRollupJobAction.java | 3 +- .../rollup/rest/RestStartRollupJobAction.java | 5 +- .../rollup/rest/RestStopRollupJobAction.java | 5 +- .../FileSettingsRoleMappingsRestartIT.java | 14 +- .../ReservedRoleMappingAction.java | 11 +- .../rest/action/RestAuthenticateAction.java | 5 +- .../apikey/RestInvalidateApiKeyAction.java | 39 +- .../action/oauth2/RestGetTokenAction.java | 5 +- .../oauth2/RestInvalidateTokenAction.java | 5 +- .../privilege/RestDeletePrivilegesAction.java | 7 +- .../privilege/RestGetPrivilegesAction.java | 11 +- .../privilege/RestPutPrivilegesAction.java | 6 +- .../profile/RestDisableProfileAction.java | 5 +- .../profile/RestEnableProfileAction.java | 5 +- .../realm/RestClearRealmCacheAction.java | 7 +- .../role/RestBulkDeleteRolesAction.java | 2 +- .../action/role/RestBulkPutRolesAction.java | 2 +- .../role/RestClearRolesCacheAction.java | 7 +- .../action/role/RestDeleteRoleAction.java | 5 +- .../rest/action/role/RestGetRolesAction.java | 6 +- .../rest/action/role/RestPutRoleAction.java | 6 +- .../RestDeleteRoleMappingAction.java | 7 +- .../RestGetRoleMappingsAction.java | 8 +- .../rolemapping/RestPutRoleMappingAction.java | 5 +- .../saml/RestSamlAuthenticateAction.java | 7 +- .../saml/RestSamlInvalidateSessionAction.java | 5 +- .../action/saml/RestSamlLogoutAction.java | 5 +- .../RestSamlPrepareAuthenticationAction.java | 5 +- .../RestGetSecuritySettingsAction.java | 4 +- .../RestUpdateSecuritySettingsAction.java | 4 +- .../action/user/RestChangePasswordAction.java | 13 +- .../action/user/RestDeleteUserAction.java | 7 +- .../user/RestGetUserPrivilegesAction.java | 5 +- .../rest/action/user/RestGetUsersAction.java | 6 +- .../action/user/RestHasPrivilegesAction.java | 17 +- .../user/RestProfileHasPrivilegesAction.java | 5 +- .../rest/action/user/RestPutUserAction.java | 8 +- .../action/user/RestSetEnabledAction.java | 17 +- ...ty4ServerTransportAuthenticationTests.java | 2 +- .../xpack/sql/execution/search/Querier.java | 4 +- .../sql/plugin/RestSqlClearCursorAction.java | 9 +- .../xpack/sql/plugin/RestSqlQueryAction.java | 12 +- .../xpack/sql/plugin/RestSqlStatsAction.java | 9 +- .../sql/plugin/RestSqlTranslateAction.java | 12 +- .../sql/plugin/TransportSqlQueryAction.java | 23 +- .../rest/action/RestAckWatchAction.java | 13 +- .../rest/action/RestActivateWatchAction.java | 19 +- .../rest/action/RestDeleteWatchAction.java | 5 +- .../rest/action/RestExecuteWatchAction.java | 13 +- .../rest/action/RestGetWatchAction.java | 3 +- .../action/RestGetWatcherSettingsAction.java | 4 +- .../rest/action/RestPutWatchAction.java | 6 +- .../RestUpdateWatcherSettingsAction.java | 4 +- .../rest/action/RestWatchServiceAction.java | 5 +- .../rest/action/RestWatcherStatsAction.java | 6 +- 211 files changed, 3823 insertions(+), 3164 deletions(-) delete mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.java create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMappingXContentTranslator.java create mode 100644 x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CreateFromDeploymentIT.java create mode 100644 x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticDeployedModel.java 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 6f66e7e386066..9303191fcf75f 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 @@ -13,6 +13,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.client.RestClient; +import org.elasticsearch.client.WarningFailureException; import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.SecureString; @@ -1120,6 +1121,117 @@ public void testAutoFollowSearchableSnapshotsFails() throws Exception { } } + public void testNoWarningOnPromoteDatastreamWhenTemplateExistsOnFollower() throws Exception { + if ("follow".equals(targetCluster) == false) { + return; + } + testDataStreamPromotionWarnings(true); + } + + public void testWarningOnPromoteDatastreamWhenTemplateDoesNotExistsOnFollower() { + if ("follow".equals(targetCluster) == false) { + return; + } + WarningFailureException exception = assertThrows(WarningFailureException.class, () -> testDataStreamPromotionWarnings(false)); + assertThat( + exception.getMessage(), + containsString( + "does not have a matching index template. This will cause rollover to fail until a matching index template is created]" + ) + ); + } + + private void testDataStreamPromotionWarnings(Boolean createFollowerTemplate) throws Exception { + final int numDocs = 64; + final String dataStreamName = getTestName().toLowerCase(Locale.ROOT) + "-dopromo"; + final String autoFollowPatternName = getTestName().toLowerCase(Locale.ROOT); + + int initialNumberOfSuccessfulFollowedIndices = getNumberOfSuccessfulFollowedIndices(); + List backingIndexNames = null; + try { + // Create index template + Request putComposableIndexTemplateRequest = new Request("POST", "/_index_template/" + getTestName().toLowerCase(Locale.ROOT)); + putComposableIndexTemplateRequest.setJsonEntity("{\"index_patterns\":[\"" + dataStreamName + "*\"],\"data_stream\":{}}"); + + if (createFollowerTemplate) { + assertOK(client().performRequest(putComposableIndexTemplateRequest)); + } + + // Create auto follow pattern + createAutoFollowPattern(client(), autoFollowPatternName, dataStreamName + "*", "leader_cluster", null); + + // Create data stream and ensure that it is auto followed + try (var leaderClient = buildLeaderClient()) { + assertOK(leaderClient.performRequest(putComposableIndexTemplateRequest)); + + for (int i = 0; i < numDocs; i++) { + var indexRequest = new Request("POST", "/" + dataStreamName + "/_doc"); + indexRequest.addParameter("refresh", "true"); + indexRequest.setJsonEntity("{\"@timestamp\": \"" + DATE_FORMAT.format(new Date()) + "\",\"message\":\"abc\"}"); + assertOK(leaderClient.performRequest(indexRequest)); + } + verifyDataStream(leaderClient, dataStreamName, backingIndexName(dataStreamName, 1)); + verifyDocuments(leaderClient, dataStreamName, numDocs); + } + assertBusy(() -> { + assertThat(getNumberOfSuccessfulFollowedIndices(), equalTo(initialNumberOfSuccessfulFollowedIndices + 1)); + verifyDataStream(client(), dataStreamName, backingIndexName(dataStreamName, 1)); + ensureYellow(dataStreamName); + verifyDocuments(client(), dataStreamName, numDocs); + }); + + // Rollover in leader cluster and ensure second backing index is replicated: + try (var leaderClient = buildLeaderClient()) { + var rolloverRequest = new Request("POST", "/" + dataStreamName + "/_rollover"); + assertOK(leaderClient.performRequest(rolloverRequest)); + verifyDataStream(leaderClient, dataStreamName, backingIndexName(dataStreamName, 1), backingIndexName(dataStreamName, 2)); + + var indexRequest = new Request("POST", "/" + dataStreamName + "/_doc"); + indexRequest.addParameter("refresh", "true"); + indexRequest.setJsonEntity("{\"@timestamp\": \"" + DATE_FORMAT.format(new Date()) + "\",\"message\":\"abc\"}"); + assertOK(leaderClient.performRequest(indexRequest)); + verifyDocuments(leaderClient, dataStreamName, numDocs + 1); + } + assertBusy(() -> { + assertThat(getNumberOfSuccessfulFollowedIndices(), equalTo(initialNumberOfSuccessfulFollowedIndices + 2)); + verifyDataStream(client(), dataStreamName, backingIndexName(dataStreamName, 1), backingIndexName(dataStreamName, 2)); + ensureYellow(dataStreamName); + verifyDocuments(client(), dataStreamName, numDocs + 1); + }); + + backingIndexNames = verifyDataStream( + client(), + dataStreamName, + backingIndexName(dataStreamName, 1), + backingIndexName(dataStreamName, 2) + ); + + // Promote local data stream + var promoteRequest = new Request("POST", "/_data_stream/_promote/" + dataStreamName); + Response response = client().performRequest(promoteRequest); + assertOK(response); + } finally { + if (backingIndexNames == null) { + // we failed to compute the actual backing index names in the test because we failed earlier on, guessing them on a + // best-effort basis + backingIndexNames = List.of(backingIndexName(dataStreamName, 1), backingIndexName(dataStreamName, 2)); + } + + // These cleanup methods are copied from the finally block of other Data Stream tests in this class however + // they may no longer be required but have been included for completeness + cleanUpFollower(backingIndexNames, List.of(dataStreamName), List.of(autoFollowPatternName)); + cleanUpLeader(backingIndexNames.subList(0, 1), List.of(dataStreamName), List.of()); + Request deleteTemplateRequest = new Request("DELETE", "/_index_template/" + getTestName().toLowerCase(Locale.ROOT)); + if (createFollowerTemplate) { + assertOK(client().performRequest(deleteTemplateRequest)); + } + try (var leaderClient = buildLeaderClient()) { + assertOK(leaderClient.performRequest(deleteTemplateRequest)); + } + } + + } + private int getNumberOfSuccessfulFollowedIndices() throws IOException { return getNumberOfSuccessfulFollowedIndices(client()); } diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrLicenseChecker.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrLicenseChecker.java index 2c633a43264f6..af2e99b047a71 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrLicenseChecker.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrLicenseChecker.java @@ -479,8 +479,7 @@ public void ActionListener listener ) { final Supplier supplier = threadContext.newRestorableContext(false); - try (ThreadContext.StoredContext ignore = threadContext.stashContext()) { - threadContext.markAsSystemContext(); + try (var ignore = threadContext.newEmptySystemContext()) { delegate.execute(connection, action, request, new ContextPreservingActionListener<>(supplier, listener)); } } diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportUnfollowAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportUnfollowAction.java index addf47662276d..e6857ba985306 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportUnfollowAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportUnfollowAction.java @@ -195,9 +195,8 @@ private void removeRetentionLeaseForShard( threadContext.newRestorableContext(true), listener ); - try (ThreadContext.StoredContext ignore = threadPool.getThreadContext().stashContext()) { + try (var ignore = threadPool.getThreadContext().newEmptySystemContext()) { // we have to execute under the system context so that if security is enabled the removal is authorized - threadContext.markAsSystemContext(); CcrRetentionLeases.asyncRemoveRetentionLease(leaderShardId, retentionLeaseId, remoteClient, preservedListener); } } 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 ad42f549b1a80..c8136002bbd52 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 @@ -47,7 +47,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.IOUtils; import org.elasticsearch.core.Releasable; @@ -447,10 +446,8 @@ public void restoreShard( // schedule renewals to run during the restore final Scheduler.Cancellable renewable = threadPool.scheduleWithFixedDelay(() -> { logger.trace("{} background renewal of retention lease [{}] during restore", shardId, retentionLeaseId); - final ThreadContext threadContext = threadPool.getThreadContext(); - try (ThreadContext.StoredContext ignore = threadContext.stashContext()) { + try (var ignore = threadPool.getThreadContext().newEmptySystemContext()) { // we have to execute under the system context so that if security is enabled the renewal is authorized - threadContext.markAsSystemContext(); CcrRetentionLeases.asyncRenewRetentionLease( leaderShardId, retentionLeaseId, diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RemoteClusterLicenseChecker.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RemoteClusterLicenseChecker.java index 01280b1d95f80..87c9713d12362 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RemoteClusterLicenseChecker.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RemoteClusterLicenseChecker.java @@ -214,10 +214,8 @@ private void remoteClusterLicense(final String clusterAlias, final ActionListene threadContext.newRestorableContext(false), listener ); - try (ThreadContext.StoredContext ignore = threadContext.stashContext()) { + try (var ignore = threadContext.newEmptySystemContext()) { // we stash any context here since this is an internal execution and should not leak any existing context information - threadContext.markAsSystemContext(); - final XPackInfoRequest request = new XPackInfoRequest(); request.setCategories(EnumSet.of(XPackInfoRequest.Category.LICENSE)); try { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java index 24c081c237ee0..472249ed1ae3c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java @@ -9,7 +9,6 @@ import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -27,7 +26,7 @@ public RestDeleteLicenseAction() {} @Override public List routes() { - return List.of(Route.builder(DELETE, "/_license").replaces(DELETE, "/_xpack/license", RestApiVersion.V_7).build()); + return List.of(new Route(DELETE, "/_license")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java index e0428c0ff2039..8dc8cf2395191 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java @@ -8,7 +8,6 @@ package org.elasticsearch.license; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestUtils; @@ -24,9 +23,7 @@ public RestGetBasicStatus() {} @Override public List routes() { - return List.of( - Route.builder(GET, "/_license/basic_status").replaces(GET, "/_xpack/license/basic_status", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/_license/basic_status")); } @Override 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 4240119df457d..baec748141903 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 @@ -11,7 +11,7 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.core.RestApiVersion; +import org.elasticsearch.core.UpdateForV9; import org.elasticsearch.protocol.xpack.license.GetLicenseRequest; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.core.RestApiVersion.V_7; import static org.elasticsearch.core.RestApiVersion.V_8; import static org.elasticsearch.core.RestApiVersion.onOrAfter; import static org.elasticsearch.rest.RestRequest.Method.GET; @@ -43,7 +42,7 @@ public RestGetLicenseAction() {} @Override public List routes() { - return List.of(Route.builder(GET, "/_license").replaces(GET, "/_xpack/license", RestApiVersion.V_7).build()); + return List.of(new Route(GET, "/_license")); } @Override @@ -58,18 +57,12 @@ public String getName() { * The licenses are sorted by latest issue_date */ @Override + @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // remove support for accept_enterprise param public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final Map overrideParams = Maps.newMapWithExpectedSize(2); overrideParams.put(License.REST_VIEW_MODE, "true"); overrideParams.put(License.LICENSE_VERSION_MODE, String.valueOf(License.VERSION_CURRENT)); - if (request.getRestApiVersion() == V_7) { - // Hide enterprise licenses by default, there is an opt-in flag to show them - final boolean hideEnterprise = request.paramAsBoolean("accept_enterprise", false) == false; - final int licenseVersion = hideEnterprise ? License.VERSION_CRYPTO_ALGORITHMS : License.VERSION_CURRENT; - overrideParams.put(License.LICENSE_VERSION_MODE, String.valueOf(licenseVersion)); - overrideParams.put(License.XCONTENT_HIDE_ENTERPRISE, String.valueOf(hideEnterprise)); - } // In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0 the flag is deprecated and can only be true // TODO Remove this from 9.0 if (request.hasParam("accept_enterprise")) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java index e42db16ded401..5cfde9288edec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java @@ -8,7 +8,6 @@ package org.elasticsearch.license; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestUtils; @@ -24,9 +23,7 @@ public RestGetTrialStatus() {} @Override public List routes() { - return List.of( - Route.builder(GET, "/_license/trial_status").replaces(GET, "/_xpack/license/trial_status", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/_license/trial_status")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java index 64556bcf69ecf..b44648966b936 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java @@ -8,7 +8,6 @@ package org.elasticsearch.license; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -26,9 +25,7 @@ public RestPostStartBasicLicense() {} @Override public List routes() { - return List.of( - Route.builder(POST, "/_license/start_basic").replaces(POST, "/_xpack/license/start_basic", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_license/start_basic")); } @Override 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 56fae76c2e2b8..c8321aa518237 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,6 @@ package org.elasticsearch.license; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -28,9 +27,7 @@ public RestPostStartTrialLicense() {} @Override public List routes() { - return List.of( - Route.builder(POST, "/_license/start_trial").replaces(POST, "/_xpack/license/start_trial", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_license/start_trial")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java index 0798be6e53a14..cf24ac301046b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.license; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -28,10 +27,7 @@ public RestPutLicenseAction() {} @Override public List routes() { // TODO: remove POST endpoint? - return List.of( - Route.builder(POST, "/_license").replaces(POST, "/_xpack/license", RestApiVersion.V_7).build(), - Route.builder(PUT, "/_license").replaces(PUT, "/_xpack/license", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_license"), new Route(PUT, "/_license")); } @Override 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 2f9b125352e9c..b20f1a9d9ce23 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 @@ -14,8 +14,6 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.Maps; import org.elasticsearch.core.Nullable; -import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.license.License; import org.elasticsearch.protocol.xpack.license.LicenseStatus; import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.XContentBuilder; @@ -206,24 +204,8 @@ public int hashCode() { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field("uid", uid); - - if (builder.getRestApiVersion() == RestApiVersion.V_7 && params.paramAsBoolean("accept_enterprise", false) == false) { - if (License.LicenseType.ENTERPRISE.getTypeName().equals(type)) { - builder.field("type", License.LicenseType.PLATINUM.getTypeName()); - } else { - builder.field("type", type); - } - - if (License.OperationMode.ENTERPRISE.description().equals(mode)) { - builder.field("mode", License.OperationMode.PLATINUM.description()); - } else { - builder.field("mode", mode); - } - } else { - builder.field("type", type); - builder.field("mode", mode); - } - + builder.field("type", type); + builder.field("mode", mode); builder.field("status", status.label()); if (expiryDate != BASIC_SELF_GENERATED_LICENSE_EXPIRATION_MILLIS) { builder.timestampFieldsFromUnixEpochMillis("expiry_date_in_millis", "expiry_date", expiryDate); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java index 4e7aa37fe1a0b..8c02462375e1d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java @@ -267,7 +267,7 @@ public static T executeWithHeaders( return supplier.get(); } } else { - try (ThreadContext.StoredContext ignore = client.threadPool().getThreadContext().stashContext()) { + try (var ignore = client.threadPool().getThreadContext().stashContext()) { client.threadPool().getThreadContext().copyHeaders(filteredHeaders.entrySet()); return supplier.get(); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverStep.java index 3e6c00eeadba4..d648dd1c7edf8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverStep.java @@ -127,7 +127,7 @@ public void performAction( if (targetFailureStore) { rolloverRequest.setIndicesOptions( IndicesOptions.builder(rolloverRequest.indicesOptions()) - .failureStoreOptions(opts -> opts.includeFailureIndices(true).includeRegularIndices(false)) + .selectorOptions(IndicesOptions.SelectorOptions.ONLY_FAILURES) .build() ); } 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 7b751994222b1..67f65481ef63e 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 @@ -248,7 +248,7 @@ RolloverRequest createRolloverRequest( if (targetFailureStore) { rolloverRequest.setIndicesOptions( IndicesOptions.builder(rolloverRequest.indicesOptions()) - .failureStoreOptions(opts -> opts.includeFailureIndices(true).includeRegularIndices(false)) + .selectorOptions(IndicesOptions.SelectorOptions.ONLY_FAILURES) .build() ); } 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 381fb30b65e68..ca81509920ca5 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 @@ -179,11 +179,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(Job.ID.getPreferredName(), jobId); builder.field(TIMEOUT.getPreferredName(), timeout.getStringRep()); builder.field(FORCE.getPreferredName(), force); - if (builder.getRestApiVersion() == RestApiVersion.V_7) { - builder.field(DEPRECATED_ALLOW_NO_JOBS_PARAM, allowNoMatch); - } else { - builder.field(ALLOW_NO_MATCH.getPreferredName(), allowNoMatch); - } + builder.field(ALLOW_NO_MATCH.getPreferredName(), allowNoMatch); builder.endObject(); return builder; } 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 12565ea49e058..12c8696a50626 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 @@ -243,11 +243,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (end != null) { builder.field(END.getPreferredName(), String.valueOf(end)); } - if (builder.getRestApiVersion() == RestApiVersion.V_7) { - builder.field(DEPRECATED_ALLOW_NO_JOBS_PARAM, allowNoMatch); - } else { - builder.field(ALLOW_NO_MATCH.getPreferredName(), allowNoMatch); - } + builder.field(ALLOW_NO_MATCH.getPreferredName(), allowNoMatch); builder.endObject(); return builder; } 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 2fd00a5ea3983..cb89cfa8cd0e7 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 @@ -169,11 +169,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(DatafeedConfig.ID.getPreferredName(), datafeedId); builder.field(TIMEOUT.getPreferredName(), stopTimeout.getStringRep()); builder.field(FORCE.getPreferredName(), force); - if (builder.getRestApiVersion() == RestApiVersion.V_7) { - builder.field(DEPRECATED_ALLOW_NO_DATAFEEDS_PARAM, allowNoMatch); - } else { - builder.field(ALLOW_NO_MATCH.getPreferredName(), allowNoMatch); - } + builder.field(ALLOW_NO_MATCH.getPreferredName(), allowNoMatch); builder.endObject(); return builder; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.java deleted file mode 100644 index 4d2f7fbd2cd4e..0000000000000 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMapping.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.security.authc.support.mapper; - -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.xcontent.ToXContentObject; -import org.elasticsearch.xcontent.XContentBuilder; - -import java.io.IOException; -import java.util.Objects; - -public final class ClusterStateRoleMapping implements ToXContentObject, Writeable { - - private static final String RESERVED_METADATA_PREFIX = "_es_reserved_fields"; - - private final ExpressionRoleMapping innerMapping; - - public ClusterStateRoleMapping(StreamInput in) throws IOException { - this.innerMapping = new ExpressionRoleMapping(in); - } - - public ClusterStateRoleMapping(ExpressionRoleMapping innerMapping) { - this.innerMapping = markMetadata(innerMapping); - } - - private static ExpressionRoleMapping markMetadata(ExpressionRoleMapping innerMapping) { - var metadata = innerMapping.getMetadata(); - - return innerMapping; - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - innerMapping.writeTo(out); - } - - @Override - public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.startObject(); - innerMapping.innerToXContent(builder, params, false); - builder.field("name", innerMapping.getName()); - return builder.endObject(); - } - - public ExpressionRoleMapping toExpressionRoleMapping() { - return innerMapping; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - return Objects.equals(innerMapping, ((ClusterStateRoleMapping) obj).innerMapping); - } - - @Override - public int hashCode() { - return innerMapping.hashCode(); - } - - @Override - public String toString() { - return innerMapping.toString(); - } -} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMappingXContentTranslator.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMappingXContentTranslator.java new file mode 100644 index 0000000000000..bc85294db11cb --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMappingXContentTranslator.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +package org.elasticsearch.xpack.core.security.authc.support.mapper; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.elasticsearch.xcontent.XContentParser; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ClusterStateRoleMappingXContentTranslator { + + private static final Logger logger = LogManager.getLogger(ClusterStateRoleMappingXContentTranslator.class); + + public static final String NAME_FIELD = "_es_reserved_name"; + public static final String FALLBACK_NAME = "name_not_available_after_deserialization"; + + public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { + Map metadata = new HashMap<>(roleMapping.getMetadata()); + Object previousValue = metadata.put(NAME_FIELD, roleMapping.getName()); + if (previousValue != null) { + logger.error( + "Metadata field [{}] is reserved and will be overwritten. Please rename this field in your role mapping configuration.", + NAME_FIELD + ); + } + return new ExpressionRoleMapping( + roleMapping.getName(), + roleMapping.getExpression(), + roleMapping.getRoles(), + roleMapping.getRoleTemplates(), + Map.copyOf(metadata), + roleMapping.isEnabled() + ); + } + + public static ExpressionRoleMapping fromXContent(XContentParser parser) throws IOException { + ExpressionRoleMapping roleMapping = ExpressionRoleMapping.parse(FALLBACK_NAME, parser); + String name = getNameFromMetadata(roleMapping); + return new ExpressionRoleMapping( + name, + roleMapping.getExpression(), + roleMapping.getRoles(), + roleMapping.getRoleTemplates(), + roleMapping.getMetadata(), + roleMapping.isEnabled() + ); + } + + private static String getNameFromMetadata(ExpressionRoleMapping roleMapping) { + Map metadata = roleMapping.getMetadata(); + if (metadata.containsKey(NAME_FIELD) && metadata.get(NAME_FIELD) instanceof String name) { + return name; + } + + logger.error("role mapping metadata should contain reserved string field [" + NAME_FIELD + "]"); + assert false : "role mapping metadata should contain reserved string field [" + NAME_FIELD + "]"; + return FALLBACK_NAME; + } +} 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 ffd8cb05b85f4..17088cff8718b 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 @@ -264,11 +264,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public XContentBuilder toXContent(XContentBuilder builder, Params params, boolean indexFormat) throws IOException { builder.startObject(); - innerToXContent(builder, params, indexFormat); - return builder.endObject(); - } - - public XContentBuilder innerToXContent(XContentBuilder builder, Params params, boolean indexFormat) throws IOException { builder.field(Fields.ENABLED.getPreferredName(), enabled); if (roles.isEmpty() == false) { builder.startArray(Fields.ROLES.getPreferredName()); @@ -292,7 +287,7 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params, b if (indexFormat) { builder.field(NativeRoleMappingStoreField.DOC_TYPE_FIELD, NativeRoleMappingStoreField.DOC_TYPE_ROLE_MAPPING); } - return builder; + return builder.endObject(); } public Set getRoleNames(ScriptService scriptService, ExpressionModel model) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index 1d680670a2c03..0f9c3777ea937 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -21,7 +21,7 @@ import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xcontent.XContentParser; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMapping; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMappingXContentTranslator; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import java.io.IOException; @@ -31,7 +31,6 @@ import java.util.LinkedHashSet; import java.util.Objects; import java.util.Set; -import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.Metadata.ALL_CONTEXTS; import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; @@ -50,7 +49,7 @@ public final class RoleMappingMetadata extends AbstractNamedDiffable new ClusterStateRoleMapping(ExpressionRoleMapping.parse("name_not_available_after_deserialization", p)), + (p, c) -> ClusterStateRoleMappingXContentTranslator.fromXContent(p), new ParseField(TYPE) ); } @@ -61,23 +60,18 @@ public static RoleMappingMetadata getFromClusterState(ClusterState clusterState) return clusterState.metadata().custom(RoleMappingMetadata.TYPE, RoleMappingMetadata.EMPTY); } - private final Set roleMappings; + private final Set roleMappings; - // TODO remove me public RoleMappingMetadata(Set roleMappings) { - this.roleMappings = roleMappings.stream().map(ClusterStateRoleMapping::new).collect(Collectors.toSet()); - } - - public RoleMappingMetadata(Set roleMappings, boolean readyForNewFormat) { this.roleMappings = roleMappings; } public RoleMappingMetadata(StreamInput input) throws IOException { - this.roleMappings = input.readCollectionAsSet(ClusterStateRoleMapping::new); + this.roleMappings = input.readCollectionAsSet(ExpressionRoleMapping::new); } public Set getRoleMappings() { - return roleMappings.stream().map(ClusterStateRoleMapping::toExpressionRoleMapping).collect(Collectors.toSet()); + return this.roleMappings; } public boolean isEmpty() { @@ -138,7 +132,7 @@ public int hashCode() { @Override public String toString() { StringBuilder builder = new StringBuilder("RoleMapping[entries=["); - final Iterator entryList = roleMappings.iterator(); + final Iterator entryList = roleMappings.iterator(); boolean firstEntry = true; while (entryList.hasNext()) { if (firstEntry == false) { 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 38e59a2e34df8..cf9dbd71b98fb 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,6 @@ package org.elasticsearch.xpack.core.ssl.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -32,7 +31,7 @@ public class RestGetCertificateInfoAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(GET, "/_ssl/certificates").replaces(GET, "/_xpack/ssl/certificates", RestApiVersion.V_7).build()); + return List.of(new Route(GET, "/_ssl/certificates")); } @Override 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 15958e9396d81..afb17644303bb 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 @@ -308,8 +308,8 @@ public void onFailure(Exception e) { verify(indicesClient, Mockito.only()).rolloverIndex(requestCaptor.capture(), Mockito.any()); RolloverRequest request = requestCaptor.getValue(); - assertThat(request.indicesOptions().failureStoreOptions().includeFailureIndices(), equalTo(failureStoreIndex)); - assertThat(request.indicesOptions().failureStoreOptions().includeRegularIndices(), not(equalTo(failureStoreIndex))); + assertThat(request.indicesOptions().includeFailureIndices(), equalTo(failureStoreIndex)); + assertThat(request.indicesOptions().includeRegularIndices(), not(equalTo(failureStoreIndex))); } public void testSkipRolloverIfDataStreamIsAlreadyRolledOver() { diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java index 235209243ee58..f817885ccd9bc 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestUtils; @@ -24,12 +23,7 @@ public class RestDeprecationInfoAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, "/_migration/deprecations").replaces(GET, "/_xpack/migration/deprecations", RestApiVersion.V_7).build(), - Route.builder(GET, "/{index}/_migration/deprecations") - .replaces(GET, "/{index}/_xpack/migration/deprecations", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, "/_migration/deprecations"), new Route(GET, "/{index}/_migration/deprecations")); } @Override diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/TransportEqlSearchAction.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/TransportEqlSearchAction.java index 51f92bcda7da4..c0141da2432ce 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/TransportEqlSearchAction.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/TransportEqlSearchAction.java @@ -59,7 +59,6 @@ import static org.elasticsearch.action.ActionListener.wrap; import static org.elasticsearch.transport.RemoteClusterAware.buildRemoteIndexName; import static org.elasticsearch.xpack.core.ClientHelper.ASYNC_SEARCH_ORIGIN; -import static org.elasticsearch.xpack.ql.plugin.TransportActionUtils.executeRequestWithRetryAttempt; public final class TransportEqlSearchAction extends HandledTransportAction implements @@ -236,22 +235,11 @@ public static void operation( new TaskId(nodeId, task.getId()), task ); - executeRequestWithRetryAttempt( - clusterService, - listener::onFailure, - onFailure -> planExecutor.eql( - cfg, - request.query(), - params, - wrap(r -> listener.onResponse(createResponse(r, task.getExecutionId())), onFailure) - ), - node -> transportService.sendRequest( - node, - EqlSearchAction.NAME, - request, - new ActionListenerResponseHandler<>(listener, EqlSearchResponse::new, EsExecutors.DIRECT_EXECUTOR_SERVICE) - ), - log + planExecutor.eql( + cfg, + request.query(), + params, + wrap(r -> listener.onResponse(createResponse(r, task.getExecutionId())), listener::onFailure) ); } } diff --git a/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java b/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java index b23703c6d8b66..cb1a7b2eb6fe0 100644 --- a/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java +++ b/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java @@ -266,6 +266,8 @@ public enum DataType { .sorted(Comparator.comparing(DataType::typeName)) .toList(); + private static final Collection STRING_TYPES = DataType.types().stream().filter(DataType::isString).toList(); + private static final Map NAME_TO_TYPE = TYPES.stream().collect(toUnmodifiableMap(DataType::typeName, t -> t)); private static final Map ES_TO_TYPE; @@ -292,6 +294,10 @@ public static Collection types() { return TYPES; } + public static Collection stringTypes() { + return STRING_TYPES; + } + /** * Resolve a type from a name. This name is sometimes user supplied, * like in the case of {@code ::} and is sometimes the name diff --git a/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataTypeConverter.java b/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataTypeConverter.java index 78b395503e700..7c91a506697c1 100644 --- a/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataTypeConverter.java +++ b/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataTypeConverter.java @@ -30,11 +30,9 @@ import static org.elasticsearch.xpack.esql.core.type.DataType.FLOAT; import static org.elasticsearch.xpack.esql.core.type.DataType.INTEGER; import static org.elasticsearch.xpack.esql.core.type.DataType.IP; -import static org.elasticsearch.xpack.esql.core.type.DataType.KEYWORD; import static org.elasticsearch.xpack.esql.core.type.DataType.LONG; import static org.elasticsearch.xpack.esql.core.type.DataType.NULL; import static org.elasticsearch.xpack.esql.core.type.DataType.SHORT; -import static org.elasticsearch.xpack.esql.core.type.DataType.TEXT; import static org.elasticsearch.xpack.esql.core.type.DataType.UNSIGNED_LONG; import static org.elasticsearch.xpack.esql.core.type.DataType.VERSION; import static org.elasticsearch.xpack.esql.core.type.DataType.isDateTime; @@ -62,7 +60,7 @@ public static Converter converterFor(DataType from, DataType to) { return DefaultConverter.TO_NULL; } // proper converters - if (to == KEYWORD || to == TEXT) { + if (isString(to)) { return conversionToString(from); } if (to == LONG) { diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/spatial/CentroidPointAggregator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/spatial/CentroidPointAggregator.java index 1fc2430393c98..c66c960dd8a99 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/spatial/CentroidPointAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/spatial/CentroidPointAggregator.java @@ -58,7 +58,7 @@ public static void evaluateIntermediate(CentroidState state, DriverContext drive } public static Block evaluateFinal(CentroidState state, DriverContext driverContext) { - return driverContext.blockFactory().newConstantBytesRefBlockWith(state.encodeCentroidResult(), 1); + return state.toBlock(driverContext.blockFactory()); } public static void combineStates(GroupingCentroidState current, int groupId, GroupingCentroidState state, int statePosition) { @@ -181,10 +181,14 @@ public void add(double x, double dx, double y, double dy, long count) { this.count += count; } - protected BytesRef encodeCentroidResult() { - double x = xSum.value() / count; - double y = ySum.value() / count; - return encode(x, y); + protected Block toBlock(BlockFactory blockFactory) { + if (count > 0) { + double x = xSum.value() / count; + double y = ySum.value() / count; + return blockFactory.newConstantBytesRefBlockWith(encode(x, y), 1); + } else { + return blockFactory.newConstantNullBlock(1); + } } } diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/exchange/ExchangeServiceTests.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/exchange/ExchangeServiceTests.java index ab785e739d080..9e07f9c8f5faf 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/exchange/ExchangeServiceTests.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/exchange/ExchangeServiceTests.java @@ -441,7 +441,7 @@ public void sendResponse(TransportResponse transportResponse) { PlainActionFuture sourceCompletionFuture = new PlainActionFuture<>(); sourceHandler.addCompletionListener(sourceCompletionFuture); ExchangeSinkHandler sinkHandler = exchange1.createSinkHandler(exchangeId, randomIntBetween(1, 128)); - Transport.Connection connection = node0.getConnection(node1.getLocalDiscoNode()); + Transport.Connection connection = node0.getConnection(node1.getLocalNode()); sourceHandler.addRemoteSink(exchange0.newRemoteSink(task, exchangeId, node0, connection), randomIntBetween(1, 5)); Exception err = expectThrows( Exception.class, diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-multivalue_points.json b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-multivalue_points.json index 98a3794d977e2..cd572012c6b3a 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-multivalue_points.json +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-multivalue_points.json @@ -12,11 +12,17 @@ "centroid": { "type": "geo_point" }, + "lk": { + "type": "keyword" + }, "location": { "type": "geo_point" }, "subset": { "type": "geo_point" + }, + "disjoint": { + "type": "geo_point" } } } diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv index c5d7c7f4ee305..efb0aaaa29a4b 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv @@ -1,14 +1,14 @@ -id:l, intersects:boolean, within:boolean, centroid:geo_point, location:geo_point, subset:geo_point -0, true, true, "POINT(0.0 5.0)", ["POINT(5 5)", "POINT(-5 5)"], "POINT(5 5)" -1, true, true, "POINT(0.5 0.5)", ["POINT(0 1)","POINT(1 0)"], "POINT(0 1)" -2, true, true, "POINT(9.0 9.0)", "POINT(9 9)", "POINT(9 9)" -3, true, true, "POINT(0.0 0.0)", ["POINT(-9 -9)","POINT(9 9)"], "POINT(-9 -9)" -4, true, false, "POINT(10.0 10.0)", ["POINT(5 5)", "POINT(15 15)"], "POINT(5 5)" -5, true, false, "POINT(5.5 5.5)", ["POINT(0 0)","POINT(11 11)"], "POINT(0 0)" -6, true, false, "POINT(0.0 -5.0)", ["POINT(-9 -19)","POINT(9 9)"], "POINT(-9 -19)" -7, false, false, "POINT(10.0 10.0)", ["POINT(5 15)", "POINT(15 5)"], "POINT(5 15)" -8, false, false, "POINT(5.5 5.5)", ["POINT(0 11)","POINT(11 0)"], "POINT(0 11)" -9, false, false, "POINT(19.0 9.0)", "POINT(19 9)", "POINT(19 9)" -10, false, false, "POINT(5.0 -5.0)", ["POINT(-9 -19)","POINT(19 9)"], "POINT(-9 -19)" -11, true, false, "POINT(0.0 0.0)", ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"], ["POINT(0 0)", "POINT(55 55)"] -12, true, false, "POINT(0.0 0.0)", ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"], ["POINT(0 0)", "POINT(55 54)"] +id:l, intersects:boolean, within:boolean, centroid:geo_point, lk:keyword, location:geo_point, subset:geo_point, disjoint:geo_point +0, true, true, "POINT(0.0 5.0)", ["POINT(5 5)", "POINT(-5 5)"], ["POINT(5 5)", "POINT(-5 5)"], "POINT(5 5)", ["POINT(55 55)", "POINT(65 65)"] +1, true, true, "POINT(0.5 0.5)", ["POINT(0 1)","POINT(1 0)"], ["POINT(0 1)","POINT(1 0)"], "POINT(0 1)", ["POINT(55 55)", "POINT(65 65)"] +2, true, true, "POINT(9.0 9.0)", "POINT(9 9)", "POINT(9 9)", "POINT(9 9)", ["POINT(55 55)", "POINT(65 65)"] +3, true, true, "POINT(0.0 0.0)", ["POINT(-9 -9)","POINT(9 9)"], ["POINT(-9 -9)","POINT(9 9)"], "POINT(-9 -9)", ["POINT(55 55)", "POINT(65 65)"] +4, true, false, "POINT(10.0 10.0)", ["POINT(5 5)", "POINT(15 15)"], ["POINT(5 5)", "POINT(15 15)"], "POINT(5 5)", ["POINT(55 55)", "POINT(65 65)"] +5, true, false, "POINT(5.5 5.5)", ["POINT(0 0)","POINT(11 11)"], ["POINT(0 0)","POINT(11 11)"], "POINT(0 0)", ["POINT(55 55)", "POINT(65 65)"] +6, true, false, "POINT(0.0 -5.0)", ["POINT(-9 -19)","POINT(9 9)"], ["POINT(-9 -19)","POINT(9 9)"], "POINT(-9 -19)", ["POINT(55 55)", "POINT(65 65)"] +7, false, false, "POINT(10.0 10.0)", ["POINT(5 15)", "POINT(15 5)"], ["POINT(5 15)", "POINT(15 5)"], "POINT(5 15)", ["POINT(55 55)", "POINT(65 65)"] +8, false, false, "POINT(5.5 5.5)", ["POINT(0 11)","POINT(11 0)"], ["POINT(0 11)","POINT(11 0)"], "POINT(0 11)", ["POINT(55 55)", "POINT(65 65)"] +9, false, false, "POINT(19.0 9.0)", "POINT(19 9)", "POINT(19 9)", "POINT(19 9)", ["POINT(55 55)", "POINT(65 65)"] +10, false, false, "POINT(5.0 -5.0)", ["POINT(-9 -19)","POINT(19 9)"], ["POINT(-9 -19)","POINT(19 9)"], "POINT(-9 -19)", ["POINT(55 55)", "POINT(65 65)"] +11, true, false, "POINT(0.0 0.0)", ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"], ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"], ["POINT(0 0)", "POINT(55 55)"], ["POINT(55 55)", "POINT(65 65)"] +12, true, false, "POINT(0.0 0.0)", ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"], ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"], ["POINT(0 0)", "POINT(55 54)"], ["POINT(55 55)", "POINT(65 65)"] diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv-spec index 6a3521c558fa9..ed9434e9241fc 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/multivalue_points.csv-spec @@ -60,6 +60,92 @@ id:l | intersects:boolean | within:boolean | st_intersects:boolean | st_within:b 12 | true | false | true | false | false | "POINT(0.0 0.0)" | ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"] ; +spatialDistance +required_capability: st_distance +required_capability: spatial_distance_supports_multivalues + +FROM multivalue_points +| EVAL distance_origin=ST_DISTANCE(location, TO_GEOPOINT("POINT(0 0)")) +| EVAL distance_subset=ST_DISTANCE(location, subset) +| EVAL distance_disjoint=ST_DISTANCE(location, disjoint) +| EVAL distance_far=ST_DISTANCE(location, TO_GEOPOINT("POINT(55 55)")) +| KEEP id, distance_origin, distance_subset, distance_disjoint, distance_far, location, subset, disjoint +| SORT id +; + +id:l | distance_origin:d | distance_subset:d | distance_disjoint:d | distance_far:d | location:geo_point | subset:geo_point | disjoint:geo_point +0 | 785768.2986429982 | 0.0 | 7114305.127148048 | 7114305.127148048 | ["POINT(5 5)", "POINT(-5 5)"] | "POINT(5 5)" | ["POINT(55 55)", "POINT(65 65)"] +1 | 111195.07310665186 | 0.0 | 7775410.295475619 | 7775410.295475619 | ["POINT(0 1)","POINT(1 0)"] | "POINT(0 1)" | ["POINT(55 55)", "POINT(65 65)"] +2 | 1412359.654429245 | 0.0 | 6511042.96320646 | 6511042.96320646 | "POINT(9 9)" | "POINT(9 9)" | ["POINT(55 55)", "POINT(65 65)"] +3 | 1412359.654429245 | 0.0 | 6511042.96320646 | 6511042.96320646 | ["POINT(-9 -9)","POINT(9 9)"] | "POINT(-9 -9)" | ["POINT(55 55)", "POINT(65 65)"] +4 | 785768.2986429982 | 0.0 | 5612483.563947934 | 5612483.563947934 | ["POINT(5 5)", "POINT(15 15)"] | "POINT(5 5)" | ["POINT(55 55)", "POINT(65 65)"] +5 | 0.0 | 0.0 | 6210584.082742179 | 6210584.082742179 | ["POINT(0 0)","POINT(11 11)"] | "POINT(0 0)" | ["POINT(55 55)", "POINT(65 65)"] +6 | 1412359.654429245 | 0.0 | 6511042.96320646 | 6511042.96320646 | ["POINT(-9 -19)","POINT(9 9)"] | "POINT(-9 -19)" | ["POINT(55 55)", "POINT(65 65)"] +7 | 1756128.8127267 | 0.0 | 6157935.487780502 | 6157935.487780502 | ["POINT(5 15)", "POINT(15 5)"] | "POINT(5 15)" | ["POINT(55 55)", "POINT(65 65)"] +8 | 1223145.8694147274 | 0.0 | 6823348.604540896 | 6823348.604540896 | ["POINT(0 11)","POINT(11 0)"] | "POINT(0 11)" | ["POINT(55 55)", "POINT(65 65)"] +9 | 2329806.5462053656 | 0.0 | 6014935.534393433 | 6014935.534393433 | "POINT(19 9)" | "POINT(19 9)" | ["POINT(55 55)", "POINT(65 65)"] +10 | 2329806.5462053656 | 0.0 | 6014935.534393433 | 6014935.534393433 | ["POINT(-9 -19)","POINT(19 9)"] | "POINT(-9 -19)" | ["POINT(55 55)", "POINT(65 65)"] +11 | 0.0 | 0.0 | 0.0 | 0.0 | ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"] | ["POINT(0 0)", "POINT(55 55)"] | ["POINT(55 55)", "POINT(65 65)"] +12 | 0.0 | 0.0 | 0.0 | 0.0 | ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"] | ["POINT(0 0)", "POINT(55 54)"] | ["POINT(55 55)", "POINT(65 65)"] +; + +whereSpatialDistanceTwoFields +required_capability: st_distance +required_capability: spatial_distance_supports_multivalues + +FROM multivalue_points +| WHERE ST_DISTANCE(location, disjoint) < 6200000 +| KEEP id, location +| SORT id +; + +id:l | location:geo_point +4 | ["POINT(5 5)", "POINT(15 15)"] +7 | ["POINT(5 15)", "POINT(15 5)"] +9 | "POINT(19 9)" +10 | ["POINT(-9 -19)","POINT(19 9)"] +11 | ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"] +12 | ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"] +; + +whereSpatialDistanceKeyword +required_capability: st_distance +required_capability: spatial_distance_supports_multivalues + +FROM multivalue_points +| EVAL lk=lk::geo_point +| WHERE ST_DISTANCE(lk, disjoint) < 6200000 +| KEEP id, location +| SORT id +; + +id:l | location:geo_point +4 | ["POINT(5 5)", "POINT(15 15)"] +7 | ["POINT(5 15)", "POINT(15 5)"] +9 | "POINT(19 9)" +10 | ["POINT(-9 -19)","POINT(19 9)"] +11 | ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"] +12 | ["POINT(0 0)", "POINT(55 55)", "POINT(-55 -55)"] +; + +spatialDistanceFilterTwoFieldStats +required_capability: st_distance +required_capability: spatial_distance_supports_multivalues + +FROM multivalue_points +| EVAL distance_disjoint=ST_DISTANCE(location, disjoint) +| WHERE distance_disjoint > 0 +| EVAL kkm = TO_INTEGER(distance_disjoint / 1000000) +| STATS c=COUNT(*) BY kkm +| SORT kkm ASC +; + +c:long | kkm:integer +5 | 6 +5 | 7 +1 | 8 +; + whereIntersectsPolygon required_capability: st_intersects diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/spatial.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/spatial.csv-spec index b72c8bcb05ae9..c1c4538c7393d 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/spatial.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/spatial.csv-spec @@ -616,6 +616,42 @@ location:geo_point | city_location:geo_point | count:long POINT (0 0) | POINT (0 0) | 1 ; +airportCityLocationPointIntersectionCentroidGroups +required_capability: st_intersects + +FROM airports_mp +| WHERE ST_INTERSECTS(location, city_location) +| STATS location=ST_CENTROID_AGG(location), city_location=ST_CENTROID_AGG(city_location), count=COUNT() BY country +; + +location:geo_point | city_location:geo_point | count:long | country:k +POINT (0 0) | POINT (0 0) | 1 | Atlantis +; + +airportCityLocationPointIntersectionNullCentroid +required_capability: st_intersects +required_capability: spatial_centroid_no_records + +FROM airports +| WHERE ST_INTERSECTS(location, city_location) +| STATS location=ST_CENTROID_AGG(location), city_location=ST_CENTROID_AGG(city_location), count=COUNT() +; + +location:geo_point | city_location:geo_point | count:long +null | null | 0 +; + +airportCityLocationPointIntersectionNullCentroidGroups +required_capability: st_intersects + +FROM airports +| WHERE ST_INTERSECTS(location, city_location) +| STATS location=ST_CENTROID_AGG(location), city_location=ST_CENTROID_AGG(city_location), count=COUNT() BY country +; + +location:geo_point | city_location:geo_point | count:long | country:k +; + ############################################### # Tests for ST_DISJOINT on GEO_POINT type @@ -1948,14 +1984,15 @@ wkt:keyword | pt:cartesian_point cartesianCentroidFromAirportsAfterPointContainsPolygonPredicate required_capability: st_contains_within +required_capability: spatial_centroid_no_records FROM airports_web | WHERE ST_CONTAINS(location, TO_CARTESIANSHAPE("POLYGON((4700000 1600000, 4800000 1600000, 4800000 1700000, 4700000 1700000, 4700000 1600000))")) | STATS centroid=ST_CENTROID_AGG(location), count=COUNT() ; -centroid:cartesian_point | count:long -POINT (NaN NaN) | 0 +centroid:cartesian_point | count:long +null | 0 ; cartesianPointContainsPolygonPredicate @@ -2222,17 +2259,19 @@ wkt:keyword | pt:cartesian_point | distance:double twoCitiesPointDistanceCartesian required_capability: st_distance +required_capability: spatial_distance_supports_multivalues ROW p1 = TO_CARTESIANPOINT("POINT(-90.82814 29.79511)"), p2 = TO_CARTESIANPOINT("POINT(-90.79731509999999 29.8835389)") | EVAL d = ST_DISTANCE(p1, p2) ; p1:cartesian_point | p2:cartesian_point | d:double -POINT (-90.82814 29.79511) | POINT (-90.79731509999999 29.8835389) | 0.09364744959271905 +POINT (-90.82814 29.79511) | POINT (-90.79731509999999 29.8835389) | 0.09364636296011444 ; airportCartesianCityLocationPointDistance required_capability: st_distance +required_capability: spatial_distance_supports_multivalues FROM airports_web | EVAL distance = ST_DISTANCE(location, TO_CARTESIANPOINT("POINT(1402900 7490000)")) @@ -2240,12 +2279,13 @@ FROM airports_web | STATS distance=AVG(distance), min=min(distance), max=max(distance), count=COUNT() ; -distance:double | min:double | max:double | count:long -676858.3463435044 | 7358.02077507206 | 971112.9731194031 | 12 +distance:double | min:double | max:double | count:long +676858.3629952326 | 7358.012830411482 | 971113.1663946278 | 12 ; airportCartesianDistanceToCityCopenhagen required_capability: st_distance +required_capability: spatial_distance_supports_multivalues // tag::st_distance-airports_web[] FROM airports_web @@ -2257,7 +2297,7 @@ FROM airports_web // tag::st_distance-airports_web-result[] abbrev:k | name:text | location:cartesian_point | distance:d -CPH | Copenhagen | POINT(1408119.2975413958 7484813.53657096) | 7358.02077507206 +CPH | Copenhagen | POINT(1408119.2975413958 7484813.53657096) | 7358.012830411482 // end::st_distance-airports_web-result[] ; diff --git a/x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4 b/x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4 index b13606befd2a4..051e83129d12d 100644 --- a/x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4 +++ b/x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4 @@ -209,7 +209,7 @@ SLASH : '/'; PERCENT : '%'; MATCH : 'match'; -NESTED_WHERE : {this.isDevVersion()}? WHERE -> type(WHERE); +NESTED_WHERE : WHERE -> type(WHERE); NAMED_OR_POSITIONAL_PARAM : PARAM (LETTER | UNDERSCORE) UNQUOTED_ID_BODY* diff --git a/x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4 b/x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4 index 9a95e0e6726ba..7d489417ab4ca 100644 --- a/x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4 +++ b/x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4 @@ -173,7 +173,7 @@ aggFields ; aggField - : field {this.isDevVersion()}? (WHERE booleanExpression)? + : field (WHERE booleanExpression)? ; qualifiedName diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndConstantEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndConstantEvaluator.java index a3fc2fadbf227..4917b71464dce 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndConstantEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndConstantEvaluator.java @@ -10,7 +10,6 @@ import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.LongBlock; -import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; @@ -26,63 +25,42 @@ public final class StDistanceCartesianPointDocValuesAndConstantEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final Point rightValue; + private final Point right; private final DriverContext driverContext; private Warnings warnings; public StDistanceCartesianPointDocValuesAndConstantEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, Point rightValue, DriverContext driverContext) { + EvalOperator.ExpressionEvaluator left, Point right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (LongBlock leftValueBlock = (LongBlock) leftValue.eval(page)) { - LongVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock); - } - return eval(page.getPositionCount(), leftValueVector); + try (LongBlock leftBlock = (LongBlock) left.eval(page)) { + return eval(page.getPositionCount(), leftBlock); } } - public DoubleBlock eval(int positionCount, LongBlock leftValueBlock) { + public DoubleBlock eval(int positionCount, LongBlock leftBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } + if (allBlocksAreNulls) { result.appendNull(); continue position; } try { - result.appendDouble(StDistance.processCartesianPointDocValuesAndConstant(leftValueBlock.getLong(leftValueBlock.getFirstValueIndex(p)), this.rightValue)); - } catch (IllegalArgumentException e) { - warnings().registerException(e); - result.appendNull(); - } - } - return result.build(); - } - } - - public DoubleBlock eval(int positionCount, LongVector leftValueVector) { - try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - position: for (int p = 0; p < positionCount; p++) { - try { - result.appendDouble(StDistance.processCartesianPointDocValuesAndConstant(leftValueVector.getLong(p), this.rightValue)); + StDistance.processCartesianPointDocValuesAndConstant(result, p, leftBlock, this.right); } catch (IllegalArgumentException e) { warnings().registerException(e); result.appendNull(); @@ -94,12 +72,12 @@ public DoubleBlock eval(int positionCount, LongVector leftValueVector) { @Override public String toString() { - return "StDistanceCartesianPointDocValuesAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianPointDocValuesAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue); + Releasables.closeExpectNoException(left); } private Warnings warnings() { @@ -117,25 +95,24 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final Point rightValue; + private final Point right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - Point rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, Point right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceCartesianPointDocValuesAndConstantEvaluator get(DriverContext context) { - return new StDistanceCartesianPointDocValuesAndConstantEvaluator(source, leftValue.get(context), rightValue, context); + return new StDistanceCartesianPointDocValuesAndConstantEvaluator(source, left.get(context), right, context); } @Override public String toString() { - return "StDistanceCartesianPointDocValuesAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianPointDocValuesAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndSourceEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndSourceEvaluator.java index 1da164436a2cb..03c8ba1a04ab6 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndSourceEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianPointDocValuesAndSourceEvaluator.java @@ -4,17 +4,12 @@ // 2.0. package org.elasticsearch.xpack.esql.expression.function.scalar.spatial; -import java.lang.IllegalArgumentException; import java.lang.Override; import java.lang.String; -import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BytesRefBlock; -import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.DoubleBlock; -import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.LongBlock; -import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; @@ -29,79 +24,47 @@ public final class StDistanceCartesianPointDocValuesAndSourceEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final EvalOperator.ExpressionEvaluator rightValue; + private final EvalOperator.ExpressionEvaluator right; private final DriverContext driverContext; private Warnings warnings; public StDistanceCartesianPointDocValuesAndSourceEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, EvalOperator.ExpressionEvaluator rightValue, + EvalOperator.ExpressionEvaluator left, EvalOperator.ExpressionEvaluator right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (LongBlock leftValueBlock = (LongBlock) leftValue.eval(page)) { - try (BytesRefBlock rightValueBlock = (BytesRefBlock) rightValue.eval(page)) { - LongVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - BytesRefVector rightValueVector = rightValueBlock.asVector(); - if (rightValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - return eval(page.getPositionCount(), leftValueVector, rightValueVector).asBlock(); + try (LongBlock leftBlock = (LongBlock) left.eval(page)) { + try (BytesRefBlock rightBlock = (BytesRefBlock) right.eval(page)) { + return eval(page.getPositionCount(), leftBlock, rightBlock); } } } - public DoubleBlock eval(int positionCount, LongBlock leftValueBlock, - BytesRefBlock rightValueBlock) { + public DoubleBlock eval(int positionCount, LongBlock leftBlock, BytesRefBlock rightBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef rightValueScratch = new BytesRef(); position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } - result.appendNull(); - continue position; + if (!rightBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (rightValueBlock.isNull(p)) { + if (allBlocksAreNulls) { result.appendNull(); continue position; } - if (rightValueBlock.getValueCount(p) != 1) { - if (rightValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } - result.appendNull(); - continue position; - } - result.appendDouble(StDistance.processCartesianPointDocValuesAndSource(leftValueBlock.getLong(leftValueBlock.getFirstValueIndex(p)), rightValueBlock.getBytesRef(rightValueBlock.getFirstValueIndex(p), rightValueScratch))); - } - return result.build(); - } - } - - public DoubleVector eval(int positionCount, LongVector leftValueVector, - BytesRefVector rightValueVector) { - try(DoubleVector.FixedBuilder result = driverContext.blockFactory().newDoubleVectorFixedBuilder(positionCount)) { - BytesRef rightValueScratch = new BytesRef(); - position: for (int p = 0; p < positionCount; p++) { - result.appendDouble(p, StDistance.processCartesianPointDocValuesAndSource(leftValueVector.getLong(p), rightValueVector.getBytesRef(p, rightValueScratch))); + StDistance.processCartesianPointDocValuesAndSource(result, p, leftBlock, rightBlock); } return result.build(); } @@ -109,12 +72,12 @@ public DoubleVector eval(int positionCount, LongVector leftValueVector, @Override public String toString() { - return "StDistanceCartesianPointDocValuesAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianPointDocValuesAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue, rightValue); + Releasables.closeExpectNoException(left, right); } private Warnings warnings() { @@ -132,25 +95,25 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final EvalOperator.ExpressionEvaluator.Factory rightValue; + private final EvalOperator.ExpressionEvaluator.Factory right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - EvalOperator.ExpressionEvaluator.Factory rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, + EvalOperator.ExpressionEvaluator.Factory right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceCartesianPointDocValuesAndSourceEvaluator get(DriverContext context) { - return new StDistanceCartesianPointDocValuesAndSourceEvaluator(source, leftValue.get(context), rightValue.get(context), context); + return new StDistanceCartesianPointDocValuesAndSourceEvaluator(source, left.get(context), right.get(context), context); } @Override public String toString() { - return "StDistanceCartesianPointDocValuesAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianPointDocValuesAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndConstantEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndConstantEvaluator.java index 61329ad7606d0..1085f71e95b73 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndConstantEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndConstantEvaluator.java @@ -4,14 +4,11 @@ // 2.0. package org.elasticsearch.xpack.esql.expression.function.scalar.spatial; -import java.io.IOException; import java.lang.IllegalArgumentException; import java.lang.Override; import java.lang.String; -import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BytesRefBlock; -import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; @@ -28,66 +25,43 @@ public final class StDistanceCartesianSourceAndConstantEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final Point rightValue; + private final Point right; private final DriverContext driverContext; private Warnings warnings; public StDistanceCartesianSourceAndConstantEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, Point rightValue, DriverContext driverContext) { + EvalOperator.ExpressionEvaluator left, Point right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (BytesRefBlock leftValueBlock = (BytesRefBlock) leftValue.eval(page)) { - BytesRefVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock); - } - return eval(page.getPositionCount(), leftValueVector); + try (BytesRefBlock leftBlock = (BytesRefBlock) left.eval(page)) { + return eval(page.getPositionCount(), leftBlock); } } - public DoubleBlock eval(int positionCount, BytesRefBlock leftValueBlock) { + public DoubleBlock eval(int positionCount, BytesRefBlock leftBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } + if (allBlocksAreNulls) { result.appendNull(); continue position; } try { - result.appendDouble(StDistance.processCartesianSourceAndConstant(leftValueBlock.getBytesRef(leftValueBlock.getFirstValueIndex(p), leftValueScratch), this.rightValue)); - } catch (IllegalArgumentException | IOException e) { - warnings().registerException(e); - result.appendNull(); - } - } - return result.build(); - } - } - - public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector) { - try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); - position: for (int p = 0; p < positionCount; p++) { - try { - result.appendDouble(StDistance.processCartesianSourceAndConstant(leftValueVector.getBytesRef(p, leftValueScratch), this.rightValue)); - } catch (IllegalArgumentException | IOException e) { + StDistance.processCartesianSourceAndConstant(result, p, leftBlock, this.right); + } catch (IllegalArgumentException e) { warnings().registerException(e); result.appendNull(); } @@ -98,12 +72,12 @@ public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector) { @Override public String toString() { - return "StDistanceCartesianSourceAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianSourceAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue); + Releasables.closeExpectNoException(left); } private Warnings warnings() { @@ -121,25 +95,24 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final Point rightValue; + private final Point right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - Point rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, Point right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceCartesianSourceAndConstantEvaluator get(DriverContext context) { - return new StDistanceCartesianSourceAndConstantEvaluator(source, leftValue.get(context), rightValue, context); + return new StDistanceCartesianSourceAndConstantEvaluator(source, left.get(context), right, context); } @Override public String toString() { - return "StDistanceCartesianSourceAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianSourceAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndSourceEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndSourceEvaluator.java index c18c9a56fa77a..c8554a3041c89 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndSourceEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceCartesianSourceAndSourceEvaluator.java @@ -4,14 +4,11 @@ // 2.0. package org.elasticsearch.xpack.esql.expression.function.scalar.spatial; -import java.io.IOException; import java.lang.IllegalArgumentException; import java.lang.Override; import java.lang.String; -import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BytesRefBlock; -import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; @@ -27,88 +24,49 @@ public final class StDistanceCartesianSourceAndSourceEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final EvalOperator.ExpressionEvaluator rightValue; + private final EvalOperator.ExpressionEvaluator right; private final DriverContext driverContext; private Warnings warnings; public StDistanceCartesianSourceAndSourceEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, EvalOperator.ExpressionEvaluator rightValue, + EvalOperator.ExpressionEvaluator left, EvalOperator.ExpressionEvaluator right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (BytesRefBlock leftValueBlock = (BytesRefBlock) leftValue.eval(page)) { - try (BytesRefBlock rightValueBlock = (BytesRefBlock) rightValue.eval(page)) { - BytesRefVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - BytesRefVector rightValueVector = rightValueBlock.asVector(); - if (rightValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - return eval(page.getPositionCount(), leftValueVector, rightValueVector); + try (BytesRefBlock leftBlock = (BytesRefBlock) left.eval(page)) { + try (BytesRefBlock rightBlock = (BytesRefBlock) right.eval(page)) { + return eval(page.getPositionCount(), leftBlock, rightBlock); } } } - public DoubleBlock eval(int positionCount, BytesRefBlock leftValueBlock, - BytesRefBlock rightValueBlock) { + public DoubleBlock eval(int positionCount, BytesRefBlock leftBlock, BytesRefBlock rightBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); - BytesRef rightValueScratch = new BytesRef(); position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; - } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (rightValueBlock.isNull(p)) { - result.appendNull(); - continue position; + if (!rightBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (rightValueBlock.getValueCount(p) != 1) { - if (rightValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } + if (allBlocksAreNulls) { result.appendNull(); continue position; } try { - result.appendDouble(StDistance.processCartesianSourceAndSource(leftValueBlock.getBytesRef(leftValueBlock.getFirstValueIndex(p), leftValueScratch), rightValueBlock.getBytesRef(rightValueBlock.getFirstValueIndex(p), rightValueScratch))); - } catch (IllegalArgumentException | IOException e) { - warnings().registerException(e); - result.appendNull(); - } - } - return result.build(); - } - } - - public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector, - BytesRefVector rightValueVector) { - try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); - BytesRef rightValueScratch = new BytesRef(); - position: for (int p = 0; p < positionCount; p++) { - try { - result.appendDouble(StDistance.processCartesianSourceAndSource(leftValueVector.getBytesRef(p, leftValueScratch), rightValueVector.getBytesRef(p, rightValueScratch))); - } catch (IllegalArgumentException | IOException e) { + StDistance.processCartesianSourceAndSource(result, p, leftBlock, rightBlock); + } catch (IllegalArgumentException e) { warnings().registerException(e); result.appendNull(); } @@ -119,12 +77,12 @@ public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector, @Override public String toString() { - return "StDistanceCartesianSourceAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianSourceAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue, rightValue); + Releasables.closeExpectNoException(left, right); } private Warnings warnings() { @@ -142,25 +100,25 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final EvalOperator.ExpressionEvaluator.Factory rightValue; + private final EvalOperator.ExpressionEvaluator.Factory right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - EvalOperator.ExpressionEvaluator.Factory rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, + EvalOperator.ExpressionEvaluator.Factory right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceCartesianSourceAndSourceEvaluator get(DriverContext context) { - return new StDistanceCartesianSourceAndSourceEvaluator(source, leftValue.get(context), rightValue.get(context), context); + return new StDistanceCartesianSourceAndSourceEvaluator(source, left.get(context), right.get(context), context); } @Override public String toString() { - return "StDistanceCartesianSourceAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceCartesianSourceAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndConstantEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndConstantEvaluator.java index 2ac1ff6aeb0d8..8f37d3157fac6 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndConstantEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndConstantEvaluator.java @@ -10,7 +10,6 @@ import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.LongBlock; -import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; @@ -26,63 +25,42 @@ public final class StDistanceGeoPointDocValuesAndConstantEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final Point rightValue; + private final Point right; private final DriverContext driverContext; private Warnings warnings; public StDistanceGeoPointDocValuesAndConstantEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, Point rightValue, DriverContext driverContext) { + EvalOperator.ExpressionEvaluator left, Point right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (LongBlock leftValueBlock = (LongBlock) leftValue.eval(page)) { - LongVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock); - } - return eval(page.getPositionCount(), leftValueVector); + try (LongBlock leftBlock = (LongBlock) left.eval(page)) { + return eval(page.getPositionCount(), leftBlock); } } - public DoubleBlock eval(int positionCount, LongBlock leftValueBlock) { + public DoubleBlock eval(int positionCount, LongBlock leftBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } + if (allBlocksAreNulls) { result.appendNull(); continue position; } try { - result.appendDouble(StDistance.processGeoPointDocValuesAndConstant(leftValueBlock.getLong(leftValueBlock.getFirstValueIndex(p)), this.rightValue)); - } catch (IllegalArgumentException e) { - warnings().registerException(e); - result.appendNull(); - } - } - return result.build(); - } - } - - public DoubleBlock eval(int positionCount, LongVector leftValueVector) { - try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - position: for (int p = 0; p < positionCount; p++) { - try { - result.appendDouble(StDistance.processGeoPointDocValuesAndConstant(leftValueVector.getLong(p), this.rightValue)); + StDistance.processGeoPointDocValuesAndConstant(result, p, leftBlock, this.right); } catch (IllegalArgumentException e) { warnings().registerException(e); result.appendNull(); @@ -94,12 +72,12 @@ public DoubleBlock eval(int positionCount, LongVector leftValueVector) { @Override public String toString() { - return "StDistanceGeoPointDocValuesAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoPointDocValuesAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue); + Releasables.closeExpectNoException(left); } private Warnings warnings() { @@ -117,25 +95,24 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final Point rightValue; + private final Point right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - Point rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, Point right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceGeoPointDocValuesAndConstantEvaluator get(DriverContext context) { - return new StDistanceGeoPointDocValuesAndConstantEvaluator(source, leftValue.get(context), rightValue, context); + return new StDistanceGeoPointDocValuesAndConstantEvaluator(source, left.get(context), right, context); } @Override public String toString() { - return "StDistanceGeoPointDocValuesAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoPointDocValuesAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndSourceEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndSourceEvaluator.java index 6758d888cc7d1..a7664987739e2 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndSourceEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoPointDocValuesAndSourceEvaluator.java @@ -7,13 +7,10 @@ import java.lang.IllegalArgumentException; import java.lang.Override; import java.lang.String; -import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BytesRefBlock; -import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.LongBlock; -import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; @@ -28,85 +25,48 @@ public final class StDistanceGeoPointDocValuesAndSourceEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final EvalOperator.ExpressionEvaluator rightValue; + private final EvalOperator.ExpressionEvaluator right; private final DriverContext driverContext; private Warnings warnings; public StDistanceGeoPointDocValuesAndSourceEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, EvalOperator.ExpressionEvaluator rightValue, + EvalOperator.ExpressionEvaluator left, EvalOperator.ExpressionEvaluator right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (LongBlock leftValueBlock = (LongBlock) leftValue.eval(page)) { - try (BytesRefBlock rightValueBlock = (BytesRefBlock) rightValue.eval(page)) { - LongVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - BytesRefVector rightValueVector = rightValueBlock.asVector(); - if (rightValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - return eval(page.getPositionCount(), leftValueVector, rightValueVector); + try (LongBlock leftBlock = (LongBlock) left.eval(page)) { + try (BytesRefBlock rightBlock = (BytesRefBlock) right.eval(page)) { + return eval(page.getPositionCount(), leftBlock, rightBlock); } } } - public DoubleBlock eval(int positionCount, LongBlock leftValueBlock, - BytesRefBlock rightValueBlock) { + public DoubleBlock eval(int positionCount, LongBlock leftBlock, BytesRefBlock rightBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef rightValueScratch = new BytesRef(); position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } - result.appendNull(); - continue position; + if (!rightBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (rightValueBlock.isNull(p)) { + if (allBlocksAreNulls) { result.appendNull(); continue position; } - if (rightValueBlock.getValueCount(p) != 1) { - if (rightValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } - result.appendNull(); - continue position; - } - try { - result.appendDouble(StDistance.processGeoPointDocValuesAndSource(leftValueBlock.getLong(leftValueBlock.getFirstValueIndex(p)), rightValueBlock.getBytesRef(rightValueBlock.getFirstValueIndex(p), rightValueScratch))); - } catch (IllegalArgumentException e) { - warnings().registerException(e); - result.appendNull(); - } - } - return result.build(); - } - } - - public DoubleBlock eval(int positionCount, LongVector leftValueVector, - BytesRefVector rightValueVector) { - try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef rightValueScratch = new BytesRef(); - position: for (int p = 0; p < positionCount; p++) { try { - result.appendDouble(StDistance.processGeoPointDocValuesAndSource(leftValueVector.getLong(p), rightValueVector.getBytesRef(p, rightValueScratch))); + StDistance.processGeoPointDocValuesAndSource(result, p, leftBlock, rightBlock); } catch (IllegalArgumentException e) { warnings().registerException(e); result.appendNull(); @@ -118,12 +78,12 @@ public DoubleBlock eval(int positionCount, LongVector leftValueVector, @Override public String toString() { - return "StDistanceGeoPointDocValuesAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoPointDocValuesAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue, rightValue); + Releasables.closeExpectNoException(left, right); } private Warnings warnings() { @@ -141,25 +101,25 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final EvalOperator.ExpressionEvaluator.Factory rightValue; + private final EvalOperator.ExpressionEvaluator.Factory right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - EvalOperator.ExpressionEvaluator.Factory rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, + EvalOperator.ExpressionEvaluator.Factory right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceGeoPointDocValuesAndSourceEvaluator get(DriverContext context) { - return new StDistanceGeoPointDocValuesAndSourceEvaluator(source, leftValue.get(context), rightValue.get(context), context); + return new StDistanceGeoPointDocValuesAndSourceEvaluator(source, left.get(context), right.get(context), context); } @Override public String toString() { - return "StDistanceGeoPointDocValuesAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoPointDocValuesAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndConstantEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndConstantEvaluator.java index 201c29cb04275..06e44f996daf5 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndConstantEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndConstantEvaluator.java @@ -4,14 +4,11 @@ // 2.0. package org.elasticsearch.xpack.esql.expression.function.scalar.spatial; -import java.io.IOException; import java.lang.IllegalArgumentException; import java.lang.Override; import java.lang.String; -import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BytesRefBlock; -import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; @@ -28,66 +25,43 @@ public final class StDistanceGeoSourceAndConstantEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final Point rightValue; + private final Point right; private final DriverContext driverContext; private Warnings warnings; public StDistanceGeoSourceAndConstantEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, Point rightValue, DriverContext driverContext) { + EvalOperator.ExpressionEvaluator left, Point right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (BytesRefBlock leftValueBlock = (BytesRefBlock) leftValue.eval(page)) { - BytesRefVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock); - } - return eval(page.getPositionCount(), leftValueVector); + try (BytesRefBlock leftBlock = (BytesRefBlock) left.eval(page)) { + return eval(page.getPositionCount(), leftBlock); } } - public DoubleBlock eval(int positionCount, BytesRefBlock leftValueBlock) { + public DoubleBlock eval(int positionCount, BytesRefBlock leftBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } + if (allBlocksAreNulls) { result.appendNull(); continue position; } try { - result.appendDouble(StDistance.processGeoSourceAndConstant(leftValueBlock.getBytesRef(leftValueBlock.getFirstValueIndex(p), leftValueScratch), this.rightValue)); - } catch (IllegalArgumentException | IOException e) { - warnings().registerException(e); - result.appendNull(); - } - } - return result.build(); - } - } - - public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector) { - try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); - position: for (int p = 0; p < positionCount; p++) { - try { - result.appendDouble(StDistance.processGeoSourceAndConstant(leftValueVector.getBytesRef(p, leftValueScratch), this.rightValue)); - } catch (IllegalArgumentException | IOException e) { + StDistance.processGeoSourceAndConstant(result, p, leftBlock, this.right); + } catch (IllegalArgumentException e) { warnings().registerException(e); result.appendNull(); } @@ -98,12 +72,12 @@ public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector) { @Override public String toString() { - return "StDistanceGeoSourceAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoSourceAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue); + Releasables.closeExpectNoException(left); } private Warnings warnings() { @@ -121,25 +95,24 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final Point rightValue; + private final Point right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - Point rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, Point right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceGeoSourceAndConstantEvaluator get(DriverContext context) { - return new StDistanceGeoSourceAndConstantEvaluator(source, leftValue.get(context), rightValue, context); + return new StDistanceGeoSourceAndConstantEvaluator(source, left.get(context), right, context); } @Override public String toString() { - return "StDistanceGeoSourceAndConstantEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoSourceAndConstantEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndSourceEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndSourceEvaluator.java index 9cbe30e22c3ed..31e20d9f42197 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndSourceEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistanceGeoSourceAndSourceEvaluator.java @@ -4,14 +4,11 @@ // 2.0. package org.elasticsearch.xpack.esql.expression.function.scalar.spatial; -import java.io.IOException; import java.lang.IllegalArgumentException; import java.lang.Override; import java.lang.String; -import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BytesRefBlock; -import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.DriverContext; @@ -27,88 +24,48 @@ public final class StDistanceGeoSourceAndSourceEvaluator implements EvalOperator.ExpressionEvaluator { private final Source source; - private final EvalOperator.ExpressionEvaluator leftValue; + private final EvalOperator.ExpressionEvaluator left; - private final EvalOperator.ExpressionEvaluator rightValue; + private final EvalOperator.ExpressionEvaluator right; private final DriverContext driverContext; private Warnings warnings; - public StDistanceGeoSourceAndSourceEvaluator(Source source, - EvalOperator.ExpressionEvaluator leftValue, EvalOperator.ExpressionEvaluator rightValue, - DriverContext driverContext) { + public StDistanceGeoSourceAndSourceEvaluator(Source source, EvalOperator.ExpressionEvaluator left, + EvalOperator.ExpressionEvaluator right, DriverContext driverContext) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; this.driverContext = driverContext; } @Override public Block eval(Page page) { - try (BytesRefBlock leftValueBlock = (BytesRefBlock) leftValue.eval(page)) { - try (BytesRefBlock rightValueBlock = (BytesRefBlock) rightValue.eval(page)) { - BytesRefVector leftValueVector = leftValueBlock.asVector(); - if (leftValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - BytesRefVector rightValueVector = rightValueBlock.asVector(); - if (rightValueVector == null) { - return eval(page.getPositionCount(), leftValueBlock, rightValueBlock); - } - return eval(page.getPositionCount(), leftValueVector, rightValueVector); + try (BytesRefBlock leftBlock = (BytesRefBlock) left.eval(page)) { + try (BytesRefBlock rightBlock = (BytesRefBlock) right.eval(page)) { + return eval(page.getPositionCount(), leftBlock, rightBlock); } } } - public DoubleBlock eval(int positionCount, BytesRefBlock leftValueBlock, - BytesRefBlock rightValueBlock) { + public DoubleBlock eval(int positionCount, BytesRefBlock leftBlock, BytesRefBlock rightBlock) { try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); - BytesRef rightValueScratch = new BytesRef(); position: for (int p = 0; p < positionCount; p++) { - if (leftValueBlock.isNull(p)) { - result.appendNull(); - continue position; - } - if (leftValueBlock.getValueCount(p) != 1) { - if (leftValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } - result.appendNull(); - continue position; + boolean allBlocksAreNulls = true; + if (!leftBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (rightValueBlock.isNull(p)) { - result.appendNull(); - continue position; + if (!rightBlock.isNull(p)) { + allBlocksAreNulls = false; } - if (rightValueBlock.getValueCount(p) != 1) { - if (rightValueBlock.getValueCount(p) > 1) { - warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value")); - } + if (allBlocksAreNulls) { result.appendNull(); continue position; } try { - result.appendDouble(StDistance.processGeoSourceAndSource(leftValueBlock.getBytesRef(leftValueBlock.getFirstValueIndex(p), leftValueScratch), rightValueBlock.getBytesRef(rightValueBlock.getFirstValueIndex(p), rightValueScratch))); - } catch (IllegalArgumentException | IOException e) { - warnings().registerException(e); - result.appendNull(); - } - } - return result.build(); - } - } - - public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector, - BytesRefVector rightValueVector) { - try(DoubleBlock.Builder result = driverContext.blockFactory().newDoubleBlockBuilder(positionCount)) { - BytesRef leftValueScratch = new BytesRef(); - BytesRef rightValueScratch = new BytesRef(); - position: for (int p = 0; p < positionCount; p++) { - try { - result.appendDouble(StDistance.processGeoSourceAndSource(leftValueVector.getBytesRef(p, leftValueScratch), rightValueVector.getBytesRef(p, rightValueScratch))); - } catch (IllegalArgumentException | IOException e) { + StDistance.processGeoSourceAndSource(result, p, leftBlock, rightBlock); + } catch (IllegalArgumentException e) { warnings().registerException(e); result.appendNull(); } @@ -119,12 +76,12 @@ public DoubleBlock eval(int positionCount, BytesRefVector leftValueVector, @Override public String toString() { - return "StDistanceGeoSourceAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoSourceAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } @Override public void close() { - Releasables.closeExpectNoException(leftValue, rightValue); + Releasables.closeExpectNoException(left, right); } private Warnings warnings() { @@ -142,25 +99,25 @@ private Warnings warnings() { static class Factory implements EvalOperator.ExpressionEvaluator.Factory { private final Source source; - private final EvalOperator.ExpressionEvaluator.Factory leftValue; + private final EvalOperator.ExpressionEvaluator.Factory left; - private final EvalOperator.ExpressionEvaluator.Factory rightValue; + private final EvalOperator.ExpressionEvaluator.Factory right; - public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory leftValue, - EvalOperator.ExpressionEvaluator.Factory rightValue) { + public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory left, + EvalOperator.ExpressionEvaluator.Factory right) { this.source = source; - this.leftValue = leftValue; - this.rightValue = rightValue; + this.left = left; + this.right = right; } @Override public StDistanceGeoSourceAndSourceEvaluator get(DriverContext context) { - return new StDistanceGeoSourceAndSourceEvaluator(source, leftValue.get(context), rightValue.get(context), context); + return new StDistanceGeoSourceAndSourceEvaluator(source, left.get(context), right.get(context), context); } @Override public String toString() { - return "StDistanceGeoSourceAndSourceEvaluator[" + "leftValue=" + leftValue + ", rightValue=" + rightValue + "]"; + return "StDistanceGeoSourceAndSourceEvaluator[" + "left=" + left + ", right=" + right + "]"; } } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java index f5baaef4f579d..18ebbe6d898af 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java @@ -170,11 +170,21 @@ public enum Cap { */ SPATIAL_PREDICATES_SUPPORT_MULTIVALUES, + /** + * Enable spatial distance function to support multi-values. Done in #114836. + */ + SPATIAL_DISTANCE_SUPPORTS_MULTIVALUES, + /** * Support a number of fixes and enhancements to spatial distance pushdown. Done in #112938. */ SPATIAL_DISTANCE_PUSHDOWN_ENHANCEMENTS, + /** + * Fix for spatial centroid when no records are found. + */ + SPATIAL_CENTROID_NO_RECORDS, + /** * Fix to GROK and DISSECT that allows extracting attributes with the same name as the input * https://github.com/elastic/elasticsearch/issues/110184 diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/CountDistinct.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/CountDistinct.java index 2550e5bdcf515..756000dfbb187 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/CountDistinct.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/CountDistinct.java @@ -209,7 +209,7 @@ public AggregatorFunctionSupplier supplier(List inputChannels) { if (type == DataType.DOUBLE) { return new CountDistinctDoubleAggregatorFunctionSupplier(inputChannels, precision); } - if (type == DataType.KEYWORD || type == DataType.IP || type == DataType.VERSION || type == DataType.TEXT) { + if (DataType.isString(type) || type == DataType.IP || type == DataType.VERSION) { return new CountDistinctBytesRefAggregatorFunctionSupplier(inputChannels, precision); } throw EsqlIllegalArgumentException.illegalDataType(type); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Max.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Max.java index 47d74c71d9cc5..6119b2ce58465 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Max.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Max.java @@ -128,7 +128,7 @@ public final AggregatorFunctionSupplier supplier(List inputChannels) { if (type == DataType.IP) { return new MaxIpAggregatorFunctionSupplier(inputChannels); } - if (type == DataType.VERSION || type == DataType.KEYWORD || type == DataType.TEXT) { + if (type == DataType.VERSION || DataType.isString(type)) { return new MaxBytesRefAggregatorFunctionSupplier(inputChannels); } throw EsqlIllegalArgumentException.illegalDataType(type); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Min.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Min.java index ce69decca8e81..a1492f79da393 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Min.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Min.java @@ -128,7 +128,7 @@ public final AggregatorFunctionSupplier supplier(List inputChannels) { if (type == DataType.IP) { return new MinIpAggregatorFunctionSupplier(inputChannels); } - if (type == DataType.VERSION || type == DataType.KEYWORD || type == DataType.TEXT) { + if (type == DataType.VERSION || DataType.isString(type)) { return new MinBytesRefAggregatorFunctionSupplier(inputChannels); } throw EsqlIllegalArgumentException.illegalDataType(type); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java index 9d815d15accdc..d47ebeab4ca6c 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java @@ -155,11 +155,7 @@ public ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) { if (dataType == DataType.LONG || dataType == DataType.DATETIME) { return new GreatestLongEvaluator.Factory(source(), factories); } - if (dataType == DataType.KEYWORD - || dataType == DataType.TEXT - || dataType == DataType.IP - || dataType == DataType.VERSION - || dataType == DataType.UNSUPPORTED) { + if (DataType.isString(dataType) || dataType == DataType.IP || dataType == DataType.VERSION || dataType == DataType.UNSUPPORTED) { return new GreatestBytesRefEvaluator.Factory(source(), factories); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java index 435a14d0fef33..81c1419dcf788 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java @@ -154,11 +154,7 @@ public ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) { if (dataType == DataType.LONG || dataType == DataType.DATETIME) { return new LeastLongEvaluator.Factory(source(), factories); } - if (dataType == DataType.KEYWORD - || dataType == DataType.TEXT - || dataType == DataType.IP - || dataType == DataType.VERSION - || dataType == DataType.UNSUPPORTED) { + if (DataType.isString(dataType) || dataType == DataType.IP || dataType == DataType.VERSION || dataType == DataType.UNSUPPORTED) { return new LeastBytesRefEvaluator.Factory(source(), factories); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java index 5401fcf188d4a..06815d738e82c 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java @@ -48,7 +48,6 @@ public abstract class AbstractConvertFunction extends UnaryScalarFunction { // the numeric types convert functions need to handle; the other numeric types are converted upstream to one of these private static final List NUMERIC_TYPES = List.of(DataType.INTEGER, DataType.LONG, DataType.UNSIGNED_LONG, DataType.DOUBLE); - public static final List STRING_TYPES = DataType.types().stream().filter(DataType::isString).toList(); protected AbstractConvertFunction(Source source, Expression field) { super(source, field); @@ -90,9 +89,9 @@ private static String supportedTypesNames(Set types) { NUMERIC_TYPES.forEach(supportTypes::remove); } - if (types.containsAll(STRING_TYPES)) { + if (types.containsAll(DataType.stringTypes())) { supportedTypesNames.add("string"); - STRING_TYPES.forEach(supportTypes::remove); + DataType.stringTypes().forEach(supportTypes::remove); } supportTypes.forEach(t -> supportedTypesNames.add(t.nameUpper().toLowerCase(Locale.ROOT))); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistance.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistance.java index ae9d3383bad39..3cf042a2db828 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistance.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StDistance.java @@ -14,6 +14,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; +import org.elasticsearch.compute.data.BytesRefBlock; +import org.elasticsearch.compute.data.DoubleBlock; +import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Point; @@ -77,8 +80,9 @@ protected CartesianDistanceCalculator() { @Override protected double distance(Point left, Point right) { - final double diffX = left.getX() - right.getX(); - final double diffY = left.getY() - right.getY(); + // Cast coordinates to float to mimic Lucene behaviour, so we get identical results + final double diffX = (double) ((float) left.getX()) - (double) ((float) right.getX()); + final double diffY = (double) ((float) left.getY()) - (double) ((float) right.getY()); return Math.sqrt(diffX * diffX + diffY * diffY); } } @@ -100,11 +104,6 @@ protected Double compare(BytesRef left, BytesRef right) throws IOException { protected abstract double distance(Point left, Point right); - protected double distance(long encoded, Geometry right) { - Point point = spatialCoordinateType.longAsPoint(encoded); - return distance(point, (Point) right); - } - protected double distance(Geometry left, Geometry right) { return distance((Point) left, (Point) right); } @@ -113,8 +112,112 @@ public double distance(BytesRef left, BytesRef right) { return distance(this.fromBytesRef(left), this.fromBytesRef(right)); } - public double distance(BytesRef left, Point right) { - return distance(this.fromBytesRef(left), right); + public void distanceSourceAndConstant(DoubleBlock.Builder results, int position, BytesRefBlock left, Point right) { + int valueCount = left.getValueCount(position); + if (valueCount < 1) { + results.appendNull(); + } else { + final BytesRef scratch = new BytesRef(); + final int firstValueIndex = left.getFirstValueIndex(position); + double distance = Double.MAX_VALUE; + if (valueCount == 1) { + distance = distance(fromBytesRef(left.getBytesRef(firstValueIndex, scratch)), right); + } else { + for (int i = 0; i < valueCount; i++) { + double value = distance(fromBytesRef(left.getBytesRef(firstValueIndex + i, scratch)), right); + if (value < distance) { + distance = value; + } + } + } + results.appendDouble(distance); + } + } + + public void distanceSourceAndSource(DoubleBlock.Builder results, int position, BytesRefBlock left, BytesRefBlock right) { + int leftCount = left.getValueCount(position); + int rightCount = right.getValueCount(position); + if (leftCount < 1 || rightCount < 1) { + results.appendNull(); + } else { + final BytesRef scratchLeft = new BytesRef(); + final BytesRef scratchRight = new BytesRef(); + final int leftFirstValueIndex = left.getFirstValueIndex(position); + final int rightFirstValueIndex = right.getFirstValueIndex(position); + double distance = Double.MAX_VALUE; + if (leftCount == 1 && rightCount == 1) { + distance = distance( + fromBytesRef(left.getBytesRef(leftFirstValueIndex, scratchLeft)), + fromBytesRef(right.getBytesRef(rightFirstValueIndex, scratchRight)) + ); + } else { + for (int i = 0; i < leftCount; i++) { + for (int j = 0; j < rightCount; j++) { + double value = distance( + fromBytesRef(left.getBytesRef(leftFirstValueIndex + i, scratchLeft)), + fromBytesRef(right.getBytesRef(rightFirstValueIndex + j, scratchRight)) + ); + if (value < distance) { + distance = value; + } + } + } + } + results.appendDouble(distance); + } + } + + public void distancePointDocValuesAndConstant(DoubleBlock.Builder results, int position, LongBlock left, Point right) { + int valueCount = left.getValueCount(position); + if (valueCount < 1) { + results.appendNull(); + } else { + final int firstValueIndex = left.getFirstValueIndex(position); + double distance = Double.MAX_VALUE; + if (valueCount == 1) { + distance = distance(spatialCoordinateType.longAsPoint(left.getLong(firstValueIndex)), right); + } else { + for (int i = 0; i < valueCount; i++) { + double value = distance(spatialCoordinateType.longAsPoint(left.getLong(firstValueIndex + i)), right); + if (value < distance) { + distance = value; + } + } + } + results.appendDouble(distance); + } + } + + public void distancePointDocValuesAndSource(DoubleBlock.Builder results, int position, LongBlock left, BytesRefBlock right) { + int leftCount = left.getValueCount(position); + int rightCount = right.getValueCount(position); + if (leftCount < 1 || rightCount < 1) { + results.appendNull(); + } else { + final BytesRef scratchRight = new BytesRef(); + final int leftFirstValueIndex = left.getFirstValueIndex(position); + final int rightFirstValueIndex = right.getFirstValueIndex(position); + double distance = Double.MAX_VALUE; + if (leftCount == 1 && rightCount == 1) { + distance = distance( + spatialCoordinateType.longAsPoint(left.getLong(leftFirstValueIndex)), + fromBytesRef(right.getBytesRef(rightFirstValueIndex, scratchRight)) + ); + } + for (int i = 0; i < leftCount; i++) { + for (int j = 0; j < rightCount; j++) { + double value = distance( + spatialCoordinateType.longAsPoint(left.getLong(leftFirstValueIndex + i)), + fromBytesRef(right.getBytesRef(rightFirstValueIndex + j, scratchRight)) + ); + if (value < distance) { + distance = value; + } + } + } + results.appendDouble(distance); + } + } } @@ -249,45 +352,43 @@ private EvalOperator.ExpressionEvaluator.Factory toEvaluator( throw EsqlIllegalArgumentException.illegalDataType(crsType().name()); } - @Evaluator(extraName = "GeoSourceAndConstant", warnExceptions = { IllegalArgumentException.class, IOException.class }) - static double processGeoSourceAndConstant(BytesRef leftValue, @Fixed Point rightValue) throws IOException { - return GEO.distance(leftValue, rightValue); + @Evaluator(extraName = "GeoSourceAndConstant", warnExceptions = { IllegalArgumentException.class }) + static void processGeoSourceAndConstant(DoubleBlock.Builder results, int p, BytesRefBlock left, @Fixed Point right) { + GEO.distanceSourceAndConstant(results, p, left, right); } - @Evaluator(extraName = "GeoSourceAndSource", warnExceptions = { IllegalArgumentException.class, IOException.class }) - static double processGeoSourceAndSource(BytesRef leftValue, BytesRef rightValue) throws IOException { - return GEO.distance(leftValue, rightValue); + @Evaluator(extraName = "GeoSourceAndSource", warnExceptions = { IllegalArgumentException.class }) + static void processGeoSourceAndSource(DoubleBlock.Builder results, int p, BytesRefBlock left, BytesRefBlock right) { + GEO.distanceSourceAndSource(results, p, left, right); } @Evaluator(extraName = "GeoPointDocValuesAndConstant", warnExceptions = { IllegalArgumentException.class }) - static double processGeoPointDocValuesAndConstant(long leftValue, @Fixed Point rightValue) { - return GEO.distance(leftValue, rightValue); + static void processGeoPointDocValuesAndConstant(DoubleBlock.Builder results, int p, LongBlock left, @Fixed Point right) { + GEO.distancePointDocValuesAndConstant(results, p, left, right); } @Evaluator(extraName = "GeoPointDocValuesAndSource", warnExceptions = { IllegalArgumentException.class }) - static double processGeoPointDocValuesAndSource(long leftValue, BytesRef rightValue) { - Geometry geometry = SpatialCoordinateTypes.UNSPECIFIED.wkbToGeometry(rightValue); - return GEO.distance(leftValue, geometry); + static void processGeoPointDocValuesAndSource(DoubleBlock.Builder results, int p, LongBlock left, BytesRefBlock right) { + GEO.distancePointDocValuesAndSource(results, p, left, right); } - @Evaluator(extraName = "CartesianSourceAndConstant", warnExceptions = { IllegalArgumentException.class, IOException.class }) - static double processCartesianSourceAndConstant(BytesRef leftValue, @Fixed Point rightValue) throws IOException { - return CARTESIAN.distance(leftValue, rightValue); + @Evaluator(extraName = "CartesianSourceAndConstant", warnExceptions = { IllegalArgumentException.class }) + static void processCartesianSourceAndConstant(DoubleBlock.Builder results, int p, BytesRefBlock left, @Fixed Point right) { + CARTESIAN.distanceSourceAndConstant(results, p, left, right); } - @Evaluator(extraName = "CartesianSourceAndSource", warnExceptions = { IllegalArgumentException.class, IOException.class }) - static double processCartesianSourceAndSource(BytesRef leftValue, BytesRef rightValue) throws IOException { - return CARTESIAN.distance(leftValue, rightValue); + @Evaluator(extraName = "CartesianSourceAndSource", warnExceptions = { IllegalArgumentException.class }) + static void processCartesianSourceAndSource(DoubleBlock.Builder results, int p, BytesRefBlock left, BytesRefBlock right) { + CARTESIAN.distanceSourceAndSource(results, p, left, right); } @Evaluator(extraName = "CartesianPointDocValuesAndConstant", warnExceptions = { IllegalArgumentException.class }) - static double processCartesianPointDocValuesAndConstant(long leftValue, @Fixed Point rightValue) { - return CARTESIAN.distance(leftValue, rightValue); + static void processCartesianPointDocValuesAndConstant(DoubleBlock.Builder results, int p, LongBlock left, @Fixed Point right) { + CARTESIAN.distancePointDocValuesAndConstant(results, p, left, right); } @Evaluator(extraName = "CartesianPointDocValuesAndSource") - static double processCartesianPointDocValuesAndSource(long leftValue, BytesRef rightValue) { - Geometry geometry = SpatialCoordinateTypes.UNSPECIFIED.wkbToGeometry(rightValue); - return CARTESIAN.distance(leftValue, geometry); + static void processCartesianPointDocValuesAndSource(DoubleBlock.Builder results, int p, LongBlock left, BytesRefBlock right) { + CARTESIAN.distancePointDocValuesAndSource(results, p, left, right); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/comparison/InsensitiveEqualsMapper.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/comparison/InsensitiveEqualsMapper.java index d11f5c9b68532..f5704239993f9 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/comparison/InsensitiveEqualsMapper.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/comparison/InsensitiveEqualsMapper.java @@ -34,7 +34,7 @@ public final ExpressionEvaluator.Factory map(InsensitiveEquals bc, Layout layout var leftEval = toEvaluator(bc.left(), layout); var rightEval = toEvaluator(bc.right(), layout); - if (leftType == DataType.KEYWORD || leftType == DataType.TEXT) { + if (DataType.isString(leftType)) { if (bc.right().foldable() && DataType.isString(rightType)) { BytesRef rightVal = BytesRefs.toBytesRef(bc.right().fold()); Automaton automaton = InsensitiveEquals.automaton(rightVal); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/physical/local/EnableSpatialDistancePushdown.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/physical/local/EnableSpatialDistancePushdown.java index ec25c69deba5c..cde305e52a705 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/physical/local/EnableSpatialDistancePushdown.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/physical/local/EnableSpatialDistancePushdown.java @@ -95,7 +95,7 @@ private FilterExec rewrite(FilterExec filterExec, EsQueryExec esQueryExec) { } return comparison; }); - if (rewritten.equals(filterExec.condition()) == false) { + if (rewritten.equals(filterExec.condition()) == false && canPushToSource(rewritten, x -> false)) { return new FilterExec(filterExec.source(), esQueryExec, rewritten); } return filterExec; diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp index aa6ddfb433d23..1a0105b9951d2 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp @@ -466,4 +466,4 @@ METRICS_MODE CLOSING_METRICS_MODE atn: -[4, 0, 120, 1472, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, 7, 193, 2, 194, 7, 194, 2, 195, 7, 195, 2, 196, 7, 196, 2, 197, 7, 197, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 4, 19, 578, 8, 19, 11, 19, 12, 19, 579, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 588, 8, 20, 10, 20, 12, 20, 591, 9, 20, 1, 20, 3, 20, 594, 8, 20, 1, 20, 3, 20, 597, 8, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 606, 8, 21, 10, 21, 12, 21, 609, 9, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 4, 22, 617, 8, 22, 11, 22, 12, 22, 618, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 3, 28, 638, 8, 28, 1, 28, 4, 28, 641, 8, 28, 11, 28, 12, 28, 642, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 3, 31, 652, 8, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 3, 33, 659, 8, 33, 1, 34, 1, 34, 1, 34, 5, 34, 664, 8, 34, 10, 34, 12, 34, 667, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 675, 8, 34, 10, 34, 12, 34, 678, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 685, 8, 34, 1, 34, 3, 34, 688, 8, 34, 3, 34, 690, 8, 34, 1, 35, 4, 35, 693, 8, 35, 11, 35, 12, 35, 694, 1, 36, 4, 36, 698, 8, 36, 11, 36, 12, 36, 699, 1, 36, 1, 36, 5, 36, 704, 8, 36, 10, 36, 12, 36, 707, 9, 36, 1, 36, 1, 36, 4, 36, 711, 8, 36, 11, 36, 12, 36, 712, 1, 36, 4, 36, 716, 8, 36, 11, 36, 12, 36, 717, 1, 36, 1, 36, 5, 36, 722, 8, 36, 10, 36, 12, 36, 725, 9, 36, 3, 36, 727, 8, 36, 1, 36, 1, 36, 1, 36, 1, 36, 4, 36, 733, 8, 36, 11, 36, 12, 36, 734, 1, 36, 1, 36, 3, 36, 739, 8, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 3, 74, 872, 8, 74, 1, 74, 5, 74, 875, 8, 74, 10, 74, 12, 74, 878, 9, 74, 1, 74, 1, 74, 4, 74, 882, 8, 74, 11, 74, 12, 74, 883, 3, 74, 886, 8, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 5, 77, 900, 8, 77, 10, 77, 12, 77, 903, 9, 77, 1, 77, 1, 77, 3, 77, 907, 8, 77, 1, 77, 4, 77, 910, 8, 77, 11, 77, 12, 77, 911, 3, 77, 914, 8, 77, 1, 78, 1, 78, 4, 78, 918, 8, 78, 11, 78, 12, 78, 919, 1, 78, 1, 78, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 3, 95, 997, 8, 95, 1, 96, 4, 96, 1000, 8, 96, 11, 96, 12, 96, 1001, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 3, 107, 1049, 8, 107, 1, 108, 1, 108, 3, 108, 1053, 8, 108, 1, 108, 5, 108, 1056, 8, 108, 10, 108, 12, 108, 1059, 9, 108, 1, 108, 1, 108, 3, 108, 1063, 8, 108, 1, 108, 4, 108, 1066, 8, 108, 11, 108, 12, 108, 1067, 3, 108, 1070, 8, 108, 1, 109, 1, 109, 4, 109, 1074, 8, 109, 11, 109, 12, 109, 1075, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 129, 4, 129, 1159, 8, 129, 11, 129, 12, 129, 1160, 1, 129, 1, 129, 3, 129, 1165, 8, 129, 1, 129, 4, 129, 1168, 8, 129, 11, 129, 12, 129, 1169, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 149, 1, 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 151, 1, 151, 1, 151, 1, 151, 1, 152, 1, 152, 1, 152, 1, 152, 1, 153, 1, 153, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 158, 1, 159, 1, 159, 1, 159, 1, 159, 1, 160, 1, 160, 1, 160, 1, 160, 1, 160, 1, 161, 1, 161, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 4, 162, 1309, 8, 162, 11, 162, 12, 162, 1310, 1, 163, 1, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, 164, 1, 164, 1, 165, 1, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, 1, 169, 1, 169, 1, 169, 1, 169, 1, 170, 1, 170, 1, 170, 1, 170, 1, 170, 1, 171, 1, 171, 1, 171, 1, 171, 1, 172, 1, 172, 1, 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 175, 1, 175, 1, 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 177, 1, 177, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 180, 1, 180, 1, 181, 1, 181, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 184, 1, 184, 1, 184, 1, 184, 1, 184, 1, 184, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 191, 1, 191, 1, 191, 1, 191, 1, 192, 1, 192, 1, 192, 1, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 2, 607, 676, 0, 198, 15, 1, 17, 2, 19, 3, 21, 4, 23, 5, 25, 6, 27, 7, 29, 8, 31, 9, 33, 10, 35, 11, 37, 12, 39, 13, 41, 14, 43, 15, 45, 16, 47, 17, 49, 18, 51, 19, 53, 20, 55, 21, 57, 22, 59, 23, 61, 24, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 0, 81, 0, 83, 25, 85, 26, 87, 27, 89, 28, 91, 29, 93, 30, 95, 31, 97, 32, 99, 33, 101, 34, 103, 35, 105, 36, 107, 37, 109, 38, 111, 39, 113, 40, 115, 41, 117, 42, 119, 43, 121, 44, 123, 45, 125, 46, 127, 47, 129, 48, 131, 49, 133, 50, 135, 51, 137, 52, 139, 53, 141, 54, 143, 55, 145, 56, 147, 57, 149, 58, 151, 59, 153, 60, 155, 61, 157, 62, 159, 63, 161, 0, 163, 64, 165, 65, 167, 66, 169, 67, 171, 0, 173, 68, 175, 69, 177, 70, 179, 71, 181, 0, 183, 0, 185, 72, 187, 73, 189, 74, 191, 0, 193, 0, 195, 0, 197, 0, 199, 0, 201, 0, 203, 75, 205, 0, 207, 76, 209, 0, 211, 0, 213, 77, 215, 78, 217, 79, 219, 0, 221, 0, 223, 0, 225, 0, 227, 0, 229, 0, 231, 0, 233, 80, 235, 81, 237, 82, 239, 83, 241, 0, 243, 0, 245, 0, 247, 0, 249, 0, 251, 0, 253, 84, 255, 0, 257, 85, 259, 86, 261, 87, 263, 0, 265, 0, 267, 88, 269, 89, 271, 0, 273, 90, 275, 0, 277, 91, 279, 92, 281, 93, 283, 0, 285, 0, 287, 0, 289, 0, 291, 0, 293, 0, 295, 0, 297, 0, 299, 0, 301, 94, 303, 95, 305, 96, 307, 0, 309, 0, 311, 0, 313, 0, 315, 0, 317, 0, 319, 97, 321, 98, 323, 99, 325, 0, 327, 100, 329, 101, 331, 102, 333, 103, 335, 0, 337, 104, 339, 105, 341, 106, 343, 107, 345, 108, 347, 0, 349, 0, 351, 0, 353, 0, 355, 0, 357, 0, 359, 0, 361, 109, 363, 110, 365, 111, 367, 0, 369, 0, 371, 0, 373, 0, 375, 112, 377, 113, 379, 114, 381, 0, 383, 0, 385, 0, 387, 115, 389, 116, 391, 117, 393, 0, 395, 0, 397, 118, 399, 119, 401, 120, 403, 0, 405, 0, 407, 0, 409, 0, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 35, 2, 0, 68, 68, 100, 100, 2, 0, 73, 73, 105, 105, 2, 0, 83, 83, 115, 115, 2, 0, 69, 69, 101, 101, 2, 0, 67, 67, 99, 99, 2, 0, 84, 84, 116, 116, 2, 0, 82, 82, 114, 114, 2, 0, 79, 79, 111, 111, 2, 0, 80, 80, 112, 112, 2, 0, 78, 78, 110, 110, 2, 0, 72, 72, 104, 104, 2, 0, 86, 86, 118, 118, 2, 0, 65, 65, 97, 97, 2, 0, 76, 76, 108, 108, 2, 0, 88, 88, 120, 120, 2, 0, 70, 70, 102, 102, 2, 0, 77, 77, 109, 109, 2, 0, 71, 71, 103, 103, 2, 0, 75, 75, 107, 107, 2, 0, 87, 87, 119, 119, 2, 0, 85, 85, 117, 117, 6, 0, 9, 10, 13, 13, 32, 32, 47, 47, 91, 91, 93, 93, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 13, 13, 32, 32, 1, 0, 48, 57, 2, 0, 65, 90, 97, 122, 8, 0, 34, 34, 78, 78, 82, 82, 84, 84, 92, 92, 110, 110, 114, 114, 116, 116, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 43, 43, 45, 45, 1, 0, 96, 96, 2, 0, 66, 66, 98, 98, 2, 0, 89, 89, 121, 121, 11, 0, 9, 10, 13, 13, 32, 32, 34, 34, 44, 44, 47, 47, 58, 58, 61, 61, 91, 91, 93, 93, 124, 124, 2, 0, 42, 42, 47, 47, 11, 0, 9, 10, 13, 13, 32, 32, 34, 35, 44, 44, 47, 47, 58, 58, 60, 60, 62, 63, 92, 92, 124, 124, 1500, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 1, 61, 1, 0, 0, 0, 1, 83, 1, 0, 0, 0, 1, 85, 1, 0, 0, 0, 1, 87, 1, 0, 0, 0, 1, 89, 1, 0, 0, 0, 1, 91, 1, 0, 0, 0, 1, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0, 1, 97, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 1, 101, 1, 0, 0, 0, 1, 103, 1, 0, 0, 0, 1, 105, 1, 0, 0, 0, 1, 107, 1, 0, 0, 0, 1, 109, 1, 0, 0, 0, 1, 111, 1, 0, 0, 0, 1, 113, 1, 0, 0, 0, 1, 115, 1, 0, 0, 0, 1, 117, 1, 0, 0, 0, 1, 119, 1, 0, 0, 0, 1, 121, 1, 0, 0, 0, 1, 123, 1, 0, 0, 0, 1, 125, 1, 0, 0, 0, 1, 127, 1, 0, 0, 0, 1, 129, 1, 0, 0, 0, 1, 131, 1, 0, 0, 0, 1, 133, 1, 0, 0, 0, 1, 135, 1, 0, 0, 0, 1, 137, 1, 0, 0, 0, 1, 139, 1, 0, 0, 0, 1, 141, 1, 0, 0, 0, 1, 143, 1, 0, 0, 0, 1, 145, 1, 0, 0, 0, 1, 147, 1, 0, 0, 0, 1, 149, 1, 0, 0, 0, 1, 151, 1, 0, 0, 0, 1, 153, 1, 0, 0, 0, 1, 155, 1, 0, 0, 0, 1, 157, 1, 0, 0, 0, 1, 159, 1, 0, 0, 0, 1, 161, 1, 0, 0, 0, 1, 163, 1, 0, 0, 0, 1, 165, 1, 0, 0, 0, 1, 167, 1, 0, 0, 0, 1, 169, 1, 0, 0, 0, 1, 173, 1, 0, 0, 0, 1, 175, 1, 0, 0, 0, 1, 177, 1, 0, 0, 0, 1, 179, 1, 0, 0, 0, 2, 181, 1, 0, 0, 0, 2, 183, 1, 0, 0, 0, 2, 185, 1, 0, 0, 0, 2, 187, 1, 0, 0, 0, 2, 189, 1, 0, 0, 0, 3, 191, 1, 0, 0, 0, 3, 193, 1, 0, 0, 0, 3, 195, 1, 0, 0, 0, 3, 197, 1, 0, 0, 0, 3, 199, 1, 0, 0, 0, 3, 201, 1, 0, 0, 0, 3, 203, 1, 0, 0, 0, 3, 207, 1, 0, 0, 0, 3, 209, 1, 0, 0, 0, 3, 211, 1, 0, 0, 0, 3, 213, 1, 0, 0, 0, 3, 215, 1, 0, 0, 0, 3, 217, 1, 0, 0, 0, 4, 219, 1, 0, 0, 0, 4, 221, 1, 0, 0, 0, 4, 223, 1, 0, 0, 0, 4, 225, 1, 0, 0, 0, 4, 227, 1, 0, 0, 0, 4, 233, 1, 0, 0, 0, 4, 235, 1, 0, 0, 0, 4, 237, 1, 0, 0, 0, 4, 239, 1, 0, 0, 0, 5, 241, 1, 0, 0, 0, 5, 243, 1, 0, 0, 0, 5, 245, 1, 0, 0, 0, 5, 247, 1, 0, 0, 0, 5, 249, 1, 0, 0, 0, 5, 251, 1, 0, 0, 0, 5, 253, 1, 0, 0, 0, 5, 255, 1, 0, 0, 0, 5, 257, 1, 0, 0, 0, 5, 259, 1, 0, 0, 0, 5, 261, 1, 0, 0, 0, 6, 263, 1, 0, 0, 0, 6, 265, 1, 0, 0, 0, 6, 267, 1, 0, 0, 0, 6, 269, 1, 0, 0, 0, 6, 273, 1, 0, 0, 0, 6, 275, 1, 0, 0, 0, 6, 277, 1, 0, 0, 0, 6, 279, 1, 0, 0, 0, 6, 281, 1, 0, 0, 0, 7, 283, 1, 0, 0, 0, 7, 285, 1, 0, 0, 0, 7, 287, 1, 0, 0, 0, 7, 289, 1, 0, 0, 0, 7, 291, 1, 0, 0, 0, 7, 293, 1, 0, 0, 0, 7, 295, 1, 0, 0, 0, 7, 297, 1, 0, 0, 0, 7, 299, 1, 0, 0, 0, 7, 301, 1, 0, 0, 0, 7, 303, 1, 0, 0, 0, 7, 305, 1, 0, 0, 0, 8, 307, 1, 0, 0, 0, 8, 309, 1, 0, 0, 0, 8, 311, 1, 0, 0, 0, 8, 313, 1, 0, 0, 0, 8, 315, 1, 0, 0, 0, 8, 317, 1, 0, 0, 0, 8, 319, 1, 0, 0, 0, 8, 321, 1, 0, 0, 0, 8, 323, 1, 0, 0, 0, 9, 325, 1, 0, 0, 0, 9, 327, 1, 0, 0, 0, 9, 329, 1, 0, 0, 0, 9, 331, 1, 0, 0, 0, 9, 333, 1, 0, 0, 0, 10, 335, 1, 0, 0, 0, 10, 337, 1, 0, 0, 0, 10, 339, 1, 0, 0, 0, 10, 341, 1, 0, 0, 0, 10, 343, 1, 0, 0, 0, 10, 345, 1, 0, 0, 0, 11, 347, 1, 0, 0, 0, 11, 349, 1, 0, 0, 0, 11, 351, 1, 0, 0, 0, 11, 353, 1, 0, 0, 0, 11, 355, 1, 0, 0, 0, 11, 357, 1, 0, 0, 0, 11, 359, 1, 0, 0, 0, 11, 361, 1, 0, 0, 0, 11, 363, 1, 0, 0, 0, 11, 365, 1, 0, 0, 0, 12, 367, 1, 0, 0, 0, 12, 369, 1, 0, 0, 0, 12, 371, 1, 0, 0, 0, 12, 373, 1, 0, 0, 0, 12, 375, 1, 0, 0, 0, 12, 377, 1, 0, 0, 0, 12, 379, 1, 0, 0, 0, 13, 381, 1, 0, 0, 0, 13, 383, 1, 0, 0, 0, 13, 385, 1, 0, 0, 0, 13, 387, 1, 0, 0, 0, 13, 389, 1, 0, 0, 0, 13, 391, 1, 0, 0, 0, 14, 393, 1, 0, 0, 0, 14, 395, 1, 0, 0, 0, 14, 397, 1, 0, 0, 0, 14, 399, 1, 0, 0, 0, 14, 401, 1, 0, 0, 0, 14, 403, 1, 0, 0, 0, 14, 405, 1, 0, 0, 0, 14, 407, 1, 0, 0, 0, 14, 409, 1, 0, 0, 0, 15, 411, 1, 0, 0, 0, 17, 421, 1, 0, 0, 0, 19, 428, 1, 0, 0, 0, 21, 437, 1, 0, 0, 0, 23, 444, 1, 0, 0, 0, 25, 454, 1, 0, 0, 0, 27, 461, 1, 0, 0, 0, 29, 468, 1, 0, 0, 0, 31, 475, 1, 0, 0, 0, 33, 483, 1, 0, 0, 0, 35, 495, 1, 0, 0, 0, 37, 504, 1, 0, 0, 0, 39, 510, 1, 0, 0, 0, 41, 517, 1, 0, 0, 0, 43, 524, 1, 0, 0, 0, 45, 532, 1, 0, 0, 0, 47, 540, 1, 0, 0, 0, 49, 555, 1, 0, 0, 0, 51, 565, 1, 0, 0, 0, 53, 577, 1, 0, 0, 0, 55, 583, 1, 0, 0, 0, 57, 600, 1, 0, 0, 0, 59, 616, 1, 0, 0, 0, 61, 622, 1, 0, 0, 0, 63, 626, 1, 0, 0, 0, 65, 628, 1, 0, 0, 0, 67, 630, 1, 0, 0, 0, 69, 633, 1, 0, 0, 0, 71, 635, 1, 0, 0, 0, 73, 644, 1, 0, 0, 0, 75, 646, 1, 0, 0, 0, 77, 651, 1, 0, 0, 0, 79, 653, 1, 0, 0, 0, 81, 658, 1, 0, 0, 0, 83, 689, 1, 0, 0, 0, 85, 692, 1, 0, 0, 0, 87, 738, 1, 0, 0, 0, 89, 740, 1, 0, 0, 0, 91, 743, 1, 0, 0, 0, 93, 747, 1, 0, 0, 0, 95, 751, 1, 0, 0, 0, 97, 753, 1, 0, 0, 0, 99, 756, 1, 0, 0, 0, 101, 758, 1, 0, 0, 0, 103, 763, 1, 0, 0, 0, 105, 765, 1, 0, 0, 0, 107, 771, 1, 0, 0, 0, 109, 777, 1, 0, 0, 0, 111, 780, 1, 0, 0, 0, 113, 783, 1, 0, 0, 0, 115, 788, 1, 0, 0, 0, 117, 793, 1, 0, 0, 0, 119, 795, 1, 0, 0, 0, 121, 799, 1, 0, 0, 0, 123, 804, 1, 0, 0, 0, 125, 810, 1, 0, 0, 0, 127, 813, 1, 0, 0, 0, 129, 815, 1, 0, 0, 0, 131, 821, 1, 0, 0, 0, 133, 823, 1, 0, 0, 0, 135, 828, 1, 0, 0, 0, 137, 831, 1, 0, 0, 0, 139, 834, 1, 0, 0, 0, 141, 837, 1, 0, 0, 0, 143, 839, 1, 0, 0, 0, 145, 842, 1, 0, 0, 0, 147, 844, 1, 0, 0, 0, 149, 847, 1, 0, 0, 0, 151, 849, 1, 0, 0, 0, 153, 851, 1, 0, 0, 0, 155, 853, 1, 0, 0, 0, 157, 855, 1, 0, 0, 0, 159, 857, 1, 0, 0, 0, 161, 863, 1, 0, 0, 0, 163, 885, 1, 0, 0, 0, 165, 887, 1, 0, 0, 0, 167, 892, 1, 0, 0, 0, 169, 913, 1, 0, 0, 0, 171, 915, 1, 0, 0, 0, 173, 923, 1, 0, 0, 0, 175, 925, 1, 0, 0, 0, 177, 929, 1, 0, 0, 0, 179, 933, 1, 0, 0, 0, 181, 937, 1, 0, 0, 0, 183, 942, 1, 0, 0, 0, 185, 947, 1, 0, 0, 0, 187, 951, 1, 0, 0, 0, 189, 955, 1, 0, 0, 0, 191, 959, 1, 0, 0, 0, 193, 964, 1, 0, 0, 0, 195, 968, 1, 0, 0, 0, 197, 972, 1, 0, 0, 0, 199, 976, 1, 0, 0, 0, 201, 980, 1, 0, 0, 0, 203, 984, 1, 0, 0, 0, 205, 996, 1, 0, 0, 0, 207, 999, 1, 0, 0, 0, 209, 1003, 1, 0, 0, 0, 211, 1007, 1, 0, 0, 0, 213, 1011, 1, 0, 0, 0, 215, 1015, 1, 0, 0, 0, 217, 1019, 1, 0, 0, 0, 219, 1023, 1, 0, 0, 0, 221, 1028, 1, 0, 0, 0, 223, 1032, 1, 0, 0, 0, 225, 1036, 1, 0, 0, 0, 227, 1040, 1, 0, 0, 0, 229, 1048, 1, 0, 0, 0, 231, 1069, 1, 0, 0, 0, 233, 1073, 1, 0, 0, 0, 235, 1077, 1, 0, 0, 0, 237, 1081, 1, 0, 0, 0, 239, 1085, 1, 0, 0, 0, 241, 1089, 1, 0, 0, 0, 243, 1094, 1, 0, 0, 0, 245, 1098, 1, 0, 0, 0, 247, 1102, 1, 0, 0, 0, 249, 1106, 1, 0, 0, 0, 251, 1110, 1, 0, 0, 0, 253, 1114, 1, 0, 0, 0, 255, 1117, 1, 0, 0, 0, 257, 1121, 1, 0, 0, 0, 259, 1125, 1, 0, 0, 0, 261, 1129, 1, 0, 0, 0, 263, 1133, 1, 0, 0, 0, 265, 1138, 1, 0, 0, 0, 267, 1143, 1, 0, 0, 0, 269, 1148, 1, 0, 0, 0, 271, 1155, 1, 0, 0, 0, 273, 1164, 1, 0, 0, 0, 275, 1171, 1, 0, 0, 0, 277, 1175, 1, 0, 0, 0, 279, 1179, 1, 0, 0, 0, 281, 1183, 1, 0, 0, 0, 283, 1187, 1, 0, 0, 0, 285, 1193, 1, 0, 0, 0, 287, 1197, 1, 0, 0, 0, 289, 1201, 1, 0, 0, 0, 291, 1205, 1, 0, 0, 0, 293, 1209, 1, 0, 0, 0, 295, 1213, 1, 0, 0, 0, 297, 1217, 1, 0, 0, 0, 299, 1221, 1, 0, 0, 0, 301, 1225, 1, 0, 0, 0, 303, 1229, 1, 0, 0, 0, 305, 1233, 1, 0, 0, 0, 307, 1237, 1, 0, 0, 0, 309, 1242, 1, 0, 0, 0, 311, 1246, 1, 0, 0, 0, 313, 1250, 1, 0, 0, 0, 315, 1254, 1, 0, 0, 0, 317, 1258, 1, 0, 0, 0, 319, 1262, 1, 0, 0, 0, 321, 1266, 1, 0, 0, 0, 323, 1270, 1, 0, 0, 0, 325, 1274, 1, 0, 0, 0, 327, 1279, 1, 0, 0, 0, 329, 1284, 1, 0, 0, 0, 331, 1288, 1, 0, 0, 0, 333, 1292, 1, 0, 0, 0, 335, 1296, 1, 0, 0, 0, 337, 1301, 1, 0, 0, 0, 339, 1308, 1, 0, 0, 0, 341, 1312, 1, 0, 0, 0, 343, 1316, 1, 0, 0, 0, 345, 1320, 1, 0, 0, 0, 347, 1324, 1, 0, 0, 0, 349, 1329, 1, 0, 0, 0, 351, 1333, 1, 0, 0, 0, 353, 1337, 1, 0, 0, 0, 355, 1341, 1, 0, 0, 0, 357, 1346, 1, 0, 0, 0, 359, 1350, 1, 0, 0, 0, 361, 1354, 1, 0, 0, 0, 363, 1358, 1, 0, 0, 0, 365, 1362, 1, 0, 0, 0, 367, 1366, 1, 0, 0, 0, 369, 1372, 1, 0, 0, 0, 371, 1376, 1, 0, 0, 0, 373, 1380, 1, 0, 0, 0, 375, 1384, 1, 0, 0, 0, 377, 1388, 1, 0, 0, 0, 379, 1392, 1, 0, 0, 0, 381, 1396, 1, 0, 0, 0, 383, 1401, 1, 0, 0, 0, 385, 1407, 1, 0, 0, 0, 387, 1413, 1, 0, 0, 0, 389, 1417, 1, 0, 0, 0, 391, 1421, 1, 0, 0, 0, 393, 1425, 1, 0, 0, 0, 395, 1431, 1, 0, 0, 0, 397, 1437, 1, 0, 0, 0, 399, 1441, 1, 0, 0, 0, 401, 1445, 1, 0, 0, 0, 403, 1449, 1, 0, 0, 0, 405, 1455, 1, 0, 0, 0, 407, 1461, 1, 0, 0, 0, 409, 1467, 1, 0, 0, 0, 411, 412, 7, 0, 0, 0, 412, 413, 7, 1, 0, 0, 413, 414, 7, 2, 0, 0, 414, 415, 7, 2, 0, 0, 415, 416, 7, 3, 0, 0, 416, 417, 7, 4, 0, 0, 417, 418, 7, 5, 0, 0, 418, 419, 1, 0, 0, 0, 419, 420, 6, 0, 0, 0, 420, 16, 1, 0, 0, 0, 421, 422, 7, 0, 0, 0, 422, 423, 7, 6, 0, 0, 423, 424, 7, 7, 0, 0, 424, 425, 7, 8, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 6, 1, 1, 0, 427, 18, 1, 0, 0, 0, 428, 429, 7, 3, 0, 0, 429, 430, 7, 9, 0, 0, 430, 431, 7, 6, 0, 0, 431, 432, 7, 1, 0, 0, 432, 433, 7, 4, 0, 0, 433, 434, 7, 10, 0, 0, 434, 435, 1, 0, 0, 0, 435, 436, 6, 2, 2, 0, 436, 20, 1, 0, 0, 0, 437, 438, 7, 3, 0, 0, 438, 439, 7, 11, 0, 0, 439, 440, 7, 12, 0, 0, 440, 441, 7, 13, 0, 0, 441, 442, 1, 0, 0, 0, 442, 443, 6, 3, 0, 0, 443, 22, 1, 0, 0, 0, 444, 445, 7, 3, 0, 0, 445, 446, 7, 14, 0, 0, 446, 447, 7, 8, 0, 0, 447, 448, 7, 13, 0, 0, 448, 449, 7, 12, 0, 0, 449, 450, 7, 1, 0, 0, 450, 451, 7, 9, 0, 0, 451, 452, 1, 0, 0, 0, 452, 453, 6, 4, 3, 0, 453, 24, 1, 0, 0, 0, 454, 455, 7, 15, 0, 0, 455, 456, 7, 6, 0, 0, 456, 457, 7, 7, 0, 0, 457, 458, 7, 16, 0, 0, 458, 459, 1, 0, 0, 0, 459, 460, 6, 5, 4, 0, 460, 26, 1, 0, 0, 0, 461, 462, 7, 17, 0, 0, 462, 463, 7, 6, 0, 0, 463, 464, 7, 7, 0, 0, 464, 465, 7, 18, 0, 0, 465, 466, 1, 0, 0, 0, 466, 467, 6, 6, 0, 0, 467, 28, 1, 0, 0, 0, 468, 469, 7, 18, 0, 0, 469, 470, 7, 3, 0, 0, 470, 471, 7, 3, 0, 0, 471, 472, 7, 8, 0, 0, 472, 473, 1, 0, 0, 0, 473, 474, 6, 7, 1, 0, 474, 30, 1, 0, 0, 0, 475, 476, 7, 13, 0, 0, 476, 477, 7, 1, 0, 0, 477, 478, 7, 16, 0, 0, 478, 479, 7, 1, 0, 0, 479, 480, 7, 5, 0, 0, 480, 481, 1, 0, 0, 0, 481, 482, 6, 8, 0, 0, 482, 32, 1, 0, 0, 0, 483, 484, 7, 16, 0, 0, 484, 485, 7, 11, 0, 0, 485, 486, 5, 95, 0, 0, 486, 487, 7, 3, 0, 0, 487, 488, 7, 14, 0, 0, 488, 489, 7, 8, 0, 0, 489, 490, 7, 12, 0, 0, 490, 491, 7, 9, 0, 0, 491, 492, 7, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 494, 6, 9, 5, 0, 494, 34, 1, 0, 0, 0, 495, 496, 7, 6, 0, 0, 496, 497, 7, 3, 0, 0, 497, 498, 7, 9, 0, 0, 498, 499, 7, 12, 0, 0, 499, 500, 7, 16, 0, 0, 500, 501, 7, 3, 0, 0, 501, 502, 1, 0, 0, 0, 502, 503, 6, 10, 6, 0, 503, 36, 1, 0, 0, 0, 504, 505, 7, 6, 0, 0, 505, 506, 7, 7, 0, 0, 506, 507, 7, 19, 0, 0, 507, 508, 1, 0, 0, 0, 508, 509, 6, 11, 0, 0, 509, 38, 1, 0, 0, 0, 510, 511, 7, 2, 0, 0, 511, 512, 7, 10, 0, 0, 512, 513, 7, 7, 0, 0, 513, 514, 7, 19, 0, 0, 514, 515, 1, 0, 0, 0, 515, 516, 6, 12, 7, 0, 516, 40, 1, 0, 0, 0, 517, 518, 7, 2, 0, 0, 518, 519, 7, 7, 0, 0, 519, 520, 7, 6, 0, 0, 520, 521, 7, 5, 0, 0, 521, 522, 1, 0, 0, 0, 522, 523, 6, 13, 0, 0, 523, 42, 1, 0, 0, 0, 524, 525, 7, 2, 0, 0, 525, 526, 7, 5, 0, 0, 526, 527, 7, 12, 0, 0, 527, 528, 7, 5, 0, 0, 528, 529, 7, 2, 0, 0, 529, 530, 1, 0, 0, 0, 530, 531, 6, 14, 0, 0, 531, 44, 1, 0, 0, 0, 532, 533, 7, 19, 0, 0, 533, 534, 7, 10, 0, 0, 534, 535, 7, 3, 0, 0, 535, 536, 7, 6, 0, 0, 536, 537, 7, 3, 0, 0, 537, 538, 1, 0, 0, 0, 538, 539, 6, 15, 0, 0, 539, 46, 1, 0, 0, 0, 540, 541, 4, 16, 0, 0, 541, 542, 7, 1, 0, 0, 542, 543, 7, 9, 0, 0, 543, 544, 7, 13, 0, 0, 544, 545, 7, 1, 0, 0, 545, 546, 7, 9, 0, 0, 546, 547, 7, 3, 0, 0, 547, 548, 7, 2, 0, 0, 548, 549, 7, 5, 0, 0, 549, 550, 7, 12, 0, 0, 550, 551, 7, 5, 0, 0, 551, 552, 7, 2, 0, 0, 552, 553, 1, 0, 0, 0, 553, 554, 6, 16, 0, 0, 554, 48, 1, 0, 0, 0, 555, 556, 4, 17, 1, 0, 556, 557, 7, 13, 0, 0, 557, 558, 7, 7, 0, 0, 558, 559, 7, 7, 0, 0, 559, 560, 7, 18, 0, 0, 560, 561, 7, 20, 0, 0, 561, 562, 7, 8, 0, 0, 562, 563, 1, 0, 0, 0, 563, 564, 6, 17, 8, 0, 564, 50, 1, 0, 0, 0, 565, 566, 4, 18, 2, 0, 566, 567, 7, 16, 0, 0, 567, 568, 7, 3, 0, 0, 568, 569, 7, 5, 0, 0, 569, 570, 7, 6, 0, 0, 570, 571, 7, 1, 0, 0, 571, 572, 7, 4, 0, 0, 572, 573, 7, 2, 0, 0, 573, 574, 1, 0, 0, 0, 574, 575, 6, 18, 9, 0, 575, 52, 1, 0, 0, 0, 576, 578, 8, 21, 0, 0, 577, 576, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 582, 6, 19, 0, 0, 582, 54, 1, 0, 0, 0, 583, 584, 5, 47, 0, 0, 584, 585, 5, 47, 0, 0, 585, 589, 1, 0, 0, 0, 586, 588, 8, 22, 0, 0, 587, 586, 1, 0, 0, 0, 588, 591, 1, 0, 0, 0, 589, 587, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 589, 1, 0, 0, 0, 592, 594, 5, 13, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 5, 10, 0, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 598, 1, 0, 0, 0, 598, 599, 6, 20, 10, 0, 599, 56, 1, 0, 0, 0, 600, 601, 5, 47, 0, 0, 601, 602, 5, 42, 0, 0, 602, 607, 1, 0, 0, 0, 603, 606, 3, 57, 21, 0, 604, 606, 9, 0, 0, 0, 605, 603, 1, 0, 0, 0, 605, 604, 1, 0, 0, 0, 606, 609, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 608, 610, 1, 0, 0, 0, 609, 607, 1, 0, 0, 0, 610, 611, 5, 42, 0, 0, 611, 612, 5, 47, 0, 0, 612, 613, 1, 0, 0, 0, 613, 614, 6, 21, 10, 0, 614, 58, 1, 0, 0, 0, 615, 617, 7, 23, 0, 0, 616, 615, 1, 0, 0, 0, 617, 618, 1, 0, 0, 0, 618, 616, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 620, 1, 0, 0, 0, 620, 621, 6, 22, 10, 0, 621, 60, 1, 0, 0, 0, 622, 623, 5, 124, 0, 0, 623, 624, 1, 0, 0, 0, 624, 625, 6, 23, 11, 0, 625, 62, 1, 0, 0, 0, 626, 627, 7, 24, 0, 0, 627, 64, 1, 0, 0, 0, 628, 629, 7, 25, 0, 0, 629, 66, 1, 0, 0, 0, 630, 631, 5, 92, 0, 0, 631, 632, 7, 26, 0, 0, 632, 68, 1, 0, 0, 0, 633, 634, 8, 27, 0, 0, 634, 70, 1, 0, 0, 0, 635, 637, 7, 3, 0, 0, 636, 638, 7, 28, 0, 0, 637, 636, 1, 0, 0, 0, 637, 638, 1, 0, 0, 0, 638, 640, 1, 0, 0, 0, 639, 641, 3, 63, 24, 0, 640, 639, 1, 0, 0, 0, 641, 642, 1, 0, 0, 0, 642, 640, 1, 0, 0, 0, 642, 643, 1, 0, 0, 0, 643, 72, 1, 0, 0, 0, 644, 645, 5, 64, 0, 0, 645, 74, 1, 0, 0, 0, 646, 647, 5, 96, 0, 0, 647, 76, 1, 0, 0, 0, 648, 652, 8, 29, 0, 0, 649, 650, 5, 96, 0, 0, 650, 652, 5, 96, 0, 0, 651, 648, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 652, 78, 1, 0, 0, 0, 653, 654, 5, 95, 0, 0, 654, 80, 1, 0, 0, 0, 655, 659, 3, 65, 25, 0, 656, 659, 3, 63, 24, 0, 657, 659, 3, 79, 32, 0, 658, 655, 1, 0, 0, 0, 658, 656, 1, 0, 0, 0, 658, 657, 1, 0, 0, 0, 659, 82, 1, 0, 0, 0, 660, 665, 5, 34, 0, 0, 661, 664, 3, 67, 26, 0, 662, 664, 3, 69, 27, 0, 663, 661, 1, 0, 0, 0, 663, 662, 1, 0, 0, 0, 664, 667, 1, 0, 0, 0, 665, 663, 1, 0, 0, 0, 665, 666, 1, 0, 0, 0, 666, 668, 1, 0, 0, 0, 667, 665, 1, 0, 0, 0, 668, 690, 5, 34, 0, 0, 669, 670, 5, 34, 0, 0, 670, 671, 5, 34, 0, 0, 671, 672, 5, 34, 0, 0, 672, 676, 1, 0, 0, 0, 673, 675, 8, 22, 0, 0, 674, 673, 1, 0, 0, 0, 675, 678, 1, 0, 0, 0, 676, 677, 1, 0, 0, 0, 676, 674, 1, 0, 0, 0, 677, 679, 1, 0, 0, 0, 678, 676, 1, 0, 0, 0, 679, 680, 5, 34, 0, 0, 680, 681, 5, 34, 0, 0, 681, 682, 5, 34, 0, 0, 682, 684, 1, 0, 0, 0, 683, 685, 5, 34, 0, 0, 684, 683, 1, 0, 0, 0, 684, 685, 1, 0, 0, 0, 685, 687, 1, 0, 0, 0, 686, 688, 5, 34, 0, 0, 687, 686, 1, 0, 0, 0, 687, 688, 1, 0, 0, 0, 688, 690, 1, 0, 0, 0, 689, 660, 1, 0, 0, 0, 689, 669, 1, 0, 0, 0, 690, 84, 1, 0, 0, 0, 691, 693, 3, 63, 24, 0, 692, 691, 1, 0, 0, 0, 693, 694, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 86, 1, 0, 0, 0, 696, 698, 3, 63, 24, 0, 697, 696, 1, 0, 0, 0, 698, 699, 1, 0, 0, 0, 699, 697, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, 701, 705, 3, 103, 44, 0, 702, 704, 3, 63, 24, 0, 703, 702, 1, 0, 0, 0, 704, 707, 1, 0, 0, 0, 705, 703, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 739, 1, 0, 0, 0, 707, 705, 1, 0, 0, 0, 708, 710, 3, 103, 44, 0, 709, 711, 3, 63, 24, 0, 710, 709, 1, 0, 0, 0, 711, 712, 1, 0, 0, 0, 712, 710, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 739, 1, 0, 0, 0, 714, 716, 3, 63, 24, 0, 715, 714, 1, 0, 0, 0, 716, 717, 1, 0, 0, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 726, 1, 0, 0, 0, 719, 723, 3, 103, 44, 0, 720, 722, 3, 63, 24, 0, 721, 720, 1, 0, 0, 0, 722, 725, 1, 0, 0, 0, 723, 721, 1, 0, 0, 0, 723, 724, 1, 0, 0, 0, 724, 727, 1, 0, 0, 0, 725, 723, 1, 0, 0, 0, 726, 719, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 728, 1, 0, 0, 0, 728, 729, 3, 71, 28, 0, 729, 739, 1, 0, 0, 0, 730, 732, 3, 103, 44, 0, 731, 733, 3, 63, 24, 0, 732, 731, 1, 0, 0, 0, 733, 734, 1, 0, 0, 0, 734, 732, 1, 0, 0, 0, 734, 735, 1, 0, 0, 0, 735, 736, 1, 0, 0, 0, 736, 737, 3, 71, 28, 0, 737, 739, 1, 0, 0, 0, 738, 697, 1, 0, 0, 0, 738, 708, 1, 0, 0, 0, 738, 715, 1, 0, 0, 0, 738, 730, 1, 0, 0, 0, 739, 88, 1, 0, 0, 0, 740, 741, 7, 30, 0, 0, 741, 742, 7, 31, 0, 0, 742, 90, 1, 0, 0, 0, 743, 744, 7, 12, 0, 0, 744, 745, 7, 9, 0, 0, 745, 746, 7, 0, 0, 0, 746, 92, 1, 0, 0, 0, 747, 748, 7, 12, 0, 0, 748, 749, 7, 2, 0, 0, 749, 750, 7, 4, 0, 0, 750, 94, 1, 0, 0, 0, 751, 752, 5, 61, 0, 0, 752, 96, 1, 0, 0, 0, 753, 754, 5, 58, 0, 0, 754, 755, 5, 58, 0, 0, 755, 98, 1, 0, 0, 0, 756, 757, 5, 44, 0, 0, 757, 100, 1, 0, 0, 0, 758, 759, 7, 0, 0, 0, 759, 760, 7, 3, 0, 0, 760, 761, 7, 2, 0, 0, 761, 762, 7, 4, 0, 0, 762, 102, 1, 0, 0, 0, 763, 764, 5, 46, 0, 0, 764, 104, 1, 0, 0, 0, 765, 766, 7, 15, 0, 0, 766, 767, 7, 12, 0, 0, 767, 768, 7, 13, 0, 0, 768, 769, 7, 2, 0, 0, 769, 770, 7, 3, 0, 0, 770, 106, 1, 0, 0, 0, 771, 772, 7, 15, 0, 0, 772, 773, 7, 1, 0, 0, 773, 774, 7, 6, 0, 0, 774, 775, 7, 2, 0, 0, 775, 776, 7, 5, 0, 0, 776, 108, 1, 0, 0, 0, 777, 778, 7, 1, 0, 0, 778, 779, 7, 9, 0, 0, 779, 110, 1, 0, 0, 0, 780, 781, 7, 1, 0, 0, 781, 782, 7, 2, 0, 0, 782, 112, 1, 0, 0, 0, 783, 784, 7, 13, 0, 0, 784, 785, 7, 12, 0, 0, 785, 786, 7, 2, 0, 0, 786, 787, 7, 5, 0, 0, 787, 114, 1, 0, 0, 0, 788, 789, 7, 13, 0, 0, 789, 790, 7, 1, 0, 0, 790, 791, 7, 18, 0, 0, 791, 792, 7, 3, 0, 0, 792, 116, 1, 0, 0, 0, 793, 794, 5, 40, 0, 0, 794, 118, 1, 0, 0, 0, 795, 796, 7, 9, 0, 0, 796, 797, 7, 7, 0, 0, 797, 798, 7, 5, 0, 0, 798, 120, 1, 0, 0, 0, 799, 800, 7, 9, 0, 0, 800, 801, 7, 20, 0, 0, 801, 802, 7, 13, 0, 0, 802, 803, 7, 13, 0, 0, 803, 122, 1, 0, 0, 0, 804, 805, 7, 9, 0, 0, 805, 806, 7, 20, 0, 0, 806, 807, 7, 13, 0, 0, 807, 808, 7, 13, 0, 0, 808, 809, 7, 2, 0, 0, 809, 124, 1, 0, 0, 0, 810, 811, 7, 7, 0, 0, 811, 812, 7, 6, 0, 0, 812, 126, 1, 0, 0, 0, 813, 814, 5, 63, 0, 0, 814, 128, 1, 0, 0, 0, 815, 816, 7, 6, 0, 0, 816, 817, 7, 13, 0, 0, 817, 818, 7, 1, 0, 0, 818, 819, 7, 18, 0, 0, 819, 820, 7, 3, 0, 0, 820, 130, 1, 0, 0, 0, 821, 822, 5, 41, 0, 0, 822, 132, 1, 0, 0, 0, 823, 824, 7, 5, 0, 0, 824, 825, 7, 6, 0, 0, 825, 826, 7, 20, 0, 0, 826, 827, 7, 3, 0, 0, 827, 134, 1, 0, 0, 0, 828, 829, 5, 61, 0, 0, 829, 830, 5, 61, 0, 0, 830, 136, 1, 0, 0, 0, 831, 832, 5, 61, 0, 0, 832, 833, 5, 126, 0, 0, 833, 138, 1, 0, 0, 0, 834, 835, 5, 33, 0, 0, 835, 836, 5, 61, 0, 0, 836, 140, 1, 0, 0, 0, 837, 838, 5, 60, 0, 0, 838, 142, 1, 0, 0, 0, 839, 840, 5, 60, 0, 0, 840, 841, 5, 61, 0, 0, 841, 144, 1, 0, 0, 0, 842, 843, 5, 62, 0, 0, 843, 146, 1, 0, 0, 0, 844, 845, 5, 62, 0, 0, 845, 846, 5, 61, 0, 0, 846, 148, 1, 0, 0, 0, 847, 848, 5, 43, 0, 0, 848, 150, 1, 0, 0, 0, 849, 850, 5, 45, 0, 0, 850, 152, 1, 0, 0, 0, 851, 852, 5, 42, 0, 0, 852, 154, 1, 0, 0, 0, 853, 854, 5, 47, 0, 0, 854, 156, 1, 0, 0, 0, 855, 856, 5, 37, 0, 0, 856, 158, 1, 0, 0, 0, 857, 858, 7, 16, 0, 0, 858, 859, 7, 12, 0, 0, 859, 860, 7, 5, 0, 0, 860, 861, 7, 4, 0, 0, 861, 862, 7, 10, 0, 0, 862, 160, 1, 0, 0, 0, 863, 864, 4, 73, 3, 0, 864, 865, 3, 45, 15, 0, 865, 866, 1, 0, 0, 0, 866, 867, 6, 73, 12, 0, 867, 162, 1, 0, 0, 0, 868, 871, 3, 127, 56, 0, 869, 872, 3, 65, 25, 0, 870, 872, 3, 79, 32, 0, 871, 869, 1, 0, 0, 0, 871, 870, 1, 0, 0, 0, 872, 876, 1, 0, 0, 0, 873, 875, 3, 81, 33, 0, 874, 873, 1, 0, 0, 0, 875, 878, 1, 0, 0, 0, 876, 874, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 886, 1, 0, 0, 0, 878, 876, 1, 0, 0, 0, 879, 881, 3, 127, 56, 0, 880, 882, 3, 63, 24, 0, 881, 880, 1, 0, 0, 0, 882, 883, 1, 0, 0, 0, 883, 881, 1, 0, 0, 0, 883, 884, 1, 0, 0, 0, 884, 886, 1, 0, 0, 0, 885, 868, 1, 0, 0, 0, 885, 879, 1, 0, 0, 0, 886, 164, 1, 0, 0, 0, 887, 888, 5, 91, 0, 0, 888, 889, 1, 0, 0, 0, 889, 890, 6, 75, 0, 0, 890, 891, 6, 75, 0, 0, 891, 166, 1, 0, 0, 0, 892, 893, 5, 93, 0, 0, 893, 894, 1, 0, 0, 0, 894, 895, 6, 76, 11, 0, 895, 896, 6, 76, 11, 0, 896, 168, 1, 0, 0, 0, 897, 901, 3, 65, 25, 0, 898, 900, 3, 81, 33, 0, 899, 898, 1, 0, 0, 0, 900, 903, 1, 0, 0, 0, 901, 899, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 914, 1, 0, 0, 0, 903, 901, 1, 0, 0, 0, 904, 907, 3, 79, 32, 0, 905, 907, 3, 73, 29, 0, 906, 904, 1, 0, 0, 0, 906, 905, 1, 0, 0, 0, 907, 909, 1, 0, 0, 0, 908, 910, 3, 81, 33, 0, 909, 908, 1, 0, 0, 0, 910, 911, 1, 0, 0, 0, 911, 909, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 914, 1, 0, 0, 0, 913, 897, 1, 0, 0, 0, 913, 906, 1, 0, 0, 0, 914, 170, 1, 0, 0, 0, 915, 917, 3, 75, 30, 0, 916, 918, 3, 77, 31, 0, 917, 916, 1, 0, 0, 0, 918, 919, 1, 0, 0, 0, 919, 917, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 921, 1, 0, 0, 0, 921, 922, 3, 75, 30, 0, 922, 172, 1, 0, 0, 0, 923, 924, 3, 171, 78, 0, 924, 174, 1, 0, 0, 0, 925, 926, 3, 55, 20, 0, 926, 927, 1, 0, 0, 0, 927, 928, 6, 80, 10, 0, 928, 176, 1, 0, 0, 0, 929, 930, 3, 57, 21, 0, 930, 931, 1, 0, 0, 0, 931, 932, 6, 81, 10, 0, 932, 178, 1, 0, 0, 0, 933, 934, 3, 59, 22, 0, 934, 935, 1, 0, 0, 0, 935, 936, 6, 82, 10, 0, 936, 180, 1, 0, 0, 0, 937, 938, 3, 165, 75, 0, 938, 939, 1, 0, 0, 0, 939, 940, 6, 83, 13, 0, 940, 941, 6, 83, 14, 0, 941, 182, 1, 0, 0, 0, 942, 943, 3, 61, 23, 0, 943, 944, 1, 0, 0, 0, 944, 945, 6, 84, 15, 0, 945, 946, 6, 84, 11, 0, 946, 184, 1, 0, 0, 0, 947, 948, 3, 59, 22, 0, 948, 949, 1, 0, 0, 0, 949, 950, 6, 85, 10, 0, 950, 186, 1, 0, 0, 0, 951, 952, 3, 55, 20, 0, 952, 953, 1, 0, 0, 0, 953, 954, 6, 86, 10, 0, 954, 188, 1, 0, 0, 0, 955, 956, 3, 57, 21, 0, 956, 957, 1, 0, 0, 0, 957, 958, 6, 87, 10, 0, 958, 190, 1, 0, 0, 0, 959, 960, 3, 61, 23, 0, 960, 961, 1, 0, 0, 0, 961, 962, 6, 88, 15, 0, 962, 963, 6, 88, 11, 0, 963, 192, 1, 0, 0, 0, 964, 965, 3, 165, 75, 0, 965, 966, 1, 0, 0, 0, 966, 967, 6, 89, 13, 0, 967, 194, 1, 0, 0, 0, 968, 969, 3, 167, 76, 0, 969, 970, 1, 0, 0, 0, 970, 971, 6, 90, 16, 0, 971, 196, 1, 0, 0, 0, 972, 973, 3, 337, 161, 0, 973, 974, 1, 0, 0, 0, 974, 975, 6, 91, 17, 0, 975, 198, 1, 0, 0, 0, 976, 977, 3, 99, 42, 0, 977, 978, 1, 0, 0, 0, 978, 979, 6, 92, 18, 0, 979, 200, 1, 0, 0, 0, 980, 981, 3, 95, 40, 0, 981, 982, 1, 0, 0, 0, 982, 983, 6, 93, 19, 0, 983, 202, 1, 0, 0, 0, 984, 985, 7, 16, 0, 0, 985, 986, 7, 3, 0, 0, 986, 987, 7, 5, 0, 0, 987, 988, 7, 12, 0, 0, 988, 989, 7, 0, 0, 0, 989, 990, 7, 12, 0, 0, 990, 991, 7, 5, 0, 0, 991, 992, 7, 12, 0, 0, 992, 204, 1, 0, 0, 0, 993, 997, 8, 32, 0, 0, 994, 995, 5, 47, 0, 0, 995, 997, 8, 33, 0, 0, 996, 993, 1, 0, 0, 0, 996, 994, 1, 0, 0, 0, 997, 206, 1, 0, 0, 0, 998, 1000, 3, 205, 95, 0, 999, 998, 1, 0, 0, 0, 1000, 1001, 1, 0, 0, 0, 1001, 999, 1, 0, 0, 0, 1001, 1002, 1, 0, 0, 0, 1002, 208, 1, 0, 0, 0, 1003, 1004, 3, 207, 96, 0, 1004, 1005, 1, 0, 0, 0, 1005, 1006, 6, 97, 20, 0, 1006, 210, 1, 0, 0, 0, 1007, 1008, 3, 83, 34, 0, 1008, 1009, 1, 0, 0, 0, 1009, 1010, 6, 98, 21, 0, 1010, 212, 1, 0, 0, 0, 1011, 1012, 3, 55, 20, 0, 1012, 1013, 1, 0, 0, 0, 1013, 1014, 6, 99, 10, 0, 1014, 214, 1, 0, 0, 0, 1015, 1016, 3, 57, 21, 0, 1016, 1017, 1, 0, 0, 0, 1017, 1018, 6, 100, 10, 0, 1018, 216, 1, 0, 0, 0, 1019, 1020, 3, 59, 22, 0, 1020, 1021, 1, 0, 0, 0, 1021, 1022, 6, 101, 10, 0, 1022, 218, 1, 0, 0, 0, 1023, 1024, 3, 61, 23, 0, 1024, 1025, 1, 0, 0, 0, 1025, 1026, 6, 102, 15, 0, 1026, 1027, 6, 102, 11, 0, 1027, 220, 1, 0, 0, 0, 1028, 1029, 3, 103, 44, 0, 1029, 1030, 1, 0, 0, 0, 1030, 1031, 6, 103, 22, 0, 1031, 222, 1, 0, 0, 0, 1032, 1033, 3, 99, 42, 0, 1033, 1034, 1, 0, 0, 0, 1034, 1035, 6, 104, 18, 0, 1035, 224, 1, 0, 0, 0, 1036, 1037, 3, 127, 56, 0, 1037, 1038, 1, 0, 0, 0, 1038, 1039, 6, 105, 23, 0, 1039, 226, 1, 0, 0, 0, 1040, 1041, 3, 163, 74, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1043, 6, 106, 24, 0, 1043, 228, 1, 0, 0, 0, 1044, 1049, 3, 65, 25, 0, 1045, 1049, 3, 63, 24, 0, 1046, 1049, 3, 79, 32, 0, 1047, 1049, 3, 153, 69, 0, 1048, 1044, 1, 0, 0, 0, 1048, 1045, 1, 0, 0, 0, 1048, 1046, 1, 0, 0, 0, 1048, 1047, 1, 0, 0, 0, 1049, 230, 1, 0, 0, 0, 1050, 1053, 3, 65, 25, 0, 1051, 1053, 3, 153, 69, 0, 1052, 1050, 1, 0, 0, 0, 1052, 1051, 1, 0, 0, 0, 1053, 1057, 1, 0, 0, 0, 1054, 1056, 3, 229, 107, 0, 1055, 1054, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1070, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1063, 3, 79, 32, 0, 1061, 1063, 3, 73, 29, 0, 1062, 1060, 1, 0, 0, 0, 1062, 1061, 1, 0, 0, 0, 1063, 1065, 1, 0, 0, 0, 1064, 1066, 3, 229, 107, 0, 1065, 1064, 1, 0, 0, 0, 1066, 1067, 1, 0, 0, 0, 1067, 1065, 1, 0, 0, 0, 1067, 1068, 1, 0, 0, 0, 1068, 1070, 1, 0, 0, 0, 1069, 1052, 1, 0, 0, 0, 1069, 1062, 1, 0, 0, 0, 1070, 232, 1, 0, 0, 0, 1071, 1074, 3, 231, 108, 0, 1072, 1074, 3, 171, 78, 0, 1073, 1071, 1, 0, 0, 0, 1073, 1072, 1, 0, 0, 0, 1074, 1075, 1, 0, 0, 0, 1075, 1073, 1, 0, 0, 0, 1075, 1076, 1, 0, 0, 0, 1076, 234, 1, 0, 0, 0, 1077, 1078, 3, 55, 20, 0, 1078, 1079, 1, 0, 0, 0, 1079, 1080, 6, 110, 10, 0, 1080, 236, 1, 0, 0, 0, 1081, 1082, 3, 57, 21, 0, 1082, 1083, 1, 0, 0, 0, 1083, 1084, 6, 111, 10, 0, 1084, 238, 1, 0, 0, 0, 1085, 1086, 3, 59, 22, 0, 1086, 1087, 1, 0, 0, 0, 1087, 1088, 6, 112, 10, 0, 1088, 240, 1, 0, 0, 0, 1089, 1090, 3, 61, 23, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1092, 6, 113, 15, 0, 1092, 1093, 6, 113, 11, 0, 1093, 242, 1, 0, 0, 0, 1094, 1095, 3, 95, 40, 0, 1095, 1096, 1, 0, 0, 0, 1096, 1097, 6, 114, 19, 0, 1097, 244, 1, 0, 0, 0, 1098, 1099, 3, 99, 42, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 6, 115, 18, 0, 1101, 246, 1, 0, 0, 0, 1102, 1103, 3, 103, 44, 0, 1103, 1104, 1, 0, 0, 0, 1104, 1105, 6, 116, 22, 0, 1105, 248, 1, 0, 0, 0, 1106, 1107, 3, 127, 56, 0, 1107, 1108, 1, 0, 0, 0, 1108, 1109, 6, 117, 23, 0, 1109, 250, 1, 0, 0, 0, 1110, 1111, 3, 163, 74, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 6, 118, 24, 0, 1113, 252, 1, 0, 0, 0, 1114, 1115, 7, 12, 0, 0, 1115, 1116, 7, 2, 0, 0, 1116, 254, 1, 0, 0, 0, 1117, 1118, 3, 233, 109, 0, 1118, 1119, 1, 0, 0, 0, 1119, 1120, 6, 120, 25, 0, 1120, 256, 1, 0, 0, 0, 1121, 1122, 3, 55, 20, 0, 1122, 1123, 1, 0, 0, 0, 1123, 1124, 6, 121, 10, 0, 1124, 258, 1, 0, 0, 0, 1125, 1126, 3, 57, 21, 0, 1126, 1127, 1, 0, 0, 0, 1127, 1128, 6, 122, 10, 0, 1128, 260, 1, 0, 0, 0, 1129, 1130, 3, 59, 22, 0, 1130, 1131, 1, 0, 0, 0, 1131, 1132, 6, 123, 10, 0, 1132, 262, 1, 0, 0, 0, 1133, 1134, 3, 61, 23, 0, 1134, 1135, 1, 0, 0, 0, 1135, 1136, 6, 124, 15, 0, 1136, 1137, 6, 124, 11, 0, 1137, 264, 1, 0, 0, 0, 1138, 1139, 3, 165, 75, 0, 1139, 1140, 1, 0, 0, 0, 1140, 1141, 6, 125, 13, 0, 1141, 1142, 6, 125, 26, 0, 1142, 266, 1, 0, 0, 0, 1143, 1144, 7, 7, 0, 0, 1144, 1145, 7, 9, 0, 0, 1145, 1146, 1, 0, 0, 0, 1146, 1147, 6, 126, 27, 0, 1147, 268, 1, 0, 0, 0, 1148, 1149, 7, 19, 0, 0, 1149, 1150, 7, 1, 0, 0, 1150, 1151, 7, 5, 0, 0, 1151, 1152, 7, 10, 0, 0, 1152, 1153, 1, 0, 0, 0, 1153, 1154, 6, 127, 27, 0, 1154, 270, 1, 0, 0, 0, 1155, 1156, 8, 34, 0, 0, 1156, 272, 1, 0, 0, 0, 1157, 1159, 3, 271, 128, 0, 1158, 1157, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 1158, 1, 0, 0, 0, 1160, 1161, 1, 0, 0, 0, 1161, 1162, 1, 0, 0, 0, 1162, 1163, 3, 337, 161, 0, 1163, 1165, 1, 0, 0, 0, 1164, 1158, 1, 0, 0, 0, 1164, 1165, 1, 0, 0, 0, 1165, 1167, 1, 0, 0, 0, 1166, 1168, 3, 271, 128, 0, 1167, 1166, 1, 0, 0, 0, 1168, 1169, 1, 0, 0, 0, 1169, 1167, 1, 0, 0, 0, 1169, 1170, 1, 0, 0, 0, 1170, 274, 1, 0, 0, 0, 1171, 1172, 3, 273, 129, 0, 1172, 1173, 1, 0, 0, 0, 1173, 1174, 6, 130, 28, 0, 1174, 276, 1, 0, 0, 0, 1175, 1176, 3, 55, 20, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1178, 6, 131, 10, 0, 1178, 278, 1, 0, 0, 0, 1179, 1180, 3, 57, 21, 0, 1180, 1181, 1, 0, 0, 0, 1181, 1182, 6, 132, 10, 0, 1182, 280, 1, 0, 0, 0, 1183, 1184, 3, 59, 22, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1186, 6, 133, 10, 0, 1186, 282, 1, 0, 0, 0, 1187, 1188, 3, 61, 23, 0, 1188, 1189, 1, 0, 0, 0, 1189, 1190, 6, 134, 15, 0, 1190, 1191, 6, 134, 11, 0, 1191, 1192, 6, 134, 11, 0, 1192, 284, 1, 0, 0, 0, 1193, 1194, 3, 95, 40, 0, 1194, 1195, 1, 0, 0, 0, 1195, 1196, 6, 135, 19, 0, 1196, 286, 1, 0, 0, 0, 1197, 1198, 3, 99, 42, 0, 1198, 1199, 1, 0, 0, 0, 1199, 1200, 6, 136, 18, 0, 1200, 288, 1, 0, 0, 0, 1201, 1202, 3, 103, 44, 0, 1202, 1203, 1, 0, 0, 0, 1203, 1204, 6, 137, 22, 0, 1204, 290, 1, 0, 0, 0, 1205, 1206, 3, 269, 127, 0, 1206, 1207, 1, 0, 0, 0, 1207, 1208, 6, 138, 29, 0, 1208, 292, 1, 0, 0, 0, 1209, 1210, 3, 233, 109, 0, 1210, 1211, 1, 0, 0, 0, 1211, 1212, 6, 139, 25, 0, 1212, 294, 1, 0, 0, 0, 1213, 1214, 3, 173, 79, 0, 1214, 1215, 1, 0, 0, 0, 1215, 1216, 6, 140, 30, 0, 1216, 296, 1, 0, 0, 0, 1217, 1218, 3, 127, 56, 0, 1218, 1219, 1, 0, 0, 0, 1219, 1220, 6, 141, 23, 0, 1220, 298, 1, 0, 0, 0, 1221, 1222, 3, 163, 74, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 6, 142, 24, 0, 1224, 300, 1, 0, 0, 0, 1225, 1226, 3, 55, 20, 0, 1226, 1227, 1, 0, 0, 0, 1227, 1228, 6, 143, 10, 0, 1228, 302, 1, 0, 0, 0, 1229, 1230, 3, 57, 21, 0, 1230, 1231, 1, 0, 0, 0, 1231, 1232, 6, 144, 10, 0, 1232, 304, 1, 0, 0, 0, 1233, 1234, 3, 59, 22, 0, 1234, 1235, 1, 0, 0, 0, 1235, 1236, 6, 145, 10, 0, 1236, 306, 1, 0, 0, 0, 1237, 1238, 3, 61, 23, 0, 1238, 1239, 1, 0, 0, 0, 1239, 1240, 6, 146, 15, 0, 1240, 1241, 6, 146, 11, 0, 1241, 308, 1, 0, 0, 0, 1242, 1243, 3, 103, 44, 0, 1243, 1244, 1, 0, 0, 0, 1244, 1245, 6, 147, 22, 0, 1245, 310, 1, 0, 0, 0, 1246, 1247, 3, 127, 56, 0, 1247, 1248, 1, 0, 0, 0, 1248, 1249, 6, 148, 23, 0, 1249, 312, 1, 0, 0, 0, 1250, 1251, 3, 163, 74, 0, 1251, 1252, 1, 0, 0, 0, 1252, 1253, 6, 149, 24, 0, 1253, 314, 1, 0, 0, 0, 1254, 1255, 3, 173, 79, 0, 1255, 1256, 1, 0, 0, 0, 1256, 1257, 6, 150, 30, 0, 1257, 316, 1, 0, 0, 0, 1258, 1259, 3, 169, 77, 0, 1259, 1260, 1, 0, 0, 0, 1260, 1261, 6, 151, 31, 0, 1261, 318, 1, 0, 0, 0, 1262, 1263, 3, 55, 20, 0, 1263, 1264, 1, 0, 0, 0, 1264, 1265, 6, 152, 10, 0, 1265, 320, 1, 0, 0, 0, 1266, 1267, 3, 57, 21, 0, 1267, 1268, 1, 0, 0, 0, 1268, 1269, 6, 153, 10, 0, 1269, 322, 1, 0, 0, 0, 1270, 1271, 3, 59, 22, 0, 1271, 1272, 1, 0, 0, 0, 1272, 1273, 6, 154, 10, 0, 1273, 324, 1, 0, 0, 0, 1274, 1275, 3, 61, 23, 0, 1275, 1276, 1, 0, 0, 0, 1276, 1277, 6, 155, 15, 0, 1277, 1278, 6, 155, 11, 0, 1278, 326, 1, 0, 0, 0, 1279, 1280, 7, 1, 0, 0, 1280, 1281, 7, 9, 0, 0, 1281, 1282, 7, 15, 0, 0, 1282, 1283, 7, 7, 0, 0, 1283, 328, 1, 0, 0, 0, 1284, 1285, 3, 55, 20, 0, 1285, 1286, 1, 0, 0, 0, 1286, 1287, 6, 157, 10, 0, 1287, 330, 1, 0, 0, 0, 1288, 1289, 3, 57, 21, 0, 1289, 1290, 1, 0, 0, 0, 1290, 1291, 6, 158, 10, 0, 1291, 332, 1, 0, 0, 0, 1292, 1293, 3, 59, 22, 0, 1293, 1294, 1, 0, 0, 0, 1294, 1295, 6, 159, 10, 0, 1295, 334, 1, 0, 0, 0, 1296, 1297, 3, 167, 76, 0, 1297, 1298, 1, 0, 0, 0, 1298, 1299, 6, 160, 16, 0, 1299, 1300, 6, 160, 11, 0, 1300, 336, 1, 0, 0, 0, 1301, 1302, 5, 58, 0, 0, 1302, 338, 1, 0, 0, 0, 1303, 1309, 3, 73, 29, 0, 1304, 1309, 3, 63, 24, 0, 1305, 1309, 3, 103, 44, 0, 1306, 1309, 3, 65, 25, 0, 1307, 1309, 3, 79, 32, 0, 1308, 1303, 1, 0, 0, 0, 1308, 1304, 1, 0, 0, 0, 1308, 1305, 1, 0, 0, 0, 1308, 1306, 1, 0, 0, 0, 1308, 1307, 1, 0, 0, 0, 1309, 1310, 1, 0, 0, 0, 1310, 1308, 1, 0, 0, 0, 1310, 1311, 1, 0, 0, 0, 1311, 340, 1, 0, 0, 0, 1312, 1313, 3, 55, 20, 0, 1313, 1314, 1, 0, 0, 0, 1314, 1315, 6, 163, 10, 0, 1315, 342, 1, 0, 0, 0, 1316, 1317, 3, 57, 21, 0, 1317, 1318, 1, 0, 0, 0, 1318, 1319, 6, 164, 10, 0, 1319, 344, 1, 0, 0, 0, 1320, 1321, 3, 59, 22, 0, 1321, 1322, 1, 0, 0, 0, 1322, 1323, 6, 165, 10, 0, 1323, 346, 1, 0, 0, 0, 1324, 1325, 3, 61, 23, 0, 1325, 1326, 1, 0, 0, 0, 1326, 1327, 6, 166, 15, 0, 1327, 1328, 6, 166, 11, 0, 1328, 348, 1, 0, 0, 0, 1329, 1330, 3, 337, 161, 0, 1330, 1331, 1, 0, 0, 0, 1331, 1332, 6, 167, 17, 0, 1332, 350, 1, 0, 0, 0, 1333, 1334, 3, 99, 42, 0, 1334, 1335, 1, 0, 0, 0, 1335, 1336, 6, 168, 18, 0, 1336, 352, 1, 0, 0, 0, 1337, 1338, 3, 103, 44, 0, 1338, 1339, 1, 0, 0, 0, 1339, 1340, 6, 169, 22, 0, 1340, 354, 1, 0, 0, 0, 1341, 1342, 3, 267, 126, 0, 1342, 1343, 1, 0, 0, 0, 1343, 1344, 6, 170, 32, 0, 1344, 1345, 6, 170, 33, 0, 1345, 356, 1, 0, 0, 0, 1346, 1347, 3, 207, 96, 0, 1347, 1348, 1, 0, 0, 0, 1348, 1349, 6, 171, 20, 0, 1349, 358, 1, 0, 0, 0, 1350, 1351, 3, 83, 34, 0, 1351, 1352, 1, 0, 0, 0, 1352, 1353, 6, 172, 21, 0, 1353, 360, 1, 0, 0, 0, 1354, 1355, 3, 55, 20, 0, 1355, 1356, 1, 0, 0, 0, 1356, 1357, 6, 173, 10, 0, 1357, 362, 1, 0, 0, 0, 1358, 1359, 3, 57, 21, 0, 1359, 1360, 1, 0, 0, 0, 1360, 1361, 6, 174, 10, 0, 1361, 364, 1, 0, 0, 0, 1362, 1363, 3, 59, 22, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 6, 175, 10, 0, 1365, 366, 1, 0, 0, 0, 1366, 1367, 3, 61, 23, 0, 1367, 1368, 1, 0, 0, 0, 1368, 1369, 6, 176, 15, 0, 1369, 1370, 6, 176, 11, 0, 1370, 1371, 6, 176, 11, 0, 1371, 368, 1, 0, 0, 0, 1372, 1373, 3, 99, 42, 0, 1373, 1374, 1, 0, 0, 0, 1374, 1375, 6, 177, 18, 0, 1375, 370, 1, 0, 0, 0, 1376, 1377, 3, 103, 44, 0, 1377, 1378, 1, 0, 0, 0, 1378, 1379, 6, 178, 22, 0, 1379, 372, 1, 0, 0, 0, 1380, 1381, 3, 233, 109, 0, 1381, 1382, 1, 0, 0, 0, 1382, 1383, 6, 179, 25, 0, 1383, 374, 1, 0, 0, 0, 1384, 1385, 3, 55, 20, 0, 1385, 1386, 1, 0, 0, 0, 1386, 1387, 6, 180, 10, 0, 1387, 376, 1, 0, 0, 0, 1388, 1389, 3, 57, 21, 0, 1389, 1390, 1, 0, 0, 0, 1390, 1391, 6, 181, 10, 0, 1391, 378, 1, 0, 0, 0, 1392, 1393, 3, 59, 22, 0, 1393, 1394, 1, 0, 0, 0, 1394, 1395, 6, 182, 10, 0, 1395, 380, 1, 0, 0, 0, 1396, 1397, 3, 61, 23, 0, 1397, 1398, 1, 0, 0, 0, 1398, 1399, 6, 183, 15, 0, 1399, 1400, 6, 183, 11, 0, 1400, 382, 1, 0, 0, 0, 1401, 1402, 3, 207, 96, 0, 1402, 1403, 1, 0, 0, 0, 1403, 1404, 6, 184, 20, 0, 1404, 1405, 6, 184, 11, 0, 1405, 1406, 6, 184, 34, 0, 1406, 384, 1, 0, 0, 0, 1407, 1408, 3, 83, 34, 0, 1408, 1409, 1, 0, 0, 0, 1409, 1410, 6, 185, 21, 0, 1410, 1411, 6, 185, 11, 0, 1411, 1412, 6, 185, 34, 0, 1412, 386, 1, 0, 0, 0, 1413, 1414, 3, 55, 20, 0, 1414, 1415, 1, 0, 0, 0, 1415, 1416, 6, 186, 10, 0, 1416, 388, 1, 0, 0, 0, 1417, 1418, 3, 57, 21, 0, 1418, 1419, 1, 0, 0, 0, 1419, 1420, 6, 187, 10, 0, 1420, 390, 1, 0, 0, 0, 1421, 1422, 3, 59, 22, 0, 1422, 1423, 1, 0, 0, 0, 1423, 1424, 6, 188, 10, 0, 1424, 392, 1, 0, 0, 0, 1425, 1426, 3, 337, 161, 0, 1426, 1427, 1, 0, 0, 0, 1427, 1428, 6, 189, 17, 0, 1428, 1429, 6, 189, 11, 0, 1429, 1430, 6, 189, 9, 0, 1430, 394, 1, 0, 0, 0, 1431, 1432, 3, 99, 42, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1434, 6, 190, 18, 0, 1434, 1435, 6, 190, 11, 0, 1435, 1436, 6, 190, 9, 0, 1436, 396, 1, 0, 0, 0, 1437, 1438, 3, 55, 20, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1440, 6, 191, 10, 0, 1440, 398, 1, 0, 0, 0, 1441, 1442, 3, 57, 21, 0, 1442, 1443, 1, 0, 0, 0, 1443, 1444, 6, 192, 10, 0, 1444, 400, 1, 0, 0, 0, 1445, 1446, 3, 59, 22, 0, 1446, 1447, 1, 0, 0, 0, 1447, 1448, 6, 193, 10, 0, 1448, 402, 1, 0, 0, 0, 1449, 1450, 3, 173, 79, 0, 1450, 1451, 1, 0, 0, 0, 1451, 1452, 6, 194, 11, 0, 1452, 1453, 6, 194, 0, 0, 1453, 1454, 6, 194, 30, 0, 1454, 404, 1, 0, 0, 0, 1455, 1456, 3, 169, 77, 0, 1456, 1457, 1, 0, 0, 0, 1457, 1458, 6, 195, 11, 0, 1458, 1459, 6, 195, 0, 0, 1459, 1460, 6, 195, 31, 0, 1460, 406, 1, 0, 0, 0, 1461, 1462, 3, 89, 37, 0, 1462, 1463, 1, 0, 0, 0, 1463, 1464, 6, 196, 11, 0, 1464, 1465, 6, 196, 0, 0, 1465, 1466, 6, 196, 35, 0, 1466, 408, 1, 0, 0, 0, 1467, 1468, 3, 61, 23, 0, 1468, 1469, 1, 0, 0, 0, 1469, 1470, 6, 197, 15, 0, 1470, 1471, 6, 197, 11, 0, 1471, 410, 1, 0, 0, 0, 65, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 579, 589, 593, 596, 605, 607, 618, 637, 642, 651, 658, 663, 665, 676, 684, 687, 689, 694, 699, 705, 712, 717, 723, 726, 734, 738, 871, 876, 883, 885, 901, 906, 911, 913, 919, 996, 1001, 1048, 1052, 1057, 1062, 1067, 1069, 1073, 1075, 1160, 1164, 1169, 1308, 1310, 36, 5, 1, 0, 5, 4, 0, 5, 6, 0, 5, 2, 0, 5, 3, 0, 5, 8, 0, 5, 5, 0, 5, 9, 0, 5, 11, 0, 5, 13, 0, 0, 1, 0, 4, 0, 0, 7, 16, 0, 7, 65, 0, 5, 0, 0, 7, 24, 0, 7, 66, 0, 7, 104, 0, 7, 33, 0, 7, 31, 0, 7, 76, 0, 7, 25, 0, 7, 35, 0, 7, 47, 0, 7, 64, 0, 7, 80, 0, 5, 10, 0, 5, 7, 0, 7, 90, 0, 7, 89, 0, 7, 68, 0, 7, 67, 0, 7, 88, 0, 5, 12, 0, 5, 14, 0, 7, 28, 0] \ No newline at end of file +[4, 0, 120, 1471, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, 7, 193, 2, 194, 7, 194, 2, 195, 7, 195, 2, 196, 7, 196, 2, 197, 7, 197, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 4, 19, 578, 8, 19, 11, 19, 12, 19, 579, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 588, 8, 20, 10, 20, 12, 20, 591, 9, 20, 1, 20, 3, 20, 594, 8, 20, 1, 20, 3, 20, 597, 8, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 606, 8, 21, 10, 21, 12, 21, 609, 9, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 4, 22, 617, 8, 22, 11, 22, 12, 22, 618, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 3, 28, 638, 8, 28, 1, 28, 4, 28, 641, 8, 28, 11, 28, 12, 28, 642, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 3, 31, 652, 8, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 3, 33, 659, 8, 33, 1, 34, 1, 34, 1, 34, 5, 34, 664, 8, 34, 10, 34, 12, 34, 667, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 675, 8, 34, 10, 34, 12, 34, 678, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 685, 8, 34, 1, 34, 3, 34, 688, 8, 34, 3, 34, 690, 8, 34, 1, 35, 4, 35, 693, 8, 35, 11, 35, 12, 35, 694, 1, 36, 4, 36, 698, 8, 36, 11, 36, 12, 36, 699, 1, 36, 1, 36, 5, 36, 704, 8, 36, 10, 36, 12, 36, 707, 9, 36, 1, 36, 1, 36, 4, 36, 711, 8, 36, 11, 36, 12, 36, 712, 1, 36, 4, 36, 716, 8, 36, 11, 36, 12, 36, 717, 1, 36, 1, 36, 5, 36, 722, 8, 36, 10, 36, 12, 36, 725, 9, 36, 3, 36, 727, 8, 36, 1, 36, 1, 36, 1, 36, 1, 36, 4, 36, 733, 8, 36, 11, 36, 12, 36, 734, 1, 36, 1, 36, 3, 36, 739, 8, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 3, 74, 871, 8, 74, 1, 74, 5, 74, 874, 8, 74, 10, 74, 12, 74, 877, 9, 74, 1, 74, 1, 74, 4, 74, 881, 8, 74, 11, 74, 12, 74, 882, 3, 74, 885, 8, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 5, 77, 899, 8, 77, 10, 77, 12, 77, 902, 9, 77, 1, 77, 1, 77, 3, 77, 906, 8, 77, 1, 77, 4, 77, 909, 8, 77, 11, 77, 12, 77, 910, 3, 77, 913, 8, 77, 1, 78, 1, 78, 4, 78, 917, 8, 78, 11, 78, 12, 78, 918, 1, 78, 1, 78, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 3, 95, 996, 8, 95, 1, 96, 4, 96, 999, 8, 96, 11, 96, 12, 96, 1000, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 3, 107, 1048, 8, 107, 1, 108, 1, 108, 3, 108, 1052, 8, 108, 1, 108, 5, 108, 1055, 8, 108, 10, 108, 12, 108, 1058, 9, 108, 1, 108, 1, 108, 3, 108, 1062, 8, 108, 1, 108, 4, 108, 1065, 8, 108, 11, 108, 12, 108, 1066, 3, 108, 1069, 8, 108, 1, 109, 1, 109, 4, 109, 1073, 8, 109, 11, 109, 12, 109, 1074, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 129, 4, 129, 1158, 8, 129, 11, 129, 12, 129, 1159, 1, 129, 1, 129, 3, 129, 1164, 8, 129, 1, 129, 4, 129, 1167, 8, 129, 11, 129, 12, 129, 1168, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 149, 1, 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 151, 1, 151, 1, 151, 1, 151, 1, 152, 1, 152, 1, 152, 1, 152, 1, 153, 1, 153, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 158, 1, 159, 1, 159, 1, 159, 1, 159, 1, 160, 1, 160, 1, 160, 1, 160, 1, 160, 1, 161, 1, 161, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 4, 162, 1308, 8, 162, 11, 162, 12, 162, 1309, 1, 163, 1, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, 164, 1, 164, 1, 165, 1, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, 1, 169, 1, 169, 1, 169, 1, 169, 1, 170, 1, 170, 1, 170, 1, 170, 1, 170, 1, 171, 1, 171, 1, 171, 1, 171, 1, 172, 1, 172, 1, 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 175, 1, 175, 1, 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 177, 1, 177, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 180, 1, 180, 1, 181, 1, 181, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 184, 1, 184, 1, 184, 1, 184, 1, 184, 1, 184, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 191, 1, 191, 1, 191, 1, 191, 1, 192, 1, 192, 1, 192, 1, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, 197, 1, 197, 2, 607, 676, 0, 198, 15, 1, 17, 2, 19, 3, 21, 4, 23, 5, 25, 6, 27, 7, 29, 8, 31, 9, 33, 10, 35, 11, 37, 12, 39, 13, 41, 14, 43, 15, 45, 16, 47, 17, 49, 18, 51, 19, 53, 20, 55, 21, 57, 22, 59, 23, 61, 24, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 0, 81, 0, 83, 25, 85, 26, 87, 27, 89, 28, 91, 29, 93, 30, 95, 31, 97, 32, 99, 33, 101, 34, 103, 35, 105, 36, 107, 37, 109, 38, 111, 39, 113, 40, 115, 41, 117, 42, 119, 43, 121, 44, 123, 45, 125, 46, 127, 47, 129, 48, 131, 49, 133, 50, 135, 51, 137, 52, 139, 53, 141, 54, 143, 55, 145, 56, 147, 57, 149, 58, 151, 59, 153, 60, 155, 61, 157, 62, 159, 63, 161, 0, 163, 64, 165, 65, 167, 66, 169, 67, 171, 0, 173, 68, 175, 69, 177, 70, 179, 71, 181, 0, 183, 0, 185, 72, 187, 73, 189, 74, 191, 0, 193, 0, 195, 0, 197, 0, 199, 0, 201, 0, 203, 75, 205, 0, 207, 76, 209, 0, 211, 0, 213, 77, 215, 78, 217, 79, 219, 0, 221, 0, 223, 0, 225, 0, 227, 0, 229, 0, 231, 0, 233, 80, 235, 81, 237, 82, 239, 83, 241, 0, 243, 0, 245, 0, 247, 0, 249, 0, 251, 0, 253, 84, 255, 0, 257, 85, 259, 86, 261, 87, 263, 0, 265, 0, 267, 88, 269, 89, 271, 0, 273, 90, 275, 0, 277, 91, 279, 92, 281, 93, 283, 0, 285, 0, 287, 0, 289, 0, 291, 0, 293, 0, 295, 0, 297, 0, 299, 0, 301, 94, 303, 95, 305, 96, 307, 0, 309, 0, 311, 0, 313, 0, 315, 0, 317, 0, 319, 97, 321, 98, 323, 99, 325, 0, 327, 100, 329, 101, 331, 102, 333, 103, 335, 0, 337, 104, 339, 105, 341, 106, 343, 107, 345, 108, 347, 0, 349, 0, 351, 0, 353, 0, 355, 0, 357, 0, 359, 0, 361, 109, 363, 110, 365, 111, 367, 0, 369, 0, 371, 0, 373, 0, 375, 112, 377, 113, 379, 114, 381, 0, 383, 0, 385, 0, 387, 115, 389, 116, 391, 117, 393, 0, 395, 0, 397, 118, 399, 119, 401, 120, 403, 0, 405, 0, 407, 0, 409, 0, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 35, 2, 0, 68, 68, 100, 100, 2, 0, 73, 73, 105, 105, 2, 0, 83, 83, 115, 115, 2, 0, 69, 69, 101, 101, 2, 0, 67, 67, 99, 99, 2, 0, 84, 84, 116, 116, 2, 0, 82, 82, 114, 114, 2, 0, 79, 79, 111, 111, 2, 0, 80, 80, 112, 112, 2, 0, 78, 78, 110, 110, 2, 0, 72, 72, 104, 104, 2, 0, 86, 86, 118, 118, 2, 0, 65, 65, 97, 97, 2, 0, 76, 76, 108, 108, 2, 0, 88, 88, 120, 120, 2, 0, 70, 70, 102, 102, 2, 0, 77, 77, 109, 109, 2, 0, 71, 71, 103, 103, 2, 0, 75, 75, 107, 107, 2, 0, 87, 87, 119, 119, 2, 0, 85, 85, 117, 117, 6, 0, 9, 10, 13, 13, 32, 32, 47, 47, 91, 91, 93, 93, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 13, 13, 32, 32, 1, 0, 48, 57, 2, 0, 65, 90, 97, 122, 8, 0, 34, 34, 78, 78, 82, 82, 84, 84, 92, 92, 110, 110, 114, 114, 116, 116, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 43, 43, 45, 45, 1, 0, 96, 96, 2, 0, 66, 66, 98, 98, 2, 0, 89, 89, 121, 121, 11, 0, 9, 10, 13, 13, 32, 32, 34, 34, 44, 44, 47, 47, 58, 58, 61, 61, 91, 91, 93, 93, 124, 124, 2, 0, 42, 42, 47, 47, 11, 0, 9, 10, 13, 13, 32, 32, 34, 35, 44, 44, 47, 47, 58, 58, 60, 60, 62, 63, 92, 92, 124, 124, 1499, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 1, 61, 1, 0, 0, 0, 1, 83, 1, 0, 0, 0, 1, 85, 1, 0, 0, 0, 1, 87, 1, 0, 0, 0, 1, 89, 1, 0, 0, 0, 1, 91, 1, 0, 0, 0, 1, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0, 1, 97, 1, 0, 0, 0, 1, 99, 1, 0, 0, 0, 1, 101, 1, 0, 0, 0, 1, 103, 1, 0, 0, 0, 1, 105, 1, 0, 0, 0, 1, 107, 1, 0, 0, 0, 1, 109, 1, 0, 0, 0, 1, 111, 1, 0, 0, 0, 1, 113, 1, 0, 0, 0, 1, 115, 1, 0, 0, 0, 1, 117, 1, 0, 0, 0, 1, 119, 1, 0, 0, 0, 1, 121, 1, 0, 0, 0, 1, 123, 1, 0, 0, 0, 1, 125, 1, 0, 0, 0, 1, 127, 1, 0, 0, 0, 1, 129, 1, 0, 0, 0, 1, 131, 1, 0, 0, 0, 1, 133, 1, 0, 0, 0, 1, 135, 1, 0, 0, 0, 1, 137, 1, 0, 0, 0, 1, 139, 1, 0, 0, 0, 1, 141, 1, 0, 0, 0, 1, 143, 1, 0, 0, 0, 1, 145, 1, 0, 0, 0, 1, 147, 1, 0, 0, 0, 1, 149, 1, 0, 0, 0, 1, 151, 1, 0, 0, 0, 1, 153, 1, 0, 0, 0, 1, 155, 1, 0, 0, 0, 1, 157, 1, 0, 0, 0, 1, 159, 1, 0, 0, 0, 1, 161, 1, 0, 0, 0, 1, 163, 1, 0, 0, 0, 1, 165, 1, 0, 0, 0, 1, 167, 1, 0, 0, 0, 1, 169, 1, 0, 0, 0, 1, 173, 1, 0, 0, 0, 1, 175, 1, 0, 0, 0, 1, 177, 1, 0, 0, 0, 1, 179, 1, 0, 0, 0, 2, 181, 1, 0, 0, 0, 2, 183, 1, 0, 0, 0, 2, 185, 1, 0, 0, 0, 2, 187, 1, 0, 0, 0, 2, 189, 1, 0, 0, 0, 3, 191, 1, 0, 0, 0, 3, 193, 1, 0, 0, 0, 3, 195, 1, 0, 0, 0, 3, 197, 1, 0, 0, 0, 3, 199, 1, 0, 0, 0, 3, 201, 1, 0, 0, 0, 3, 203, 1, 0, 0, 0, 3, 207, 1, 0, 0, 0, 3, 209, 1, 0, 0, 0, 3, 211, 1, 0, 0, 0, 3, 213, 1, 0, 0, 0, 3, 215, 1, 0, 0, 0, 3, 217, 1, 0, 0, 0, 4, 219, 1, 0, 0, 0, 4, 221, 1, 0, 0, 0, 4, 223, 1, 0, 0, 0, 4, 225, 1, 0, 0, 0, 4, 227, 1, 0, 0, 0, 4, 233, 1, 0, 0, 0, 4, 235, 1, 0, 0, 0, 4, 237, 1, 0, 0, 0, 4, 239, 1, 0, 0, 0, 5, 241, 1, 0, 0, 0, 5, 243, 1, 0, 0, 0, 5, 245, 1, 0, 0, 0, 5, 247, 1, 0, 0, 0, 5, 249, 1, 0, 0, 0, 5, 251, 1, 0, 0, 0, 5, 253, 1, 0, 0, 0, 5, 255, 1, 0, 0, 0, 5, 257, 1, 0, 0, 0, 5, 259, 1, 0, 0, 0, 5, 261, 1, 0, 0, 0, 6, 263, 1, 0, 0, 0, 6, 265, 1, 0, 0, 0, 6, 267, 1, 0, 0, 0, 6, 269, 1, 0, 0, 0, 6, 273, 1, 0, 0, 0, 6, 275, 1, 0, 0, 0, 6, 277, 1, 0, 0, 0, 6, 279, 1, 0, 0, 0, 6, 281, 1, 0, 0, 0, 7, 283, 1, 0, 0, 0, 7, 285, 1, 0, 0, 0, 7, 287, 1, 0, 0, 0, 7, 289, 1, 0, 0, 0, 7, 291, 1, 0, 0, 0, 7, 293, 1, 0, 0, 0, 7, 295, 1, 0, 0, 0, 7, 297, 1, 0, 0, 0, 7, 299, 1, 0, 0, 0, 7, 301, 1, 0, 0, 0, 7, 303, 1, 0, 0, 0, 7, 305, 1, 0, 0, 0, 8, 307, 1, 0, 0, 0, 8, 309, 1, 0, 0, 0, 8, 311, 1, 0, 0, 0, 8, 313, 1, 0, 0, 0, 8, 315, 1, 0, 0, 0, 8, 317, 1, 0, 0, 0, 8, 319, 1, 0, 0, 0, 8, 321, 1, 0, 0, 0, 8, 323, 1, 0, 0, 0, 9, 325, 1, 0, 0, 0, 9, 327, 1, 0, 0, 0, 9, 329, 1, 0, 0, 0, 9, 331, 1, 0, 0, 0, 9, 333, 1, 0, 0, 0, 10, 335, 1, 0, 0, 0, 10, 337, 1, 0, 0, 0, 10, 339, 1, 0, 0, 0, 10, 341, 1, 0, 0, 0, 10, 343, 1, 0, 0, 0, 10, 345, 1, 0, 0, 0, 11, 347, 1, 0, 0, 0, 11, 349, 1, 0, 0, 0, 11, 351, 1, 0, 0, 0, 11, 353, 1, 0, 0, 0, 11, 355, 1, 0, 0, 0, 11, 357, 1, 0, 0, 0, 11, 359, 1, 0, 0, 0, 11, 361, 1, 0, 0, 0, 11, 363, 1, 0, 0, 0, 11, 365, 1, 0, 0, 0, 12, 367, 1, 0, 0, 0, 12, 369, 1, 0, 0, 0, 12, 371, 1, 0, 0, 0, 12, 373, 1, 0, 0, 0, 12, 375, 1, 0, 0, 0, 12, 377, 1, 0, 0, 0, 12, 379, 1, 0, 0, 0, 13, 381, 1, 0, 0, 0, 13, 383, 1, 0, 0, 0, 13, 385, 1, 0, 0, 0, 13, 387, 1, 0, 0, 0, 13, 389, 1, 0, 0, 0, 13, 391, 1, 0, 0, 0, 14, 393, 1, 0, 0, 0, 14, 395, 1, 0, 0, 0, 14, 397, 1, 0, 0, 0, 14, 399, 1, 0, 0, 0, 14, 401, 1, 0, 0, 0, 14, 403, 1, 0, 0, 0, 14, 405, 1, 0, 0, 0, 14, 407, 1, 0, 0, 0, 14, 409, 1, 0, 0, 0, 15, 411, 1, 0, 0, 0, 17, 421, 1, 0, 0, 0, 19, 428, 1, 0, 0, 0, 21, 437, 1, 0, 0, 0, 23, 444, 1, 0, 0, 0, 25, 454, 1, 0, 0, 0, 27, 461, 1, 0, 0, 0, 29, 468, 1, 0, 0, 0, 31, 475, 1, 0, 0, 0, 33, 483, 1, 0, 0, 0, 35, 495, 1, 0, 0, 0, 37, 504, 1, 0, 0, 0, 39, 510, 1, 0, 0, 0, 41, 517, 1, 0, 0, 0, 43, 524, 1, 0, 0, 0, 45, 532, 1, 0, 0, 0, 47, 540, 1, 0, 0, 0, 49, 555, 1, 0, 0, 0, 51, 565, 1, 0, 0, 0, 53, 577, 1, 0, 0, 0, 55, 583, 1, 0, 0, 0, 57, 600, 1, 0, 0, 0, 59, 616, 1, 0, 0, 0, 61, 622, 1, 0, 0, 0, 63, 626, 1, 0, 0, 0, 65, 628, 1, 0, 0, 0, 67, 630, 1, 0, 0, 0, 69, 633, 1, 0, 0, 0, 71, 635, 1, 0, 0, 0, 73, 644, 1, 0, 0, 0, 75, 646, 1, 0, 0, 0, 77, 651, 1, 0, 0, 0, 79, 653, 1, 0, 0, 0, 81, 658, 1, 0, 0, 0, 83, 689, 1, 0, 0, 0, 85, 692, 1, 0, 0, 0, 87, 738, 1, 0, 0, 0, 89, 740, 1, 0, 0, 0, 91, 743, 1, 0, 0, 0, 93, 747, 1, 0, 0, 0, 95, 751, 1, 0, 0, 0, 97, 753, 1, 0, 0, 0, 99, 756, 1, 0, 0, 0, 101, 758, 1, 0, 0, 0, 103, 763, 1, 0, 0, 0, 105, 765, 1, 0, 0, 0, 107, 771, 1, 0, 0, 0, 109, 777, 1, 0, 0, 0, 111, 780, 1, 0, 0, 0, 113, 783, 1, 0, 0, 0, 115, 788, 1, 0, 0, 0, 117, 793, 1, 0, 0, 0, 119, 795, 1, 0, 0, 0, 121, 799, 1, 0, 0, 0, 123, 804, 1, 0, 0, 0, 125, 810, 1, 0, 0, 0, 127, 813, 1, 0, 0, 0, 129, 815, 1, 0, 0, 0, 131, 821, 1, 0, 0, 0, 133, 823, 1, 0, 0, 0, 135, 828, 1, 0, 0, 0, 137, 831, 1, 0, 0, 0, 139, 834, 1, 0, 0, 0, 141, 837, 1, 0, 0, 0, 143, 839, 1, 0, 0, 0, 145, 842, 1, 0, 0, 0, 147, 844, 1, 0, 0, 0, 149, 847, 1, 0, 0, 0, 151, 849, 1, 0, 0, 0, 153, 851, 1, 0, 0, 0, 155, 853, 1, 0, 0, 0, 157, 855, 1, 0, 0, 0, 159, 857, 1, 0, 0, 0, 161, 863, 1, 0, 0, 0, 163, 884, 1, 0, 0, 0, 165, 886, 1, 0, 0, 0, 167, 891, 1, 0, 0, 0, 169, 912, 1, 0, 0, 0, 171, 914, 1, 0, 0, 0, 173, 922, 1, 0, 0, 0, 175, 924, 1, 0, 0, 0, 177, 928, 1, 0, 0, 0, 179, 932, 1, 0, 0, 0, 181, 936, 1, 0, 0, 0, 183, 941, 1, 0, 0, 0, 185, 946, 1, 0, 0, 0, 187, 950, 1, 0, 0, 0, 189, 954, 1, 0, 0, 0, 191, 958, 1, 0, 0, 0, 193, 963, 1, 0, 0, 0, 195, 967, 1, 0, 0, 0, 197, 971, 1, 0, 0, 0, 199, 975, 1, 0, 0, 0, 201, 979, 1, 0, 0, 0, 203, 983, 1, 0, 0, 0, 205, 995, 1, 0, 0, 0, 207, 998, 1, 0, 0, 0, 209, 1002, 1, 0, 0, 0, 211, 1006, 1, 0, 0, 0, 213, 1010, 1, 0, 0, 0, 215, 1014, 1, 0, 0, 0, 217, 1018, 1, 0, 0, 0, 219, 1022, 1, 0, 0, 0, 221, 1027, 1, 0, 0, 0, 223, 1031, 1, 0, 0, 0, 225, 1035, 1, 0, 0, 0, 227, 1039, 1, 0, 0, 0, 229, 1047, 1, 0, 0, 0, 231, 1068, 1, 0, 0, 0, 233, 1072, 1, 0, 0, 0, 235, 1076, 1, 0, 0, 0, 237, 1080, 1, 0, 0, 0, 239, 1084, 1, 0, 0, 0, 241, 1088, 1, 0, 0, 0, 243, 1093, 1, 0, 0, 0, 245, 1097, 1, 0, 0, 0, 247, 1101, 1, 0, 0, 0, 249, 1105, 1, 0, 0, 0, 251, 1109, 1, 0, 0, 0, 253, 1113, 1, 0, 0, 0, 255, 1116, 1, 0, 0, 0, 257, 1120, 1, 0, 0, 0, 259, 1124, 1, 0, 0, 0, 261, 1128, 1, 0, 0, 0, 263, 1132, 1, 0, 0, 0, 265, 1137, 1, 0, 0, 0, 267, 1142, 1, 0, 0, 0, 269, 1147, 1, 0, 0, 0, 271, 1154, 1, 0, 0, 0, 273, 1163, 1, 0, 0, 0, 275, 1170, 1, 0, 0, 0, 277, 1174, 1, 0, 0, 0, 279, 1178, 1, 0, 0, 0, 281, 1182, 1, 0, 0, 0, 283, 1186, 1, 0, 0, 0, 285, 1192, 1, 0, 0, 0, 287, 1196, 1, 0, 0, 0, 289, 1200, 1, 0, 0, 0, 291, 1204, 1, 0, 0, 0, 293, 1208, 1, 0, 0, 0, 295, 1212, 1, 0, 0, 0, 297, 1216, 1, 0, 0, 0, 299, 1220, 1, 0, 0, 0, 301, 1224, 1, 0, 0, 0, 303, 1228, 1, 0, 0, 0, 305, 1232, 1, 0, 0, 0, 307, 1236, 1, 0, 0, 0, 309, 1241, 1, 0, 0, 0, 311, 1245, 1, 0, 0, 0, 313, 1249, 1, 0, 0, 0, 315, 1253, 1, 0, 0, 0, 317, 1257, 1, 0, 0, 0, 319, 1261, 1, 0, 0, 0, 321, 1265, 1, 0, 0, 0, 323, 1269, 1, 0, 0, 0, 325, 1273, 1, 0, 0, 0, 327, 1278, 1, 0, 0, 0, 329, 1283, 1, 0, 0, 0, 331, 1287, 1, 0, 0, 0, 333, 1291, 1, 0, 0, 0, 335, 1295, 1, 0, 0, 0, 337, 1300, 1, 0, 0, 0, 339, 1307, 1, 0, 0, 0, 341, 1311, 1, 0, 0, 0, 343, 1315, 1, 0, 0, 0, 345, 1319, 1, 0, 0, 0, 347, 1323, 1, 0, 0, 0, 349, 1328, 1, 0, 0, 0, 351, 1332, 1, 0, 0, 0, 353, 1336, 1, 0, 0, 0, 355, 1340, 1, 0, 0, 0, 357, 1345, 1, 0, 0, 0, 359, 1349, 1, 0, 0, 0, 361, 1353, 1, 0, 0, 0, 363, 1357, 1, 0, 0, 0, 365, 1361, 1, 0, 0, 0, 367, 1365, 1, 0, 0, 0, 369, 1371, 1, 0, 0, 0, 371, 1375, 1, 0, 0, 0, 373, 1379, 1, 0, 0, 0, 375, 1383, 1, 0, 0, 0, 377, 1387, 1, 0, 0, 0, 379, 1391, 1, 0, 0, 0, 381, 1395, 1, 0, 0, 0, 383, 1400, 1, 0, 0, 0, 385, 1406, 1, 0, 0, 0, 387, 1412, 1, 0, 0, 0, 389, 1416, 1, 0, 0, 0, 391, 1420, 1, 0, 0, 0, 393, 1424, 1, 0, 0, 0, 395, 1430, 1, 0, 0, 0, 397, 1436, 1, 0, 0, 0, 399, 1440, 1, 0, 0, 0, 401, 1444, 1, 0, 0, 0, 403, 1448, 1, 0, 0, 0, 405, 1454, 1, 0, 0, 0, 407, 1460, 1, 0, 0, 0, 409, 1466, 1, 0, 0, 0, 411, 412, 7, 0, 0, 0, 412, 413, 7, 1, 0, 0, 413, 414, 7, 2, 0, 0, 414, 415, 7, 2, 0, 0, 415, 416, 7, 3, 0, 0, 416, 417, 7, 4, 0, 0, 417, 418, 7, 5, 0, 0, 418, 419, 1, 0, 0, 0, 419, 420, 6, 0, 0, 0, 420, 16, 1, 0, 0, 0, 421, 422, 7, 0, 0, 0, 422, 423, 7, 6, 0, 0, 423, 424, 7, 7, 0, 0, 424, 425, 7, 8, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 6, 1, 1, 0, 427, 18, 1, 0, 0, 0, 428, 429, 7, 3, 0, 0, 429, 430, 7, 9, 0, 0, 430, 431, 7, 6, 0, 0, 431, 432, 7, 1, 0, 0, 432, 433, 7, 4, 0, 0, 433, 434, 7, 10, 0, 0, 434, 435, 1, 0, 0, 0, 435, 436, 6, 2, 2, 0, 436, 20, 1, 0, 0, 0, 437, 438, 7, 3, 0, 0, 438, 439, 7, 11, 0, 0, 439, 440, 7, 12, 0, 0, 440, 441, 7, 13, 0, 0, 441, 442, 1, 0, 0, 0, 442, 443, 6, 3, 0, 0, 443, 22, 1, 0, 0, 0, 444, 445, 7, 3, 0, 0, 445, 446, 7, 14, 0, 0, 446, 447, 7, 8, 0, 0, 447, 448, 7, 13, 0, 0, 448, 449, 7, 12, 0, 0, 449, 450, 7, 1, 0, 0, 450, 451, 7, 9, 0, 0, 451, 452, 1, 0, 0, 0, 452, 453, 6, 4, 3, 0, 453, 24, 1, 0, 0, 0, 454, 455, 7, 15, 0, 0, 455, 456, 7, 6, 0, 0, 456, 457, 7, 7, 0, 0, 457, 458, 7, 16, 0, 0, 458, 459, 1, 0, 0, 0, 459, 460, 6, 5, 4, 0, 460, 26, 1, 0, 0, 0, 461, 462, 7, 17, 0, 0, 462, 463, 7, 6, 0, 0, 463, 464, 7, 7, 0, 0, 464, 465, 7, 18, 0, 0, 465, 466, 1, 0, 0, 0, 466, 467, 6, 6, 0, 0, 467, 28, 1, 0, 0, 0, 468, 469, 7, 18, 0, 0, 469, 470, 7, 3, 0, 0, 470, 471, 7, 3, 0, 0, 471, 472, 7, 8, 0, 0, 472, 473, 1, 0, 0, 0, 473, 474, 6, 7, 1, 0, 474, 30, 1, 0, 0, 0, 475, 476, 7, 13, 0, 0, 476, 477, 7, 1, 0, 0, 477, 478, 7, 16, 0, 0, 478, 479, 7, 1, 0, 0, 479, 480, 7, 5, 0, 0, 480, 481, 1, 0, 0, 0, 481, 482, 6, 8, 0, 0, 482, 32, 1, 0, 0, 0, 483, 484, 7, 16, 0, 0, 484, 485, 7, 11, 0, 0, 485, 486, 5, 95, 0, 0, 486, 487, 7, 3, 0, 0, 487, 488, 7, 14, 0, 0, 488, 489, 7, 8, 0, 0, 489, 490, 7, 12, 0, 0, 490, 491, 7, 9, 0, 0, 491, 492, 7, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 494, 6, 9, 5, 0, 494, 34, 1, 0, 0, 0, 495, 496, 7, 6, 0, 0, 496, 497, 7, 3, 0, 0, 497, 498, 7, 9, 0, 0, 498, 499, 7, 12, 0, 0, 499, 500, 7, 16, 0, 0, 500, 501, 7, 3, 0, 0, 501, 502, 1, 0, 0, 0, 502, 503, 6, 10, 6, 0, 503, 36, 1, 0, 0, 0, 504, 505, 7, 6, 0, 0, 505, 506, 7, 7, 0, 0, 506, 507, 7, 19, 0, 0, 507, 508, 1, 0, 0, 0, 508, 509, 6, 11, 0, 0, 509, 38, 1, 0, 0, 0, 510, 511, 7, 2, 0, 0, 511, 512, 7, 10, 0, 0, 512, 513, 7, 7, 0, 0, 513, 514, 7, 19, 0, 0, 514, 515, 1, 0, 0, 0, 515, 516, 6, 12, 7, 0, 516, 40, 1, 0, 0, 0, 517, 518, 7, 2, 0, 0, 518, 519, 7, 7, 0, 0, 519, 520, 7, 6, 0, 0, 520, 521, 7, 5, 0, 0, 521, 522, 1, 0, 0, 0, 522, 523, 6, 13, 0, 0, 523, 42, 1, 0, 0, 0, 524, 525, 7, 2, 0, 0, 525, 526, 7, 5, 0, 0, 526, 527, 7, 12, 0, 0, 527, 528, 7, 5, 0, 0, 528, 529, 7, 2, 0, 0, 529, 530, 1, 0, 0, 0, 530, 531, 6, 14, 0, 0, 531, 44, 1, 0, 0, 0, 532, 533, 7, 19, 0, 0, 533, 534, 7, 10, 0, 0, 534, 535, 7, 3, 0, 0, 535, 536, 7, 6, 0, 0, 536, 537, 7, 3, 0, 0, 537, 538, 1, 0, 0, 0, 538, 539, 6, 15, 0, 0, 539, 46, 1, 0, 0, 0, 540, 541, 4, 16, 0, 0, 541, 542, 7, 1, 0, 0, 542, 543, 7, 9, 0, 0, 543, 544, 7, 13, 0, 0, 544, 545, 7, 1, 0, 0, 545, 546, 7, 9, 0, 0, 546, 547, 7, 3, 0, 0, 547, 548, 7, 2, 0, 0, 548, 549, 7, 5, 0, 0, 549, 550, 7, 12, 0, 0, 550, 551, 7, 5, 0, 0, 551, 552, 7, 2, 0, 0, 552, 553, 1, 0, 0, 0, 553, 554, 6, 16, 0, 0, 554, 48, 1, 0, 0, 0, 555, 556, 4, 17, 1, 0, 556, 557, 7, 13, 0, 0, 557, 558, 7, 7, 0, 0, 558, 559, 7, 7, 0, 0, 559, 560, 7, 18, 0, 0, 560, 561, 7, 20, 0, 0, 561, 562, 7, 8, 0, 0, 562, 563, 1, 0, 0, 0, 563, 564, 6, 17, 8, 0, 564, 50, 1, 0, 0, 0, 565, 566, 4, 18, 2, 0, 566, 567, 7, 16, 0, 0, 567, 568, 7, 3, 0, 0, 568, 569, 7, 5, 0, 0, 569, 570, 7, 6, 0, 0, 570, 571, 7, 1, 0, 0, 571, 572, 7, 4, 0, 0, 572, 573, 7, 2, 0, 0, 573, 574, 1, 0, 0, 0, 574, 575, 6, 18, 9, 0, 575, 52, 1, 0, 0, 0, 576, 578, 8, 21, 0, 0, 577, 576, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 582, 6, 19, 0, 0, 582, 54, 1, 0, 0, 0, 583, 584, 5, 47, 0, 0, 584, 585, 5, 47, 0, 0, 585, 589, 1, 0, 0, 0, 586, 588, 8, 22, 0, 0, 587, 586, 1, 0, 0, 0, 588, 591, 1, 0, 0, 0, 589, 587, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 589, 1, 0, 0, 0, 592, 594, 5, 13, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 5, 10, 0, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 598, 1, 0, 0, 0, 598, 599, 6, 20, 10, 0, 599, 56, 1, 0, 0, 0, 600, 601, 5, 47, 0, 0, 601, 602, 5, 42, 0, 0, 602, 607, 1, 0, 0, 0, 603, 606, 3, 57, 21, 0, 604, 606, 9, 0, 0, 0, 605, 603, 1, 0, 0, 0, 605, 604, 1, 0, 0, 0, 606, 609, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 608, 610, 1, 0, 0, 0, 609, 607, 1, 0, 0, 0, 610, 611, 5, 42, 0, 0, 611, 612, 5, 47, 0, 0, 612, 613, 1, 0, 0, 0, 613, 614, 6, 21, 10, 0, 614, 58, 1, 0, 0, 0, 615, 617, 7, 23, 0, 0, 616, 615, 1, 0, 0, 0, 617, 618, 1, 0, 0, 0, 618, 616, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 620, 1, 0, 0, 0, 620, 621, 6, 22, 10, 0, 621, 60, 1, 0, 0, 0, 622, 623, 5, 124, 0, 0, 623, 624, 1, 0, 0, 0, 624, 625, 6, 23, 11, 0, 625, 62, 1, 0, 0, 0, 626, 627, 7, 24, 0, 0, 627, 64, 1, 0, 0, 0, 628, 629, 7, 25, 0, 0, 629, 66, 1, 0, 0, 0, 630, 631, 5, 92, 0, 0, 631, 632, 7, 26, 0, 0, 632, 68, 1, 0, 0, 0, 633, 634, 8, 27, 0, 0, 634, 70, 1, 0, 0, 0, 635, 637, 7, 3, 0, 0, 636, 638, 7, 28, 0, 0, 637, 636, 1, 0, 0, 0, 637, 638, 1, 0, 0, 0, 638, 640, 1, 0, 0, 0, 639, 641, 3, 63, 24, 0, 640, 639, 1, 0, 0, 0, 641, 642, 1, 0, 0, 0, 642, 640, 1, 0, 0, 0, 642, 643, 1, 0, 0, 0, 643, 72, 1, 0, 0, 0, 644, 645, 5, 64, 0, 0, 645, 74, 1, 0, 0, 0, 646, 647, 5, 96, 0, 0, 647, 76, 1, 0, 0, 0, 648, 652, 8, 29, 0, 0, 649, 650, 5, 96, 0, 0, 650, 652, 5, 96, 0, 0, 651, 648, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 652, 78, 1, 0, 0, 0, 653, 654, 5, 95, 0, 0, 654, 80, 1, 0, 0, 0, 655, 659, 3, 65, 25, 0, 656, 659, 3, 63, 24, 0, 657, 659, 3, 79, 32, 0, 658, 655, 1, 0, 0, 0, 658, 656, 1, 0, 0, 0, 658, 657, 1, 0, 0, 0, 659, 82, 1, 0, 0, 0, 660, 665, 5, 34, 0, 0, 661, 664, 3, 67, 26, 0, 662, 664, 3, 69, 27, 0, 663, 661, 1, 0, 0, 0, 663, 662, 1, 0, 0, 0, 664, 667, 1, 0, 0, 0, 665, 663, 1, 0, 0, 0, 665, 666, 1, 0, 0, 0, 666, 668, 1, 0, 0, 0, 667, 665, 1, 0, 0, 0, 668, 690, 5, 34, 0, 0, 669, 670, 5, 34, 0, 0, 670, 671, 5, 34, 0, 0, 671, 672, 5, 34, 0, 0, 672, 676, 1, 0, 0, 0, 673, 675, 8, 22, 0, 0, 674, 673, 1, 0, 0, 0, 675, 678, 1, 0, 0, 0, 676, 677, 1, 0, 0, 0, 676, 674, 1, 0, 0, 0, 677, 679, 1, 0, 0, 0, 678, 676, 1, 0, 0, 0, 679, 680, 5, 34, 0, 0, 680, 681, 5, 34, 0, 0, 681, 682, 5, 34, 0, 0, 682, 684, 1, 0, 0, 0, 683, 685, 5, 34, 0, 0, 684, 683, 1, 0, 0, 0, 684, 685, 1, 0, 0, 0, 685, 687, 1, 0, 0, 0, 686, 688, 5, 34, 0, 0, 687, 686, 1, 0, 0, 0, 687, 688, 1, 0, 0, 0, 688, 690, 1, 0, 0, 0, 689, 660, 1, 0, 0, 0, 689, 669, 1, 0, 0, 0, 690, 84, 1, 0, 0, 0, 691, 693, 3, 63, 24, 0, 692, 691, 1, 0, 0, 0, 693, 694, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 86, 1, 0, 0, 0, 696, 698, 3, 63, 24, 0, 697, 696, 1, 0, 0, 0, 698, 699, 1, 0, 0, 0, 699, 697, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, 701, 705, 3, 103, 44, 0, 702, 704, 3, 63, 24, 0, 703, 702, 1, 0, 0, 0, 704, 707, 1, 0, 0, 0, 705, 703, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 739, 1, 0, 0, 0, 707, 705, 1, 0, 0, 0, 708, 710, 3, 103, 44, 0, 709, 711, 3, 63, 24, 0, 710, 709, 1, 0, 0, 0, 711, 712, 1, 0, 0, 0, 712, 710, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 739, 1, 0, 0, 0, 714, 716, 3, 63, 24, 0, 715, 714, 1, 0, 0, 0, 716, 717, 1, 0, 0, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 726, 1, 0, 0, 0, 719, 723, 3, 103, 44, 0, 720, 722, 3, 63, 24, 0, 721, 720, 1, 0, 0, 0, 722, 725, 1, 0, 0, 0, 723, 721, 1, 0, 0, 0, 723, 724, 1, 0, 0, 0, 724, 727, 1, 0, 0, 0, 725, 723, 1, 0, 0, 0, 726, 719, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 728, 1, 0, 0, 0, 728, 729, 3, 71, 28, 0, 729, 739, 1, 0, 0, 0, 730, 732, 3, 103, 44, 0, 731, 733, 3, 63, 24, 0, 732, 731, 1, 0, 0, 0, 733, 734, 1, 0, 0, 0, 734, 732, 1, 0, 0, 0, 734, 735, 1, 0, 0, 0, 735, 736, 1, 0, 0, 0, 736, 737, 3, 71, 28, 0, 737, 739, 1, 0, 0, 0, 738, 697, 1, 0, 0, 0, 738, 708, 1, 0, 0, 0, 738, 715, 1, 0, 0, 0, 738, 730, 1, 0, 0, 0, 739, 88, 1, 0, 0, 0, 740, 741, 7, 30, 0, 0, 741, 742, 7, 31, 0, 0, 742, 90, 1, 0, 0, 0, 743, 744, 7, 12, 0, 0, 744, 745, 7, 9, 0, 0, 745, 746, 7, 0, 0, 0, 746, 92, 1, 0, 0, 0, 747, 748, 7, 12, 0, 0, 748, 749, 7, 2, 0, 0, 749, 750, 7, 4, 0, 0, 750, 94, 1, 0, 0, 0, 751, 752, 5, 61, 0, 0, 752, 96, 1, 0, 0, 0, 753, 754, 5, 58, 0, 0, 754, 755, 5, 58, 0, 0, 755, 98, 1, 0, 0, 0, 756, 757, 5, 44, 0, 0, 757, 100, 1, 0, 0, 0, 758, 759, 7, 0, 0, 0, 759, 760, 7, 3, 0, 0, 760, 761, 7, 2, 0, 0, 761, 762, 7, 4, 0, 0, 762, 102, 1, 0, 0, 0, 763, 764, 5, 46, 0, 0, 764, 104, 1, 0, 0, 0, 765, 766, 7, 15, 0, 0, 766, 767, 7, 12, 0, 0, 767, 768, 7, 13, 0, 0, 768, 769, 7, 2, 0, 0, 769, 770, 7, 3, 0, 0, 770, 106, 1, 0, 0, 0, 771, 772, 7, 15, 0, 0, 772, 773, 7, 1, 0, 0, 773, 774, 7, 6, 0, 0, 774, 775, 7, 2, 0, 0, 775, 776, 7, 5, 0, 0, 776, 108, 1, 0, 0, 0, 777, 778, 7, 1, 0, 0, 778, 779, 7, 9, 0, 0, 779, 110, 1, 0, 0, 0, 780, 781, 7, 1, 0, 0, 781, 782, 7, 2, 0, 0, 782, 112, 1, 0, 0, 0, 783, 784, 7, 13, 0, 0, 784, 785, 7, 12, 0, 0, 785, 786, 7, 2, 0, 0, 786, 787, 7, 5, 0, 0, 787, 114, 1, 0, 0, 0, 788, 789, 7, 13, 0, 0, 789, 790, 7, 1, 0, 0, 790, 791, 7, 18, 0, 0, 791, 792, 7, 3, 0, 0, 792, 116, 1, 0, 0, 0, 793, 794, 5, 40, 0, 0, 794, 118, 1, 0, 0, 0, 795, 796, 7, 9, 0, 0, 796, 797, 7, 7, 0, 0, 797, 798, 7, 5, 0, 0, 798, 120, 1, 0, 0, 0, 799, 800, 7, 9, 0, 0, 800, 801, 7, 20, 0, 0, 801, 802, 7, 13, 0, 0, 802, 803, 7, 13, 0, 0, 803, 122, 1, 0, 0, 0, 804, 805, 7, 9, 0, 0, 805, 806, 7, 20, 0, 0, 806, 807, 7, 13, 0, 0, 807, 808, 7, 13, 0, 0, 808, 809, 7, 2, 0, 0, 809, 124, 1, 0, 0, 0, 810, 811, 7, 7, 0, 0, 811, 812, 7, 6, 0, 0, 812, 126, 1, 0, 0, 0, 813, 814, 5, 63, 0, 0, 814, 128, 1, 0, 0, 0, 815, 816, 7, 6, 0, 0, 816, 817, 7, 13, 0, 0, 817, 818, 7, 1, 0, 0, 818, 819, 7, 18, 0, 0, 819, 820, 7, 3, 0, 0, 820, 130, 1, 0, 0, 0, 821, 822, 5, 41, 0, 0, 822, 132, 1, 0, 0, 0, 823, 824, 7, 5, 0, 0, 824, 825, 7, 6, 0, 0, 825, 826, 7, 20, 0, 0, 826, 827, 7, 3, 0, 0, 827, 134, 1, 0, 0, 0, 828, 829, 5, 61, 0, 0, 829, 830, 5, 61, 0, 0, 830, 136, 1, 0, 0, 0, 831, 832, 5, 61, 0, 0, 832, 833, 5, 126, 0, 0, 833, 138, 1, 0, 0, 0, 834, 835, 5, 33, 0, 0, 835, 836, 5, 61, 0, 0, 836, 140, 1, 0, 0, 0, 837, 838, 5, 60, 0, 0, 838, 142, 1, 0, 0, 0, 839, 840, 5, 60, 0, 0, 840, 841, 5, 61, 0, 0, 841, 144, 1, 0, 0, 0, 842, 843, 5, 62, 0, 0, 843, 146, 1, 0, 0, 0, 844, 845, 5, 62, 0, 0, 845, 846, 5, 61, 0, 0, 846, 148, 1, 0, 0, 0, 847, 848, 5, 43, 0, 0, 848, 150, 1, 0, 0, 0, 849, 850, 5, 45, 0, 0, 850, 152, 1, 0, 0, 0, 851, 852, 5, 42, 0, 0, 852, 154, 1, 0, 0, 0, 853, 854, 5, 47, 0, 0, 854, 156, 1, 0, 0, 0, 855, 856, 5, 37, 0, 0, 856, 158, 1, 0, 0, 0, 857, 858, 7, 16, 0, 0, 858, 859, 7, 12, 0, 0, 859, 860, 7, 5, 0, 0, 860, 861, 7, 4, 0, 0, 861, 862, 7, 10, 0, 0, 862, 160, 1, 0, 0, 0, 863, 864, 3, 45, 15, 0, 864, 865, 1, 0, 0, 0, 865, 866, 6, 73, 12, 0, 866, 162, 1, 0, 0, 0, 867, 870, 3, 127, 56, 0, 868, 871, 3, 65, 25, 0, 869, 871, 3, 79, 32, 0, 870, 868, 1, 0, 0, 0, 870, 869, 1, 0, 0, 0, 871, 875, 1, 0, 0, 0, 872, 874, 3, 81, 33, 0, 873, 872, 1, 0, 0, 0, 874, 877, 1, 0, 0, 0, 875, 873, 1, 0, 0, 0, 875, 876, 1, 0, 0, 0, 876, 885, 1, 0, 0, 0, 877, 875, 1, 0, 0, 0, 878, 880, 3, 127, 56, 0, 879, 881, 3, 63, 24, 0, 880, 879, 1, 0, 0, 0, 881, 882, 1, 0, 0, 0, 882, 880, 1, 0, 0, 0, 882, 883, 1, 0, 0, 0, 883, 885, 1, 0, 0, 0, 884, 867, 1, 0, 0, 0, 884, 878, 1, 0, 0, 0, 885, 164, 1, 0, 0, 0, 886, 887, 5, 91, 0, 0, 887, 888, 1, 0, 0, 0, 888, 889, 6, 75, 0, 0, 889, 890, 6, 75, 0, 0, 890, 166, 1, 0, 0, 0, 891, 892, 5, 93, 0, 0, 892, 893, 1, 0, 0, 0, 893, 894, 6, 76, 11, 0, 894, 895, 6, 76, 11, 0, 895, 168, 1, 0, 0, 0, 896, 900, 3, 65, 25, 0, 897, 899, 3, 81, 33, 0, 898, 897, 1, 0, 0, 0, 899, 902, 1, 0, 0, 0, 900, 898, 1, 0, 0, 0, 900, 901, 1, 0, 0, 0, 901, 913, 1, 0, 0, 0, 902, 900, 1, 0, 0, 0, 903, 906, 3, 79, 32, 0, 904, 906, 3, 73, 29, 0, 905, 903, 1, 0, 0, 0, 905, 904, 1, 0, 0, 0, 906, 908, 1, 0, 0, 0, 907, 909, 3, 81, 33, 0, 908, 907, 1, 0, 0, 0, 909, 910, 1, 0, 0, 0, 910, 908, 1, 0, 0, 0, 910, 911, 1, 0, 0, 0, 911, 913, 1, 0, 0, 0, 912, 896, 1, 0, 0, 0, 912, 905, 1, 0, 0, 0, 913, 170, 1, 0, 0, 0, 914, 916, 3, 75, 30, 0, 915, 917, 3, 77, 31, 0, 916, 915, 1, 0, 0, 0, 917, 918, 1, 0, 0, 0, 918, 916, 1, 0, 0, 0, 918, 919, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 921, 3, 75, 30, 0, 921, 172, 1, 0, 0, 0, 922, 923, 3, 171, 78, 0, 923, 174, 1, 0, 0, 0, 924, 925, 3, 55, 20, 0, 925, 926, 1, 0, 0, 0, 926, 927, 6, 80, 10, 0, 927, 176, 1, 0, 0, 0, 928, 929, 3, 57, 21, 0, 929, 930, 1, 0, 0, 0, 930, 931, 6, 81, 10, 0, 931, 178, 1, 0, 0, 0, 932, 933, 3, 59, 22, 0, 933, 934, 1, 0, 0, 0, 934, 935, 6, 82, 10, 0, 935, 180, 1, 0, 0, 0, 936, 937, 3, 165, 75, 0, 937, 938, 1, 0, 0, 0, 938, 939, 6, 83, 13, 0, 939, 940, 6, 83, 14, 0, 940, 182, 1, 0, 0, 0, 941, 942, 3, 61, 23, 0, 942, 943, 1, 0, 0, 0, 943, 944, 6, 84, 15, 0, 944, 945, 6, 84, 11, 0, 945, 184, 1, 0, 0, 0, 946, 947, 3, 59, 22, 0, 947, 948, 1, 0, 0, 0, 948, 949, 6, 85, 10, 0, 949, 186, 1, 0, 0, 0, 950, 951, 3, 55, 20, 0, 951, 952, 1, 0, 0, 0, 952, 953, 6, 86, 10, 0, 953, 188, 1, 0, 0, 0, 954, 955, 3, 57, 21, 0, 955, 956, 1, 0, 0, 0, 956, 957, 6, 87, 10, 0, 957, 190, 1, 0, 0, 0, 958, 959, 3, 61, 23, 0, 959, 960, 1, 0, 0, 0, 960, 961, 6, 88, 15, 0, 961, 962, 6, 88, 11, 0, 962, 192, 1, 0, 0, 0, 963, 964, 3, 165, 75, 0, 964, 965, 1, 0, 0, 0, 965, 966, 6, 89, 13, 0, 966, 194, 1, 0, 0, 0, 967, 968, 3, 167, 76, 0, 968, 969, 1, 0, 0, 0, 969, 970, 6, 90, 16, 0, 970, 196, 1, 0, 0, 0, 971, 972, 3, 337, 161, 0, 972, 973, 1, 0, 0, 0, 973, 974, 6, 91, 17, 0, 974, 198, 1, 0, 0, 0, 975, 976, 3, 99, 42, 0, 976, 977, 1, 0, 0, 0, 977, 978, 6, 92, 18, 0, 978, 200, 1, 0, 0, 0, 979, 980, 3, 95, 40, 0, 980, 981, 1, 0, 0, 0, 981, 982, 6, 93, 19, 0, 982, 202, 1, 0, 0, 0, 983, 984, 7, 16, 0, 0, 984, 985, 7, 3, 0, 0, 985, 986, 7, 5, 0, 0, 986, 987, 7, 12, 0, 0, 987, 988, 7, 0, 0, 0, 988, 989, 7, 12, 0, 0, 989, 990, 7, 5, 0, 0, 990, 991, 7, 12, 0, 0, 991, 204, 1, 0, 0, 0, 992, 996, 8, 32, 0, 0, 993, 994, 5, 47, 0, 0, 994, 996, 8, 33, 0, 0, 995, 992, 1, 0, 0, 0, 995, 993, 1, 0, 0, 0, 996, 206, 1, 0, 0, 0, 997, 999, 3, 205, 95, 0, 998, 997, 1, 0, 0, 0, 999, 1000, 1, 0, 0, 0, 1000, 998, 1, 0, 0, 0, 1000, 1001, 1, 0, 0, 0, 1001, 208, 1, 0, 0, 0, 1002, 1003, 3, 207, 96, 0, 1003, 1004, 1, 0, 0, 0, 1004, 1005, 6, 97, 20, 0, 1005, 210, 1, 0, 0, 0, 1006, 1007, 3, 83, 34, 0, 1007, 1008, 1, 0, 0, 0, 1008, 1009, 6, 98, 21, 0, 1009, 212, 1, 0, 0, 0, 1010, 1011, 3, 55, 20, 0, 1011, 1012, 1, 0, 0, 0, 1012, 1013, 6, 99, 10, 0, 1013, 214, 1, 0, 0, 0, 1014, 1015, 3, 57, 21, 0, 1015, 1016, 1, 0, 0, 0, 1016, 1017, 6, 100, 10, 0, 1017, 216, 1, 0, 0, 0, 1018, 1019, 3, 59, 22, 0, 1019, 1020, 1, 0, 0, 0, 1020, 1021, 6, 101, 10, 0, 1021, 218, 1, 0, 0, 0, 1022, 1023, 3, 61, 23, 0, 1023, 1024, 1, 0, 0, 0, 1024, 1025, 6, 102, 15, 0, 1025, 1026, 6, 102, 11, 0, 1026, 220, 1, 0, 0, 0, 1027, 1028, 3, 103, 44, 0, 1028, 1029, 1, 0, 0, 0, 1029, 1030, 6, 103, 22, 0, 1030, 222, 1, 0, 0, 0, 1031, 1032, 3, 99, 42, 0, 1032, 1033, 1, 0, 0, 0, 1033, 1034, 6, 104, 18, 0, 1034, 224, 1, 0, 0, 0, 1035, 1036, 3, 127, 56, 0, 1036, 1037, 1, 0, 0, 0, 1037, 1038, 6, 105, 23, 0, 1038, 226, 1, 0, 0, 0, 1039, 1040, 3, 163, 74, 0, 1040, 1041, 1, 0, 0, 0, 1041, 1042, 6, 106, 24, 0, 1042, 228, 1, 0, 0, 0, 1043, 1048, 3, 65, 25, 0, 1044, 1048, 3, 63, 24, 0, 1045, 1048, 3, 79, 32, 0, 1046, 1048, 3, 153, 69, 0, 1047, 1043, 1, 0, 0, 0, 1047, 1044, 1, 0, 0, 0, 1047, 1045, 1, 0, 0, 0, 1047, 1046, 1, 0, 0, 0, 1048, 230, 1, 0, 0, 0, 1049, 1052, 3, 65, 25, 0, 1050, 1052, 3, 153, 69, 0, 1051, 1049, 1, 0, 0, 0, 1051, 1050, 1, 0, 0, 0, 1052, 1056, 1, 0, 0, 0, 1053, 1055, 3, 229, 107, 0, 1054, 1053, 1, 0, 0, 0, 1055, 1058, 1, 0, 0, 0, 1056, 1054, 1, 0, 0, 0, 1056, 1057, 1, 0, 0, 0, 1057, 1069, 1, 0, 0, 0, 1058, 1056, 1, 0, 0, 0, 1059, 1062, 3, 79, 32, 0, 1060, 1062, 3, 73, 29, 0, 1061, 1059, 1, 0, 0, 0, 1061, 1060, 1, 0, 0, 0, 1062, 1064, 1, 0, 0, 0, 1063, 1065, 3, 229, 107, 0, 1064, 1063, 1, 0, 0, 0, 1065, 1066, 1, 0, 0, 0, 1066, 1064, 1, 0, 0, 0, 1066, 1067, 1, 0, 0, 0, 1067, 1069, 1, 0, 0, 0, 1068, 1051, 1, 0, 0, 0, 1068, 1061, 1, 0, 0, 0, 1069, 232, 1, 0, 0, 0, 1070, 1073, 3, 231, 108, 0, 1071, 1073, 3, 171, 78, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1071, 1, 0, 0, 0, 1073, 1074, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1074, 1075, 1, 0, 0, 0, 1075, 234, 1, 0, 0, 0, 1076, 1077, 3, 55, 20, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 6, 110, 10, 0, 1079, 236, 1, 0, 0, 0, 1080, 1081, 3, 57, 21, 0, 1081, 1082, 1, 0, 0, 0, 1082, 1083, 6, 111, 10, 0, 1083, 238, 1, 0, 0, 0, 1084, 1085, 3, 59, 22, 0, 1085, 1086, 1, 0, 0, 0, 1086, 1087, 6, 112, 10, 0, 1087, 240, 1, 0, 0, 0, 1088, 1089, 3, 61, 23, 0, 1089, 1090, 1, 0, 0, 0, 1090, 1091, 6, 113, 15, 0, 1091, 1092, 6, 113, 11, 0, 1092, 242, 1, 0, 0, 0, 1093, 1094, 3, 95, 40, 0, 1094, 1095, 1, 0, 0, 0, 1095, 1096, 6, 114, 19, 0, 1096, 244, 1, 0, 0, 0, 1097, 1098, 3, 99, 42, 0, 1098, 1099, 1, 0, 0, 0, 1099, 1100, 6, 115, 18, 0, 1100, 246, 1, 0, 0, 0, 1101, 1102, 3, 103, 44, 0, 1102, 1103, 1, 0, 0, 0, 1103, 1104, 6, 116, 22, 0, 1104, 248, 1, 0, 0, 0, 1105, 1106, 3, 127, 56, 0, 1106, 1107, 1, 0, 0, 0, 1107, 1108, 6, 117, 23, 0, 1108, 250, 1, 0, 0, 0, 1109, 1110, 3, 163, 74, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 6, 118, 24, 0, 1112, 252, 1, 0, 0, 0, 1113, 1114, 7, 12, 0, 0, 1114, 1115, 7, 2, 0, 0, 1115, 254, 1, 0, 0, 0, 1116, 1117, 3, 233, 109, 0, 1117, 1118, 1, 0, 0, 0, 1118, 1119, 6, 120, 25, 0, 1119, 256, 1, 0, 0, 0, 1120, 1121, 3, 55, 20, 0, 1121, 1122, 1, 0, 0, 0, 1122, 1123, 6, 121, 10, 0, 1123, 258, 1, 0, 0, 0, 1124, 1125, 3, 57, 21, 0, 1125, 1126, 1, 0, 0, 0, 1126, 1127, 6, 122, 10, 0, 1127, 260, 1, 0, 0, 0, 1128, 1129, 3, 59, 22, 0, 1129, 1130, 1, 0, 0, 0, 1130, 1131, 6, 123, 10, 0, 1131, 262, 1, 0, 0, 0, 1132, 1133, 3, 61, 23, 0, 1133, 1134, 1, 0, 0, 0, 1134, 1135, 6, 124, 15, 0, 1135, 1136, 6, 124, 11, 0, 1136, 264, 1, 0, 0, 0, 1137, 1138, 3, 165, 75, 0, 1138, 1139, 1, 0, 0, 0, 1139, 1140, 6, 125, 13, 0, 1140, 1141, 6, 125, 26, 0, 1141, 266, 1, 0, 0, 0, 1142, 1143, 7, 7, 0, 0, 1143, 1144, 7, 9, 0, 0, 1144, 1145, 1, 0, 0, 0, 1145, 1146, 6, 126, 27, 0, 1146, 268, 1, 0, 0, 0, 1147, 1148, 7, 19, 0, 0, 1148, 1149, 7, 1, 0, 0, 1149, 1150, 7, 5, 0, 0, 1150, 1151, 7, 10, 0, 0, 1151, 1152, 1, 0, 0, 0, 1152, 1153, 6, 127, 27, 0, 1153, 270, 1, 0, 0, 0, 1154, 1155, 8, 34, 0, 0, 1155, 272, 1, 0, 0, 0, 1156, 1158, 3, 271, 128, 0, 1157, 1156, 1, 0, 0, 0, 1158, 1159, 1, 0, 0, 0, 1159, 1157, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 1161, 1, 0, 0, 0, 1161, 1162, 3, 337, 161, 0, 1162, 1164, 1, 0, 0, 0, 1163, 1157, 1, 0, 0, 0, 1163, 1164, 1, 0, 0, 0, 1164, 1166, 1, 0, 0, 0, 1165, 1167, 3, 271, 128, 0, 1166, 1165, 1, 0, 0, 0, 1167, 1168, 1, 0, 0, 0, 1168, 1166, 1, 0, 0, 0, 1168, 1169, 1, 0, 0, 0, 1169, 274, 1, 0, 0, 0, 1170, 1171, 3, 273, 129, 0, 1171, 1172, 1, 0, 0, 0, 1172, 1173, 6, 130, 28, 0, 1173, 276, 1, 0, 0, 0, 1174, 1175, 3, 55, 20, 0, 1175, 1176, 1, 0, 0, 0, 1176, 1177, 6, 131, 10, 0, 1177, 278, 1, 0, 0, 0, 1178, 1179, 3, 57, 21, 0, 1179, 1180, 1, 0, 0, 0, 1180, 1181, 6, 132, 10, 0, 1181, 280, 1, 0, 0, 0, 1182, 1183, 3, 59, 22, 0, 1183, 1184, 1, 0, 0, 0, 1184, 1185, 6, 133, 10, 0, 1185, 282, 1, 0, 0, 0, 1186, 1187, 3, 61, 23, 0, 1187, 1188, 1, 0, 0, 0, 1188, 1189, 6, 134, 15, 0, 1189, 1190, 6, 134, 11, 0, 1190, 1191, 6, 134, 11, 0, 1191, 284, 1, 0, 0, 0, 1192, 1193, 3, 95, 40, 0, 1193, 1194, 1, 0, 0, 0, 1194, 1195, 6, 135, 19, 0, 1195, 286, 1, 0, 0, 0, 1196, 1197, 3, 99, 42, 0, 1197, 1198, 1, 0, 0, 0, 1198, 1199, 6, 136, 18, 0, 1199, 288, 1, 0, 0, 0, 1200, 1201, 3, 103, 44, 0, 1201, 1202, 1, 0, 0, 0, 1202, 1203, 6, 137, 22, 0, 1203, 290, 1, 0, 0, 0, 1204, 1205, 3, 269, 127, 0, 1205, 1206, 1, 0, 0, 0, 1206, 1207, 6, 138, 29, 0, 1207, 292, 1, 0, 0, 0, 1208, 1209, 3, 233, 109, 0, 1209, 1210, 1, 0, 0, 0, 1210, 1211, 6, 139, 25, 0, 1211, 294, 1, 0, 0, 0, 1212, 1213, 3, 173, 79, 0, 1213, 1214, 1, 0, 0, 0, 1214, 1215, 6, 140, 30, 0, 1215, 296, 1, 0, 0, 0, 1216, 1217, 3, 127, 56, 0, 1217, 1218, 1, 0, 0, 0, 1218, 1219, 6, 141, 23, 0, 1219, 298, 1, 0, 0, 0, 1220, 1221, 3, 163, 74, 0, 1221, 1222, 1, 0, 0, 0, 1222, 1223, 6, 142, 24, 0, 1223, 300, 1, 0, 0, 0, 1224, 1225, 3, 55, 20, 0, 1225, 1226, 1, 0, 0, 0, 1226, 1227, 6, 143, 10, 0, 1227, 302, 1, 0, 0, 0, 1228, 1229, 3, 57, 21, 0, 1229, 1230, 1, 0, 0, 0, 1230, 1231, 6, 144, 10, 0, 1231, 304, 1, 0, 0, 0, 1232, 1233, 3, 59, 22, 0, 1233, 1234, 1, 0, 0, 0, 1234, 1235, 6, 145, 10, 0, 1235, 306, 1, 0, 0, 0, 1236, 1237, 3, 61, 23, 0, 1237, 1238, 1, 0, 0, 0, 1238, 1239, 6, 146, 15, 0, 1239, 1240, 6, 146, 11, 0, 1240, 308, 1, 0, 0, 0, 1241, 1242, 3, 103, 44, 0, 1242, 1243, 1, 0, 0, 0, 1243, 1244, 6, 147, 22, 0, 1244, 310, 1, 0, 0, 0, 1245, 1246, 3, 127, 56, 0, 1246, 1247, 1, 0, 0, 0, 1247, 1248, 6, 148, 23, 0, 1248, 312, 1, 0, 0, 0, 1249, 1250, 3, 163, 74, 0, 1250, 1251, 1, 0, 0, 0, 1251, 1252, 6, 149, 24, 0, 1252, 314, 1, 0, 0, 0, 1253, 1254, 3, 173, 79, 0, 1254, 1255, 1, 0, 0, 0, 1255, 1256, 6, 150, 30, 0, 1256, 316, 1, 0, 0, 0, 1257, 1258, 3, 169, 77, 0, 1258, 1259, 1, 0, 0, 0, 1259, 1260, 6, 151, 31, 0, 1260, 318, 1, 0, 0, 0, 1261, 1262, 3, 55, 20, 0, 1262, 1263, 1, 0, 0, 0, 1263, 1264, 6, 152, 10, 0, 1264, 320, 1, 0, 0, 0, 1265, 1266, 3, 57, 21, 0, 1266, 1267, 1, 0, 0, 0, 1267, 1268, 6, 153, 10, 0, 1268, 322, 1, 0, 0, 0, 1269, 1270, 3, 59, 22, 0, 1270, 1271, 1, 0, 0, 0, 1271, 1272, 6, 154, 10, 0, 1272, 324, 1, 0, 0, 0, 1273, 1274, 3, 61, 23, 0, 1274, 1275, 1, 0, 0, 0, 1275, 1276, 6, 155, 15, 0, 1276, 1277, 6, 155, 11, 0, 1277, 326, 1, 0, 0, 0, 1278, 1279, 7, 1, 0, 0, 1279, 1280, 7, 9, 0, 0, 1280, 1281, 7, 15, 0, 0, 1281, 1282, 7, 7, 0, 0, 1282, 328, 1, 0, 0, 0, 1283, 1284, 3, 55, 20, 0, 1284, 1285, 1, 0, 0, 0, 1285, 1286, 6, 157, 10, 0, 1286, 330, 1, 0, 0, 0, 1287, 1288, 3, 57, 21, 0, 1288, 1289, 1, 0, 0, 0, 1289, 1290, 6, 158, 10, 0, 1290, 332, 1, 0, 0, 0, 1291, 1292, 3, 59, 22, 0, 1292, 1293, 1, 0, 0, 0, 1293, 1294, 6, 159, 10, 0, 1294, 334, 1, 0, 0, 0, 1295, 1296, 3, 167, 76, 0, 1296, 1297, 1, 0, 0, 0, 1297, 1298, 6, 160, 16, 0, 1298, 1299, 6, 160, 11, 0, 1299, 336, 1, 0, 0, 0, 1300, 1301, 5, 58, 0, 0, 1301, 338, 1, 0, 0, 0, 1302, 1308, 3, 73, 29, 0, 1303, 1308, 3, 63, 24, 0, 1304, 1308, 3, 103, 44, 0, 1305, 1308, 3, 65, 25, 0, 1306, 1308, 3, 79, 32, 0, 1307, 1302, 1, 0, 0, 0, 1307, 1303, 1, 0, 0, 0, 1307, 1304, 1, 0, 0, 0, 1307, 1305, 1, 0, 0, 0, 1307, 1306, 1, 0, 0, 0, 1308, 1309, 1, 0, 0, 0, 1309, 1307, 1, 0, 0, 0, 1309, 1310, 1, 0, 0, 0, 1310, 340, 1, 0, 0, 0, 1311, 1312, 3, 55, 20, 0, 1312, 1313, 1, 0, 0, 0, 1313, 1314, 6, 163, 10, 0, 1314, 342, 1, 0, 0, 0, 1315, 1316, 3, 57, 21, 0, 1316, 1317, 1, 0, 0, 0, 1317, 1318, 6, 164, 10, 0, 1318, 344, 1, 0, 0, 0, 1319, 1320, 3, 59, 22, 0, 1320, 1321, 1, 0, 0, 0, 1321, 1322, 6, 165, 10, 0, 1322, 346, 1, 0, 0, 0, 1323, 1324, 3, 61, 23, 0, 1324, 1325, 1, 0, 0, 0, 1325, 1326, 6, 166, 15, 0, 1326, 1327, 6, 166, 11, 0, 1327, 348, 1, 0, 0, 0, 1328, 1329, 3, 337, 161, 0, 1329, 1330, 1, 0, 0, 0, 1330, 1331, 6, 167, 17, 0, 1331, 350, 1, 0, 0, 0, 1332, 1333, 3, 99, 42, 0, 1333, 1334, 1, 0, 0, 0, 1334, 1335, 6, 168, 18, 0, 1335, 352, 1, 0, 0, 0, 1336, 1337, 3, 103, 44, 0, 1337, 1338, 1, 0, 0, 0, 1338, 1339, 6, 169, 22, 0, 1339, 354, 1, 0, 0, 0, 1340, 1341, 3, 267, 126, 0, 1341, 1342, 1, 0, 0, 0, 1342, 1343, 6, 170, 32, 0, 1343, 1344, 6, 170, 33, 0, 1344, 356, 1, 0, 0, 0, 1345, 1346, 3, 207, 96, 0, 1346, 1347, 1, 0, 0, 0, 1347, 1348, 6, 171, 20, 0, 1348, 358, 1, 0, 0, 0, 1349, 1350, 3, 83, 34, 0, 1350, 1351, 1, 0, 0, 0, 1351, 1352, 6, 172, 21, 0, 1352, 360, 1, 0, 0, 0, 1353, 1354, 3, 55, 20, 0, 1354, 1355, 1, 0, 0, 0, 1355, 1356, 6, 173, 10, 0, 1356, 362, 1, 0, 0, 0, 1357, 1358, 3, 57, 21, 0, 1358, 1359, 1, 0, 0, 0, 1359, 1360, 6, 174, 10, 0, 1360, 364, 1, 0, 0, 0, 1361, 1362, 3, 59, 22, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 6, 175, 10, 0, 1364, 366, 1, 0, 0, 0, 1365, 1366, 3, 61, 23, 0, 1366, 1367, 1, 0, 0, 0, 1367, 1368, 6, 176, 15, 0, 1368, 1369, 6, 176, 11, 0, 1369, 1370, 6, 176, 11, 0, 1370, 368, 1, 0, 0, 0, 1371, 1372, 3, 99, 42, 0, 1372, 1373, 1, 0, 0, 0, 1373, 1374, 6, 177, 18, 0, 1374, 370, 1, 0, 0, 0, 1375, 1376, 3, 103, 44, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1378, 6, 178, 22, 0, 1378, 372, 1, 0, 0, 0, 1379, 1380, 3, 233, 109, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1382, 6, 179, 25, 0, 1382, 374, 1, 0, 0, 0, 1383, 1384, 3, 55, 20, 0, 1384, 1385, 1, 0, 0, 0, 1385, 1386, 6, 180, 10, 0, 1386, 376, 1, 0, 0, 0, 1387, 1388, 3, 57, 21, 0, 1388, 1389, 1, 0, 0, 0, 1389, 1390, 6, 181, 10, 0, 1390, 378, 1, 0, 0, 0, 1391, 1392, 3, 59, 22, 0, 1392, 1393, 1, 0, 0, 0, 1393, 1394, 6, 182, 10, 0, 1394, 380, 1, 0, 0, 0, 1395, 1396, 3, 61, 23, 0, 1396, 1397, 1, 0, 0, 0, 1397, 1398, 6, 183, 15, 0, 1398, 1399, 6, 183, 11, 0, 1399, 382, 1, 0, 0, 0, 1400, 1401, 3, 207, 96, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 6, 184, 20, 0, 1403, 1404, 6, 184, 11, 0, 1404, 1405, 6, 184, 34, 0, 1405, 384, 1, 0, 0, 0, 1406, 1407, 3, 83, 34, 0, 1407, 1408, 1, 0, 0, 0, 1408, 1409, 6, 185, 21, 0, 1409, 1410, 6, 185, 11, 0, 1410, 1411, 6, 185, 34, 0, 1411, 386, 1, 0, 0, 0, 1412, 1413, 3, 55, 20, 0, 1413, 1414, 1, 0, 0, 0, 1414, 1415, 6, 186, 10, 0, 1415, 388, 1, 0, 0, 0, 1416, 1417, 3, 57, 21, 0, 1417, 1418, 1, 0, 0, 0, 1418, 1419, 6, 187, 10, 0, 1419, 390, 1, 0, 0, 0, 1420, 1421, 3, 59, 22, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 6, 188, 10, 0, 1423, 392, 1, 0, 0, 0, 1424, 1425, 3, 337, 161, 0, 1425, 1426, 1, 0, 0, 0, 1426, 1427, 6, 189, 17, 0, 1427, 1428, 6, 189, 11, 0, 1428, 1429, 6, 189, 9, 0, 1429, 394, 1, 0, 0, 0, 1430, 1431, 3, 99, 42, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 6, 190, 18, 0, 1433, 1434, 6, 190, 11, 0, 1434, 1435, 6, 190, 9, 0, 1435, 396, 1, 0, 0, 0, 1436, 1437, 3, 55, 20, 0, 1437, 1438, 1, 0, 0, 0, 1438, 1439, 6, 191, 10, 0, 1439, 398, 1, 0, 0, 0, 1440, 1441, 3, 57, 21, 0, 1441, 1442, 1, 0, 0, 0, 1442, 1443, 6, 192, 10, 0, 1443, 400, 1, 0, 0, 0, 1444, 1445, 3, 59, 22, 0, 1445, 1446, 1, 0, 0, 0, 1446, 1447, 6, 193, 10, 0, 1447, 402, 1, 0, 0, 0, 1448, 1449, 3, 173, 79, 0, 1449, 1450, 1, 0, 0, 0, 1450, 1451, 6, 194, 11, 0, 1451, 1452, 6, 194, 0, 0, 1452, 1453, 6, 194, 30, 0, 1453, 404, 1, 0, 0, 0, 1454, 1455, 3, 169, 77, 0, 1455, 1456, 1, 0, 0, 0, 1456, 1457, 6, 195, 11, 0, 1457, 1458, 6, 195, 0, 0, 1458, 1459, 6, 195, 31, 0, 1459, 406, 1, 0, 0, 0, 1460, 1461, 3, 89, 37, 0, 1461, 1462, 1, 0, 0, 0, 1462, 1463, 6, 196, 11, 0, 1463, 1464, 6, 196, 0, 0, 1464, 1465, 6, 196, 35, 0, 1465, 408, 1, 0, 0, 0, 1466, 1467, 3, 61, 23, 0, 1467, 1468, 1, 0, 0, 0, 1468, 1469, 6, 197, 15, 0, 1469, 1470, 6, 197, 11, 0, 1470, 410, 1, 0, 0, 0, 65, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 579, 589, 593, 596, 605, 607, 618, 637, 642, 651, 658, 663, 665, 676, 684, 687, 689, 694, 699, 705, 712, 717, 723, 726, 734, 738, 870, 875, 882, 884, 900, 905, 910, 912, 918, 995, 1000, 1047, 1051, 1056, 1061, 1066, 1068, 1072, 1074, 1159, 1163, 1168, 1307, 1309, 36, 5, 1, 0, 5, 4, 0, 5, 6, 0, 5, 2, 0, 5, 3, 0, 5, 8, 0, 5, 5, 0, 5, 9, 0, 5, 11, 0, 5, 13, 0, 0, 1, 0, 4, 0, 0, 7, 16, 0, 7, 65, 0, 5, 0, 0, 7, 24, 0, 7, 66, 0, 7, 104, 0, 7, 33, 0, 7, 31, 0, 7, 76, 0, 7, 25, 0, 7, 35, 0, 7, 47, 0, 7, 64, 0, 7, 80, 0, 5, 10, 0, 5, 7, 0, 7, 90, 0, 7, 89, 0, 7, 68, 0, 7, 67, 0, 7, 88, 0, 5, 12, 0, 5, 14, 0, 7, 28, 0] \ No newline at end of file diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java index 3bef23f4d2751..305126ddfae2d 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java @@ -227,8 +227,6 @@ public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { return DEV_LOOKUP_sempred((RuleContext)_localctx, predIndex); case 18: return DEV_METRICS_sempred((RuleContext)_localctx, predIndex); - case 73: - return NESTED_WHERE_sempred((RuleContext)_localctx, predIndex); } return true; } @@ -253,16 +251,9 @@ private boolean DEV_METRICS_sempred(RuleContext _localctx, int predIndex) { } return true; } - private boolean NESTED_WHERE_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 3: - return this.isDevVersion(); - } - return true; - } public static final String _serializedATN = - "\u0004\u0000x\u05c0\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff"+ + "\u0004\u0000x\u05bf\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff"+ "\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff"+ "\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff"+ "\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff\uffff"+ @@ -378,846 +369,845 @@ private boolean NESTED_WHERE_sempred(RuleContext _localctx, int predIndex) { "<\u0001<\u0001=\u0001=\u0001=\u0001>\u0001>\u0001>\u0001?\u0001?\u0001"+ "@\u0001@\u0001@\u0001A\u0001A\u0001B\u0001B\u0001B\u0001C\u0001C\u0001"+ "D\u0001D\u0001E\u0001E\u0001F\u0001F\u0001G\u0001G\u0001H\u0001H\u0001"+ - "H\u0001H\u0001H\u0001H\u0001I\u0001I\u0001I\u0001I\u0001I\u0001J\u0001"+ - "J\u0001J\u0003J\u0368\bJ\u0001J\u0005J\u036b\bJ\nJ\fJ\u036e\tJ\u0001J"+ - "\u0001J\u0004J\u0372\bJ\u000bJ\fJ\u0373\u0003J\u0376\bJ\u0001K\u0001K"+ - "\u0001K\u0001K\u0001K\u0001L\u0001L\u0001L\u0001L\u0001L\u0001M\u0001"+ - "M\u0005M\u0384\bM\nM\fM\u0387\tM\u0001M\u0001M\u0003M\u038b\bM\u0001M"+ - "\u0004M\u038e\bM\u000bM\fM\u038f\u0003M\u0392\bM\u0001N\u0001N\u0004N"+ - "\u0396\bN\u000bN\fN\u0397\u0001N\u0001N\u0001O\u0001O\u0001P\u0001P\u0001"+ - "P\u0001P\u0001Q\u0001Q\u0001Q\u0001Q\u0001R\u0001R\u0001R\u0001R\u0001"+ - "S\u0001S\u0001S\u0001S\u0001S\u0001T\u0001T\u0001T\u0001T\u0001T\u0001"+ - "U\u0001U\u0001U\u0001U\u0001V\u0001V\u0001V\u0001V\u0001W\u0001W\u0001"+ - "W\u0001W\u0001X\u0001X\u0001X\u0001X\u0001X\u0001Y\u0001Y\u0001Y\u0001"+ - "Y\u0001Z\u0001Z\u0001Z\u0001Z\u0001[\u0001[\u0001[\u0001[\u0001\\\u0001"+ - "\\\u0001\\\u0001\\\u0001]\u0001]\u0001]\u0001]\u0001^\u0001^\u0001^\u0001"+ - "^\u0001^\u0001^\u0001^\u0001^\u0001^\u0001_\u0001_\u0001_\u0003_\u03e5"+ - "\b_\u0001`\u0004`\u03e8\b`\u000b`\f`\u03e9\u0001a\u0001a\u0001a\u0001"+ - "a\u0001b\u0001b\u0001b\u0001b\u0001c\u0001c\u0001c\u0001c\u0001d\u0001"+ - "d\u0001d\u0001d\u0001e\u0001e\u0001e\u0001e\u0001f\u0001f\u0001f\u0001"+ - "f\u0001f\u0001g\u0001g\u0001g\u0001g\u0001h\u0001h\u0001h\u0001h\u0001"+ - "i\u0001i\u0001i\u0001i\u0001j\u0001j\u0001j\u0001j\u0001k\u0001k\u0001"+ - "k\u0001k\u0003k\u0419\bk\u0001l\u0001l\u0003l\u041d\bl\u0001l\u0005l\u0420"+ - "\bl\nl\fl\u0423\tl\u0001l\u0001l\u0003l\u0427\bl\u0001l\u0004l\u042a\b"+ - "l\u000bl\fl\u042b\u0003l\u042e\bl\u0001m\u0001m\u0004m\u0432\bm\u000b"+ - "m\fm\u0433\u0001n\u0001n\u0001n\u0001n\u0001o\u0001o\u0001o\u0001o\u0001"+ - "p\u0001p\u0001p\u0001p\u0001q\u0001q\u0001q\u0001q\u0001q\u0001r\u0001"+ - "r\u0001r\u0001r\u0001s\u0001s\u0001s\u0001s\u0001t\u0001t\u0001t\u0001"+ - "t\u0001u\u0001u\u0001u\u0001u\u0001v\u0001v\u0001v\u0001v\u0001w\u0001"+ - "w\u0001w\u0001x\u0001x\u0001x\u0001x\u0001y\u0001y\u0001y\u0001y\u0001"+ - "z\u0001z\u0001z\u0001z\u0001{\u0001{\u0001{\u0001{\u0001|\u0001|\u0001"+ - "|\u0001|\u0001|\u0001}\u0001}\u0001}\u0001}\u0001}\u0001~\u0001~\u0001"+ - "~\u0001~\u0001~\u0001\u007f\u0001\u007f\u0001\u007f\u0001\u007f\u0001"+ - "\u007f\u0001\u007f\u0001\u007f\u0001\u0080\u0001\u0080\u0001\u0081\u0004"+ - "\u0081\u0487\b\u0081\u000b\u0081\f\u0081\u0488\u0001\u0081\u0001\u0081"+ - "\u0003\u0081\u048d\b\u0081\u0001\u0081\u0004\u0081\u0490\b\u0081\u000b"+ - "\u0081\f\u0081\u0491\u0001\u0082\u0001\u0082\u0001\u0082\u0001\u0082\u0001"+ - "\u0083\u0001\u0083\u0001\u0083\u0001\u0083\u0001\u0084\u0001\u0084\u0001"+ - "\u0084\u0001\u0084\u0001\u0085\u0001\u0085\u0001\u0085\u0001\u0085\u0001"+ - "\u0086\u0001\u0086\u0001\u0086\u0001\u0086\u0001\u0086\u0001\u0086\u0001"+ - "\u0087\u0001\u0087\u0001\u0087\u0001\u0087\u0001\u0088\u0001\u0088\u0001"+ - "\u0088\u0001\u0088\u0001\u0089\u0001\u0089\u0001\u0089\u0001\u0089\u0001"+ - "\u008a\u0001\u008a\u0001\u008a\u0001\u008a\u0001\u008b\u0001\u008b\u0001"+ - "\u008b\u0001\u008b\u0001\u008c\u0001\u008c\u0001\u008c\u0001\u008c\u0001"+ - "\u008d\u0001\u008d\u0001\u008d\u0001\u008d\u0001\u008e\u0001\u008e\u0001"+ - "\u008e\u0001\u008e\u0001\u008f\u0001\u008f\u0001\u008f\u0001\u008f\u0001"+ - "\u0090\u0001\u0090\u0001\u0090\u0001\u0090\u0001\u0091\u0001\u0091\u0001"+ - "\u0091\u0001\u0091\u0001\u0092\u0001\u0092\u0001\u0092\u0001\u0092\u0001"+ - "\u0092\u0001\u0093\u0001\u0093\u0001\u0093\u0001\u0093\u0001\u0094\u0001"+ - "\u0094\u0001\u0094\u0001\u0094\u0001\u0095\u0001\u0095\u0001\u0095\u0001"+ - "\u0095\u0001\u0096\u0001\u0096\u0001\u0096\u0001\u0096\u0001\u0097\u0001"+ - "\u0097\u0001\u0097\u0001\u0097\u0001\u0098\u0001\u0098\u0001\u0098\u0001"+ - "\u0098\u0001\u0099\u0001\u0099\u0001\u0099\u0001\u0099\u0001\u009a\u0001"+ - "\u009a\u0001\u009a\u0001\u009a\u0001\u009b\u0001\u009b\u0001\u009b\u0001"+ - "\u009b\u0001\u009b\u0001\u009c\u0001\u009c\u0001\u009c\u0001\u009c\u0001"+ - "\u009c\u0001\u009d\u0001\u009d\u0001\u009d\u0001\u009d\u0001\u009e\u0001"+ - "\u009e\u0001\u009e\u0001\u009e\u0001\u009f\u0001\u009f\u0001\u009f\u0001"+ - "\u009f\u0001\u00a0\u0001\u00a0\u0001\u00a0\u0001\u00a0\u0001\u00a0\u0001"+ - "\u00a1\u0001\u00a1\u0001\u00a2\u0001\u00a2\u0001\u00a2\u0001\u00a2\u0001"+ - "\u00a2\u0004\u00a2\u051d\b\u00a2\u000b\u00a2\f\u00a2\u051e\u0001\u00a3"+ - "\u0001\u00a3\u0001\u00a3\u0001\u00a3\u0001\u00a4\u0001\u00a4\u0001\u00a4"+ - "\u0001\u00a4\u0001\u00a5\u0001\u00a5\u0001\u00a5\u0001\u00a5\u0001\u00a6"+ - "\u0001\u00a6\u0001\u00a6\u0001\u00a6\u0001\u00a6\u0001\u00a7\u0001\u00a7"+ - "\u0001\u00a7\u0001\u00a7\u0001\u00a8\u0001\u00a8\u0001\u00a8\u0001\u00a8"+ - "\u0001\u00a9\u0001\u00a9\u0001\u00a9\u0001\u00a9\u0001\u00aa\u0001\u00aa"+ - "\u0001\u00aa\u0001\u00aa\u0001\u00aa\u0001\u00ab\u0001\u00ab\u0001\u00ab"+ - "\u0001\u00ab\u0001\u00ac\u0001\u00ac\u0001\u00ac\u0001\u00ac\u0001\u00ad"+ - "\u0001\u00ad\u0001\u00ad\u0001\u00ad\u0001\u00ae\u0001\u00ae\u0001\u00ae"+ - "\u0001\u00ae\u0001\u00af\u0001\u00af\u0001\u00af\u0001\u00af\u0001\u00b0"+ - "\u0001\u00b0\u0001\u00b0\u0001\u00b0\u0001\u00b0\u0001\u00b0\u0001\u00b1"+ - "\u0001\u00b1\u0001\u00b1\u0001\u00b1\u0001\u00b2\u0001\u00b2\u0001\u00b2"+ - "\u0001\u00b2\u0001\u00b3\u0001\u00b3\u0001\u00b3\u0001\u00b3\u0001\u00b4"+ - "\u0001\u00b4\u0001\u00b4\u0001\u00b4\u0001\u00b5\u0001\u00b5\u0001\u00b5"+ - "\u0001\u00b5\u0001\u00b6\u0001\u00b6\u0001\u00b6\u0001\u00b6\u0001\u00b7"+ - "\u0001\u00b7\u0001\u00b7\u0001\u00b7\u0001\u00b7\u0001\u00b8\u0001\u00b8"+ - "\u0001\u00b8\u0001\u00b8\u0001\u00b8\u0001\u00b8\u0001\u00b9\u0001\u00b9"+ - "\u0001\u00b9\u0001\u00b9\u0001\u00b9\u0001\u00b9\u0001\u00ba\u0001\u00ba"+ - "\u0001\u00ba\u0001\u00ba\u0001\u00bb\u0001\u00bb\u0001\u00bb\u0001\u00bb"+ - "\u0001\u00bc\u0001\u00bc\u0001\u00bc\u0001\u00bc\u0001\u00bd\u0001\u00bd"+ - "\u0001\u00bd\u0001\u00bd\u0001\u00bd\u0001\u00bd\u0001\u00be\u0001\u00be"+ - "\u0001\u00be\u0001\u00be\u0001\u00be\u0001\u00be\u0001\u00bf\u0001\u00bf"+ - "\u0001\u00bf\u0001\u00bf\u0001\u00c0\u0001\u00c0\u0001\u00c0\u0001\u00c0"+ - "\u0001\u00c1\u0001\u00c1\u0001\u00c1\u0001\u00c1\u0001\u00c2\u0001\u00c2"+ - "\u0001\u00c2\u0001\u00c2\u0001\u00c2\u0001\u00c2\u0001\u00c3\u0001\u00c3"+ - "\u0001\u00c3\u0001\u00c3\u0001\u00c3\u0001\u00c3\u0001\u00c4\u0001\u00c4"+ - "\u0001\u00c4\u0001\u00c4\u0001\u00c4\u0001\u00c4\u0001\u00c5\u0001\u00c5"+ - "\u0001\u00c5\u0001\u00c5\u0001\u00c5\u0002\u025f\u02a4\u0000\u00c6\u000f"+ - "\u0001\u0011\u0002\u0013\u0003\u0015\u0004\u0017\u0005\u0019\u0006\u001b"+ - "\u0007\u001d\b\u001f\t!\n#\u000b%\f\'\r)\u000e+\u000f-\u0010/\u00111\u0012"+ - "3\u00135\u00147\u00159\u0016;\u0017=\u0018?\u0000A\u0000C\u0000E\u0000"+ - "G\u0000I\u0000K\u0000M\u0000O\u0000Q\u0000S\u0019U\u001aW\u001bY\u001c"+ - "[\u001d]\u001e_\u001fa c!e\"g#i$k%m&o\'q(s)u*w+y,{-}.\u007f/\u00810\u0083"+ - "1\u00852\u00873\u00894\u008b5\u008d6\u008f7\u00918\u00939\u0095:\u0097"+ - ";\u0099<\u009b=\u009d>\u009f?\u00a1\u0000\u00a3@\u00a5A\u00a7B\u00a9C"+ - "\u00ab\u0000\u00adD\u00afE\u00b1F\u00b3G\u00b5\u0000\u00b7\u0000\u00b9"+ - "H\u00bbI\u00bdJ\u00bf\u0000\u00c1\u0000\u00c3\u0000\u00c5\u0000\u00c7"+ - "\u0000\u00c9\u0000\u00cbK\u00cd\u0000\u00cfL\u00d1\u0000\u00d3\u0000\u00d5"+ - "M\u00d7N\u00d9O\u00db\u0000\u00dd\u0000\u00df\u0000\u00e1\u0000\u00e3"+ - "\u0000\u00e5\u0000\u00e7\u0000\u00e9P\u00ebQ\u00edR\u00efS\u00f1\u0000"+ - "\u00f3\u0000\u00f5\u0000\u00f7\u0000\u00f9\u0000\u00fb\u0000\u00fdT\u00ff"+ - "\u0000\u0101U\u0103V\u0105W\u0107\u0000\u0109\u0000\u010bX\u010dY\u010f"+ - "\u0000\u0111Z\u0113\u0000\u0115[\u0117\\\u0119]\u011b\u0000\u011d\u0000"+ - "\u011f\u0000\u0121\u0000\u0123\u0000\u0125\u0000\u0127\u0000\u0129\u0000"+ - "\u012b\u0000\u012d^\u012f_\u0131`\u0133\u0000\u0135\u0000\u0137\u0000"+ - "\u0139\u0000\u013b\u0000\u013d\u0000\u013fa\u0141b\u0143c\u0145\u0000"+ - "\u0147d\u0149e\u014bf\u014dg\u014f\u0000\u0151h\u0153i\u0155j\u0157k\u0159"+ - "l\u015b\u0000\u015d\u0000\u015f\u0000\u0161\u0000\u0163\u0000\u0165\u0000"+ - "\u0167\u0000\u0169m\u016bn\u016do\u016f\u0000\u0171\u0000\u0173\u0000"+ - "\u0175\u0000\u0177p\u0179q\u017br\u017d\u0000\u017f\u0000\u0181\u0000"+ - "\u0183s\u0185t\u0187u\u0189\u0000\u018b\u0000\u018dv\u018fw\u0191x\u0193"+ - "\u0000\u0195\u0000\u0197\u0000\u0199\u0000\u000f\u0000\u0001\u0002\u0003"+ - "\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e#\u0002\u0000DDdd\u0002"+ - "\u0000IIii\u0002\u0000SSss\u0002\u0000EEee\u0002\u0000CCcc\u0002\u0000"+ - "TTtt\u0002\u0000RRrr\u0002\u0000OOoo\u0002\u0000PPpp\u0002\u0000NNnn\u0002"+ - "\u0000HHhh\u0002\u0000VVvv\u0002\u0000AAaa\u0002\u0000LLll\u0002\u0000"+ - "XXxx\u0002\u0000FFff\u0002\u0000MMmm\u0002\u0000GGgg\u0002\u0000KKkk\u0002"+ - "\u0000WWww\u0002\u0000UUuu\u0006\u0000\t\n\r\r //[[]]\u0002\u0000\n\n"+ - "\r\r\u0003\u0000\t\n\r\r \u0001\u000009\u0002\u0000AZaz\b\u0000\"\"N"+ - "NRRTT\\\\nnrrtt\u0004\u0000\n\n\r\r\"\"\\\\\u0002\u0000++--\u0001\u0000"+ - "``\u0002\u0000BBbb\u0002\u0000YYyy\u000b\u0000\t\n\r\r \"\",,//::==["+ - "[]]||\u0002\u0000**//\u000b\u0000\t\n\r\r \"#,,//::<<>?\\\\||\u05dc\u0000"+ - "\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000\u0000"+ - "\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000\u0000"+ - "\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000\u0000"+ - "\u001b\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000\u0000\u0000\u0000"+ - "\u001f\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000\u0000\u0000#\u0001"+ - "\u0000\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000\'\u0001\u0000"+ - "\u0000\u0000\u0000)\u0001\u0000\u0000\u0000\u0000+\u0001\u0000\u0000\u0000"+ - "\u0000-\u0001\u0000\u0000\u0000\u0000/\u0001\u0000\u0000\u0000\u00001"+ - "\u0001\u0000\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u00005\u0001\u0000"+ - "\u0000\u0000\u00007\u0001\u0000\u0000\u0000\u00009\u0001\u0000\u0000\u0000"+ - "\u0000;\u0001\u0000\u0000\u0000\u0001=\u0001\u0000\u0000\u0000\u0001S"+ - "\u0001\u0000\u0000\u0000\u0001U\u0001\u0000\u0000\u0000\u0001W\u0001\u0000"+ - "\u0000\u0000\u0001Y\u0001\u0000\u0000\u0000\u0001[\u0001\u0000\u0000\u0000"+ - "\u0001]\u0001\u0000\u0000\u0000\u0001_\u0001\u0000\u0000\u0000\u0001a"+ - "\u0001\u0000\u0000\u0000\u0001c\u0001\u0000\u0000\u0000\u0001e\u0001\u0000"+ - "\u0000\u0000\u0001g\u0001\u0000\u0000\u0000\u0001i\u0001\u0000\u0000\u0000"+ - "\u0001k\u0001\u0000\u0000\u0000\u0001m\u0001\u0000\u0000\u0000\u0001o"+ - "\u0001\u0000\u0000\u0000\u0001q\u0001\u0000\u0000\u0000\u0001s\u0001\u0000"+ - "\u0000\u0000\u0001u\u0001\u0000\u0000\u0000\u0001w\u0001\u0000\u0000\u0000"+ - "\u0001y\u0001\u0000\u0000\u0000\u0001{\u0001\u0000\u0000\u0000\u0001}"+ - "\u0001\u0000\u0000\u0000\u0001\u007f\u0001\u0000\u0000\u0000\u0001\u0081"+ - "\u0001\u0000\u0000\u0000\u0001\u0083\u0001\u0000\u0000\u0000\u0001\u0085"+ - "\u0001\u0000\u0000\u0000\u0001\u0087\u0001\u0000\u0000\u0000\u0001\u0089"+ - "\u0001\u0000\u0000\u0000\u0001\u008b\u0001\u0000\u0000\u0000\u0001\u008d"+ - "\u0001\u0000\u0000\u0000\u0001\u008f\u0001\u0000\u0000\u0000\u0001\u0091"+ - "\u0001\u0000\u0000\u0000\u0001\u0093\u0001\u0000\u0000\u0000\u0001\u0095"+ - "\u0001\u0000\u0000\u0000\u0001\u0097\u0001\u0000\u0000\u0000\u0001\u0099"+ - "\u0001\u0000\u0000\u0000\u0001\u009b\u0001\u0000\u0000\u0000\u0001\u009d"+ - "\u0001\u0000\u0000\u0000\u0001\u009f\u0001\u0000\u0000\u0000\u0001\u00a1"+ - "\u0001\u0000\u0000\u0000\u0001\u00a3\u0001\u0000\u0000\u0000\u0001\u00a5"+ - "\u0001\u0000\u0000\u0000\u0001\u00a7\u0001\u0000\u0000\u0000\u0001\u00a9"+ - "\u0001\u0000\u0000\u0000\u0001\u00ad\u0001\u0000\u0000\u0000\u0001\u00af"+ - "\u0001\u0000\u0000\u0000\u0001\u00b1\u0001\u0000\u0000\u0000\u0001\u00b3"+ - "\u0001\u0000\u0000\u0000\u0002\u00b5\u0001\u0000\u0000\u0000\u0002\u00b7"+ - "\u0001\u0000\u0000\u0000\u0002\u00b9\u0001\u0000\u0000\u0000\u0002\u00bb"+ - "\u0001\u0000\u0000\u0000\u0002\u00bd\u0001\u0000\u0000\u0000\u0003\u00bf"+ - "\u0001\u0000\u0000\u0000\u0003\u00c1\u0001\u0000\u0000\u0000\u0003\u00c3"+ - "\u0001\u0000\u0000\u0000\u0003\u00c5\u0001\u0000\u0000\u0000\u0003\u00c7"+ - "\u0001\u0000\u0000\u0000\u0003\u00c9\u0001\u0000\u0000\u0000\u0003\u00cb"+ - "\u0001\u0000\u0000\u0000\u0003\u00cf\u0001\u0000\u0000\u0000\u0003\u00d1"+ - "\u0001\u0000\u0000\u0000\u0003\u00d3\u0001\u0000\u0000\u0000\u0003\u00d5"+ - "\u0001\u0000\u0000\u0000\u0003\u00d7\u0001\u0000\u0000\u0000\u0003\u00d9"+ - "\u0001\u0000\u0000\u0000\u0004\u00db\u0001\u0000\u0000\u0000\u0004\u00dd"+ - "\u0001\u0000\u0000\u0000\u0004\u00df\u0001\u0000\u0000\u0000\u0004\u00e1"+ - "\u0001\u0000\u0000\u0000\u0004\u00e3\u0001\u0000\u0000\u0000\u0004\u00e9"+ - "\u0001\u0000\u0000\u0000\u0004\u00eb\u0001\u0000\u0000\u0000\u0004\u00ed"+ - "\u0001\u0000\u0000\u0000\u0004\u00ef\u0001\u0000\u0000\u0000\u0005\u00f1"+ - "\u0001\u0000\u0000\u0000\u0005\u00f3\u0001\u0000\u0000\u0000\u0005\u00f5"+ - "\u0001\u0000\u0000\u0000\u0005\u00f7\u0001\u0000\u0000\u0000\u0005\u00f9"+ - "\u0001\u0000\u0000\u0000\u0005\u00fb\u0001\u0000\u0000\u0000\u0005\u00fd"+ - "\u0001\u0000\u0000\u0000\u0005\u00ff\u0001\u0000\u0000\u0000\u0005\u0101"+ - "\u0001\u0000\u0000\u0000\u0005\u0103\u0001\u0000\u0000\u0000\u0005\u0105"+ - "\u0001\u0000\u0000\u0000\u0006\u0107\u0001\u0000\u0000\u0000\u0006\u0109"+ - "\u0001\u0000\u0000\u0000\u0006\u010b\u0001\u0000\u0000\u0000\u0006\u010d"+ - "\u0001\u0000\u0000\u0000\u0006\u0111\u0001\u0000\u0000\u0000\u0006\u0113"+ - "\u0001\u0000\u0000\u0000\u0006\u0115\u0001\u0000\u0000\u0000\u0006\u0117"+ - "\u0001\u0000\u0000\u0000\u0006\u0119\u0001\u0000\u0000\u0000\u0007\u011b"+ - "\u0001\u0000\u0000\u0000\u0007\u011d\u0001\u0000\u0000\u0000\u0007\u011f"+ - "\u0001\u0000\u0000\u0000\u0007\u0121\u0001\u0000\u0000\u0000\u0007\u0123"+ - "\u0001\u0000\u0000\u0000\u0007\u0125\u0001\u0000\u0000\u0000\u0007\u0127"+ - "\u0001\u0000\u0000\u0000\u0007\u0129\u0001\u0000\u0000\u0000\u0007\u012b"+ - "\u0001\u0000\u0000\u0000\u0007\u012d\u0001\u0000\u0000\u0000\u0007\u012f"+ - "\u0001\u0000\u0000\u0000\u0007\u0131\u0001\u0000\u0000\u0000\b\u0133\u0001"+ - "\u0000\u0000\u0000\b\u0135\u0001\u0000\u0000\u0000\b\u0137\u0001\u0000"+ - "\u0000\u0000\b\u0139\u0001\u0000\u0000\u0000\b\u013b\u0001\u0000\u0000"+ - "\u0000\b\u013d\u0001\u0000\u0000\u0000\b\u013f\u0001\u0000\u0000\u0000"+ - "\b\u0141\u0001\u0000\u0000\u0000\b\u0143\u0001\u0000\u0000\u0000\t\u0145"+ - "\u0001\u0000\u0000\u0000\t\u0147\u0001\u0000\u0000\u0000\t\u0149\u0001"+ - "\u0000\u0000\u0000\t\u014b\u0001\u0000\u0000\u0000\t\u014d\u0001\u0000"+ - "\u0000\u0000\n\u014f\u0001\u0000\u0000\u0000\n\u0151\u0001\u0000\u0000"+ - "\u0000\n\u0153\u0001\u0000\u0000\u0000\n\u0155\u0001\u0000\u0000\u0000"+ - "\n\u0157\u0001\u0000\u0000\u0000\n\u0159\u0001\u0000\u0000\u0000\u000b"+ - "\u015b\u0001\u0000\u0000\u0000\u000b\u015d\u0001\u0000\u0000\u0000\u000b"+ - "\u015f\u0001\u0000\u0000\u0000\u000b\u0161\u0001\u0000\u0000\u0000\u000b"+ - "\u0163\u0001\u0000\u0000\u0000\u000b\u0165\u0001\u0000\u0000\u0000\u000b"+ - "\u0167\u0001\u0000\u0000\u0000\u000b\u0169\u0001\u0000\u0000\u0000\u000b"+ - "\u016b\u0001\u0000\u0000\u0000\u000b\u016d\u0001\u0000\u0000\u0000\f\u016f"+ - "\u0001\u0000\u0000\u0000\f\u0171\u0001\u0000\u0000\u0000\f\u0173\u0001"+ - "\u0000\u0000\u0000\f\u0175\u0001\u0000\u0000\u0000\f\u0177\u0001\u0000"+ - "\u0000\u0000\f\u0179\u0001\u0000\u0000\u0000\f\u017b\u0001\u0000\u0000"+ - "\u0000\r\u017d\u0001\u0000\u0000\u0000\r\u017f\u0001\u0000\u0000\u0000"+ - "\r\u0181\u0001\u0000\u0000\u0000\r\u0183\u0001\u0000\u0000\u0000\r\u0185"+ - "\u0001\u0000\u0000\u0000\r\u0187\u0001\u0000\u0000\u0000\u000e\u0189\u0001"+ - "\u0000\u0000\u0000\u000e\u018b\u0001\u0000\u0000\u0000\u000e\u018d\u0001"+ - "\u0000\u0000\u0000\u000e\u018f\u0001\u0000\u0000\u0000\u000e\u0191\u0001"+ - "\u0000\u0000\u0000\u000e\u0193\u0001\u0000\u0000\u0000\u000e\u0195\u0001"+ - "\u0000\u0000\u0000\u000e\u0197\u0001\u0000\u0000\u0000\u000e\u0199\u0001"+ - "\u0000\u0000\u0000\u000f\u019b\u0001\u0000\u0000\u0000\u0011\u01a5\u0001"+ - "\u0000\u0000\u0000\u0013\u01ac\u0001\u0000\u0000\u0000\u0015\u01b5\u0001"+ - "\u0000\u0000\u0000\u0017\u01bc\u0001\u0000\u0000\u0000\u0019\u01c6\u0001"+ - "\u0000\u0000\u0000\u001b\u01cd\u0001\u0000\u0000\u0000\u001d\u01d4\u0001"+ - "\u0000\u0000\u0000\u001f\u01db\u0001\u0000\u0000\u0000!\u01e3\u0001\u0000"+ - "\u0000\u0000#\u01ef\u0001\u0000\u0000\u0000%\u01f8\u0001\u0000\u0000\u0000"+ - "\'\u01fe\u0001\u0000\u0000\u0000)\u0205\u0001\u0000\u0000\u0000+\u020c"+ - "\u0001\u0000\u0000\u0000-\u0214\u0001\u0000\u0000\u0000/\u021c\u0001\u0000"+ - "\u0000\u00001\u022b\u0001\u0000\u0000\u00003\u0235\u0001\u0000\u0000\u0000"+ - "5\u0241\u0001\u0000\u0000\u00007\u0247\u0001\u0000\u0000\u00009\u0258"+ - "\u0001\u0000\u0000\u0000;\u0268\u0001\u0000\u0000\u0000=\u026e\u0001\u0000"+ - "\u0000\u0000?\u0272\u0001\u0000\u0000\u0000A\u0274\u0001\u0000\u0000\u0000"+ - "C\u0276\u0001\u0000\u0000\u0000E\u0279\u0001\u0000\u0000\u0000G\u027b"+ - "\u0001\u0000\u0000\u0000I\u0284\u0001\u0000\u0000\u0000K\u0286\u0001\u0000"+ - "\u0000\u0000M\u028b\u0001\u0000\u0000\u0000O\u028d\u0001\u0000\u0000\u0000"+ - "Q\u0292\u0001\u0000\u0000\u0000S\u02b1\u0001\u0000\u0000\u0000U\u02b4"+ - "\u0001\u0000\u0000\u0000W\u02e2\u0001\u0000\u0000\u0000Y\u02e4\u0001\u0000"+ - "\u0000\u0000[\u02e7\u0001\u0000\u0000\u0000]\u02eb\u0001\u0000\u0000\u0000"+ - "_\u02ef\u0001\u0000\u0000\u0000a\u02f1\u0001\u0000\u0000\u0000c\u02f4"+ - "\u0001\u0000\u0000\u0000e\u02f6\u0001\u0000\u0000\u0000g\u02fb\u0001\u0000"+ - "\u0000\u0000i\u02fd\u0001\u0000\u0000\u0000k\u0303\u0001\u0000\u0000\u0000"+ - "m\u0309\u0001\u0000\u0000\u0000o\u030c\u0001\u0000\u0000\u0000q\u030f"+ - "\u0001\u0000\u0000\u0000s\u0314\u0001\u0000\u0000\u0000u\u0319\u0001\u0000"+ - "\u0000\u0000w\u031b\u0001\u0000\u0000\u0000y\u031f\u0001\u0000\u0000\u0000"+ - "{\u0324\u0001\u0000\u0000\u0000}\u032a\u0001\u0000\u0000\u0000\u007f\u032d"+ - "\u0001\u0000\u0000\u0000\u0081\u032f\u0001\u0000\u0000\u0000\u0083\u0335"+ - "\u0001\u0000\u0000\u0000\u0085\u0337\u0001\u0000\u0000\u0000\u0087\u033c"+ - "\u0001\u0000\u0000\u0000\u0089\u033f\u0001\u0000\u0000\u0000\u008b\u0342"+ - "\u0001\u0000\u0000\u0000\u008d\u0345\u0001\u0000\u0000\u0000\u008f\u0347"+ - "\u0001\u0000\u0000\u0000\u0091\u034a\u0001\u0000\u0000\u0000\u0093\u034c"+ - "\u0001\u0000\u0000\u0000\u0095\u034f\u0001\u0000\u0000\u0000\u0097\u0351"+ - "\u0001\u0000\u0000\u0000\u0099\u0353\u0001\u0000\u0000\u0000\u009b\u0355"+ - "\u0001\u0000\u0000\u0000\u009d\u0357\u0001\u0000\u0000\u0000\u009f\u0359"+ - "\u0001\u0000\u0000\u0000\u00a1\u035f\u0001\u0000\u0000\u0000\u00a3\u0375"+ - "\u0001\u0000\u0000\u0000\u00a5\u0377\u0001\u0000\u0000\u0000\u00a7\u037c"+ - "\u0001\u0000\u0000\u0000\u00a9\u0391\u0001\u0000\u0000\u0000\u00ab\u0393"+ - "\u0001\u0000\u0000\u0000\u00ad\u039b\u0001\u0000\u0000\u0000\u00af\u039d"+ - "\u0001\u0000\u0000\u0000\u00b1\u03a1\u0001\u0000\u0000\u0000\u00b3\u03a5"+ - "\u0001\u0000\u0000\u0000\u00b5\u03a9\u0001\u0000\u0000\u0000\u00b7\u03ae"+ - "\u0001\u0000\u0000\u0000\u00b9\u03b3\u0001\u0000\u0000\u0000\u00bb\u03b7"+ - "\u0001\u0000\u0000\u0000\u00bd\u03bb\u0001\u0000\u0000\u0000\u00bf\u03bf"+ - "\u0001\u0000\u0000\u0000\u00c1\u03c4\u0001\u0000\u0000\u0000\u00c3\u03c8"+ - "\u0001\u0000\u0000\u0000\u00c5\u03cc\u0001\u0000\u0000\u0000\u00c7\u03d0"+ - "\u0001\u0000\u0000\u0000\u00c9\u03d4\u0001\u0000\u0000\u0000\u00cb\u03d8"+ - "\u0001\u0000\u0000\u0000\u00cd\u03e4\u0001\u0000\u0000\u0000\u00cf\u03e7"+ - "\u0001\u0000\u0000\u0000\u00d1\u03eb\u0001\u0000\u0000\u0000\u00d3\u03ef"+ - "\u0001\u0000\u0000\u0000\u00d5\u03f3\u0001\u0000\u0000\u0000\u00d7\u03f7"+ - "\u0001\u0000\u0000\u0000\u00d9\u03fb\u0001\u0000\u0000\u0000\u00db\u03ff"+ - "\u0001\u0000\u0000\u0000\u00dd\u0404\u0001\u0000\u0000\u0000\u00df\u0408"+ - "\u0001\u0000\u0000\u0000\u00e1\u040c\u0001\u0000\u0000\u0000\u00e3\u0410"+ - "\u0001\u0000\u0000\u0000\u00e5\u0418\u0001\u0000\u0000\u0000\u00e7\u042d"+ - "\u0001\u0000\u0000\u0000\u00e9\u0431\u0001\u0000\u0000\u0000\u00eb\u0435"+ - "\u0001\u0000\u0000\u0000\u00ed\u0439\u0001\u0000\u0000\u0000\u00ef\u043d"+ - "\u0001\u0000\u0000\u0000\u00f1\u0441\u0001\u0000\u0000\u0000\u00f3\u0446"+ - "\u0001\u0000\u0000\u0000\u00f5\u044a\u0001\u0000\u0000\u0000\u00f7\u044e"+ - "\u0001\u0000\u0000\u0000\u00f9\u0452\u0001\u0000\u0000\u0000\u00fb\u0456"+ - "\u0001\u0000\u0000\u0000\u00fd\u045a\u0001\u0000\u0000\u0000\u00ff\u045d"+ - "\u0001\u0000\u0000\u0000\u0101\u0461\u0001\u0000\u0000\u0000\u0103\u0465"+ - "\u0001\u0000\u0000\u0000\u0105\u0469\u0001\u0000\u0000\u0000\u0107\u046d"+ - "\u0001\u0000\u0000\u0000\u0109\u0472\u0001\u0000\u0000\u0000\u010b\u0477"+ - "\u0001\u0000\u0000\u0000\u010d\u047c\u0001\u0000\u0000\u0000\u010f\u0483"+ - "\u0001\u0000\u0000\u0000\u0111\u048c\u0001\u0000\u0000\u0000\u0113\u0493"+ - "\u0001\u0000\u0000\u0000\u0115\u0497\u0001\u0000\u0000\u0000\u0117\u049b"+ - "\u0001\u0000\u0000\u0000\u0119\u049f\u0001\u0000\u0000\u0000\u011b\u04a3"+ - "\u0001\u0000\u0000\u0000\u011d\u04a9\u0001\u0000\u0000\u0000\u011f\u04ad"+ - "\u0001\u0000\u0000\u0000\u0121\u04b1\u0001\u0000\u0000\u0000\u0123\u04b5"+ - "\u0001\u0000\u0000\u0000\u0125\u04b9\u0001\u0000\u0000\u0000\u0127\u04bd"+ - "\u0001\u0000\u0000\u0000\u0129\u04c1\u0001\u0000\u0000\u0000\u012b\u04c5"+ - "\u0001\u0000\u0000\u0000\u012d\u04c9\u0001\u0000\u0000\u0000\u012f\u04cd"+ - "\u0001\u0000\u0000\u0000\u0131\u04d1\u0001\u0000\u0000\u0000\u0133\u04d5"+ - "\u0001\u0000\u0000\u0000\u0135\u04da\u0001\u0000\u0000\u0000\u0137\u04de"+ - "\u0001\u0000\u0000\u0000\u0139\u04e2\u0001\u0000\u0000\u0000\u013b\u04e6"+ - "\u0001\u0000\u0000\u0000\u013d\u04ea\u0001\u0000\u0000\u0000\u013f\u04ee"+ - "\u0001\u0000\u0000\u0000\u0141\u04f2\u0001\u0000\u0000\u0000\u0143\u04f6"+ - "\u0001\u0000\u0000\u0000\u0145\u04fa\u0001\u0000\u0000\u0000\u0147\u04ff"+ - "\u0001\u0000\u0000\u0000\u0149\u0504\u0001\u0000\u0000\u0000\u014b\u0508"+ - "\u0001\u0000\u0000\u0000\u014d\u050c\u0001\u0000\u0000\u0000\u014f\u0510"+ - "\u0001\u0000\u0000\u0000\u0151\u0515\u0001\u0000\u0000\u0000\u0153\u051c"+ - "\u0001\u0000\u0000\u0000\u0155\u0520\u0001\u0000\u0000\u0000\u0157\u0524"+ - "\u0001\u0000\u0000\u0000\u0159\u0528\u0001\u0000\u0000\u0000\u015b\u052c"+ - "\u0001\u0000\u0000\u0000\u015d\u0531\u0001\u0000\u0000\u0000\u015f\u0535"+ - "\u0001\u0000\u0000\u0000\u0161\u0539\u0001\u0000\u0000\u0000\u0163\u053d"+ - "\u0001\u0000\u0000\u0000\u0165\u0542\u0001\u0000\u0000\u0000\u0167\u0546"+ - "\u0001\u0000\u0000\u0000\u0169\u054a\u0001\u0000\u0000\u0000\u016b\u054e"+ - "\u0001\u0000\u0000\u0000\u016d\u0552\u0001\u0000\u0000\u0000\u016f\u0556"+ - "\u0001\u0000\u0000\u0000\u0171\u055c\u0001\u0000\u0000\u0000\u0173\u0560"+ - "\u0001\u0000\u0000\u0000\u0175\u0564\u0001\u0000\u0000\u0000\u0177\u0568"+ - "\u0001\u0000\u0000\u0000\u0179\u056c\u0001\u0000\u0000\u0000\u017b\u0570"+ - "\u0001\u0000\u0000\u0000\u017d\u0574\u0001\u0000\u0000\u0000\u017f\u0579"+ - "\u0001\u0000\u0000\u0000\u0181\u057f\u0001\u0000\u0000\u0000\u0183\u0585"+ - "\u0001\u0000\u0000\u0000\u0185\u0589\u0001\u0000\u0000\u0000\u0187\u058d"+ - "\u0001\u0000\u0000\u0000\u0189\u0591\u0001\u0000\u0000\u0000\u018b\u0597"+ - "\u0001\u0000\u0000\u0000\u018d\u059d\u0001\u0000\u0000\u0000\u018f\u05a1"+ - "\u0001\u0000\u0000\u0000\u0191\u05a5\u0001\u0000\u0000\u0000\u0193\u05a9"+ - "\u0001\u0000\u0000\u0000\u0195\u05af\u0001\u0000\u0000\u0000\u0197\u05b5"+ - "\u0001\u0000\u0000\u0000\u0199\u05bb\u0001\u0000\u0000\u0000\u019b\u019c"+ - "\u0007\u0000\u0000\u0000\u019c\u019d\u0007\u0001\u0000\u0000\u019d\u019e"+ - "\u0007\u0002\u0000\u0000\u019e\u019f\u0007\u0002\u0000\u0000\u019f\u01a0"+ - "\u0007\u0003\u0000\u0000\u01a0\u01a1\u0007\u0004\u0000\u0000\u01a1\u01a2"+ - "\u0007\u0005\u0000\u0000\u01a2\u01a3\u0001\u0000\u0000\u0000\u01a3\u01a4"+ - "\u0006\u0000\u0000\u0000\u01a4\u0010\u0001\u0000\u0000\u0000\u01a5\u01a6"+ - "\u0007\u0000\u0000\u0000\u01a6\u01a7\u0007\u0006\u0000\u0000\u01a7\u01a8"+ - "\u0007\u0007\u0000\u0000\u01a8\u01a9\u0007\b\u0000\u0000\u01a9\u01aa\u0001"+ - "\u0000\u0000\u0000\u01aa\u01ab\u0006\u0001\u0001\u0000\u01ab\u0012\u0001"+ - "\u0000\u0000\u0000\u01ac\u01ad\u0007\u0003\u0000\u0000\u01ad\u01ae\u0007"+ - "\t\u0000\u0000\u01ae\u01af\u0007\u0006\u0000\u0000\u01af\u01b0\u0007\u0001"+ - "\u0000\u0000\u01b0\u01b1\u0007\u0004\u0000\u0000\u01b1\u01b2\u0007\n\u0000"+ - "\u0000\u01b2\u01b3\u0001\u0000\u0000\u0000\u01b3\u01b4\u0006\u0002\u0002"+ - "\u0000\u01b4\u0014\u0001\u0000\u0000\u0000\u01b5\u01b6\u0007\u0003\u0000"+ - "\u0000\u01b6\u01b7\u0007\u000b\u0000\u0000\u01b7\u01b8\u0007\f\u0000\u0000"+ - "\u01b8\u01b9\u0007\r\u0000\u0000\u01b9\u01ba\u0001\u0000\u0000\u0000\u01ba"+ - "\u01bb\u0006\u0003\u0000\u0000\u01bb\u0016\u0001\u0000\u0000\u0000\u01bc"+ - "\u01bd\u0007\u0003\u0000\u0000\u01bd\u01be\u0007\u000e\u0000\u0000\u01be"+ - "\u01bf\u0007\b\u0000\u0000\u01bf\u01c0\u0007\r\u0000\u0000\u01c0\u01c1"+ - "\u0007\f\u0000\u0000\u01c1\u01c2\u0007\u0001\u0000\u0000\u01c2\u01c3\u0007"+ - "\t\u0000\u0000\u01c3\u01c4\u0001\u0000\u0000\u0000\u01c4\u01c5\u0006\u0004"+ - "\u0003\u0000\u01c5\u0018\u0001\u0000\u0000\u0000\u01c6\u01c7\u0007\u000f"+ - "\u0000\u0000\u01c7\u01c8\u0007\u0006\u0000\u0000\u01c8\u01c9\u0007\u0007"+ - "\u0000\u0000\u01c9\u01ca\u0007\u0010\u0000\u0000\u01ca\u01cb\u0001\u0000"+ - "\u0000\u0000\u01cb\u01cc\u0006\u0005\u0004\u0000\u01cc\u001a\u0001\u0000"+ - "\u0000\u0000\u01cd\u01ce\u0007\u0011\u0000\u0000\u01ce\u01cf\u0007\u0006"+ - "\u0000\u0000\u01cf\u01d0\u0007\u0007\u0000\u0000\u01d0\u01d1\u0007\u0012"+ - "\u0000\u0000\u01d1\u01d2\u0001\u0000\u0000\u0000\u01d2\u01d3\u0006\u0006"+ - "\u0000\u0000\u01d3\u001c\u0001\u0000\u0000\u0000\u01d4\u01d5\u0007\u0012"+ - "\u0000\u0000\u01d5\u01d6\u0007\u0003\u0000\u0000\u01d6\u01d7\u0007\u0003"+ - "\u0000\u0000\u01d7\u01d8\u0007\b\u0000\u0000\u01d8\u01d9\u0001\u0000\u0000"+ - "\u0000\u01d9\u01da\u0006\u0007\u0001\u0000\u01da\u001e\u0001\u0000\u0000"+ - "\u0000\u01db\u01dc\u0007\r\u0000\u0000\u01dc\u01dd\u0007\u0001\u0000\u0000"+ - "\u01dd\u01de\u0007\u0010\u0000\u0000\u01de\u01df\u0007\u0001\u0000\u0000"+ - "\u01df\u01e0\u0007\u0005\u0000\u0000\u01e0\u01e1\u0001\u0000\u0000\u0000"+ - "\u01e1\u01e2\u0006\b\u0000\u0000\u01e2 \u0001\u0000\u0000\u0000\u01e3"+ - "\u01e4\u0007\u0010\u0000\u0000\u01e4\u01e5\u0007\u000b\u0000\u0000\u01e5"+ - "\u01e6\u0005_\u0000\u0000\u01e6\u01e7\u0007\u0003\u0000\u0000\u01e7\u01e8"+ - "\u0007\u000e\u0000\u0000\u01e8\u01e9\u0007\b\u0000\u0000\u01e9\u01ea\u0007"+ - "\f\u0000\u0000\u01ea\u01eb\u0007\t\u0000\u0000\u01eb\u01ec\u0007\u0000"+ - "\u0000\u0000\u01ec\u01ed\u0001\u0000\u0000\u0000\u01ed\u01ee\u0006\t\u0005"+ - "\u0000\u01ee\"\u0001\u0000\u0000\u0000\u01ef\u01f0\u0007\u0006\u0000\u0000"+ - "\u01f0\u01f1\u0007\u0003\u0000\u0000\u01f1\u01f2\u0007\t\u0000\u0000\u01f2"+ - "\u01f3\u0007\f\u0000\u0000\u01f3\u01f4\u0007\u0010\u0000\u0000\u01f4\u01f5"+ - "\u0007\u0003\u0000\u0000\u01f5\u01f6\u0001\u0000\u0000\u0000\u01f6\u01f7"+ - "\u0006\n\u0006\u0000\u01f7$\u0001\u0000\u0000\u0000\u01f8\u01f9\u0007"+ - "\u0006\u0000\u0000\u01f9\u01fa\u0007\u0007\u0000\u0000\u01fa\u01fb\u0007"+ - "\u0013\u0000\u0000\u01fb\u01fc\u0001\u0000\u0000\u0000\u01fc\u01fd\u0006"+ - "\u000b\u0000\u0000\u01fd&\u0001\u0000\u0000\u0000\u01fe\u01ff\u0007\u0002"+ - "\u0000\u0000\u01ff\u0200\u0007\n\u0000\u0000\u0200\u0201\u0007\u0007\u0000"+ - "\u0000\u0201\u0202\u0007\u0013\u0000\u0000\u0202\u0203\u0001\u0000\u0000"+ - "\u0000\u0203\u0204\u0006\f\u0007\u0000\u0204(\u0001\u0000\u0000\u0000"+ - "\u0205\u0206\u0007\u0002\u0000\u0000\u0206\u0207\u0007\u0007\u0000\u0000"+ - "\u0207\u0208\u0007\u0006\u0000\u0000\u0208\u0209\u0007\u0005\u0000\u0000"+ - "\u0209\u020a\u0001\u0000\u0000\u0000\u020a\u020b\u0006\r\u0000\u0000\u020b"+ - "*\u0001\u0000\u0000\u0000\u020c\u020d\u0007\u0002\u0000\u0000\u020d\u020e"+ - "\u0007\u0005\u0000\u0000\u020e\u020f\u0007\f\u0000\u0000\u020f\u0210\u0007"+ - "\u0005\u0000\u0000\u0210\u0211\u0007\u0002\u0000\u0000\u0211\u0212\u0001"+ - "\u0000\u0000\u0000\u0212\u0213\u0006\u000e\u0000\u0000\u0213,\u0001\u0000"+ - "\u0000\u0000\u0214\u0215\u0007\u0013\u0000\u0000\u0215\u0216\u0007\n\u0000"+ - "\u0000\u0216\u0217\u0007\u0003\u0000\u0000\u0217\u0218\u0007\u0006\u0000"+ - "\u0000\u0218\u0219\u0007\u0003\u0000\u0000\u0219\u021a\u0001\u0000\u0000"+ - "\u0000\u021a\u021b\u0006\u000f\u0000\u0000\u021b.\u0001\u0000\u0000\u0000"+ - "\u021c\u021d\u0004\u0010\u0000\u0000\u021d\u021e\u0007\u0001\u0000\u0000"+ - "\u021e\u021f\u0007\t\u0000\u0000\u021f\u0220\u0007\r\u0000\u0000\u0220"+ - "\u0221\u0007\u0001\u0000\u0000\u0221\u0222\u0007\t\u0000\u0000\u0222\u0223"+ - "\u0007\u0003\u0000\u0000\u0223\u0224\u0007\u0002\u0000\u0000\u0224\u0225"+ - "\u0007\u0005\u0000\u0000\u0225\u0226\u0007\f\u0000\u0000\u0226\u0227\u0007"+ - "\u0005\u0000\u0000\u0227\u0228\u0007\u0002\u0000\u0000\u0228\u0229\u0001"+ - "\u0000\u0000\u0000\u0229\u022a\u0006\u0010\u0000\u0000\u022a0\u0001\u0000"+ - "\u0000\u0000\u022b\u022c\u0004\u0011\u0001\u0000\u022c\u022d\u0007\r\u0000"+ - "\u0000\u022d\u022e\u0007\u0007\u0000\u0000\u022e\u022f\u0007\u0007\u0000"+ - "\u0000\u022f\u0230\u0007\u0012\u0000\u0000\u0230\u0231\u0007\u0014\u0000"+ - "\u0000\u0231\u0232\u0007\b\u0000\u0000\u0232\u0233\u0001\u0000\u0000\u0000"+ - "\u0233\u0234\u0006\u0011\b\u0000\u02342\u0001\u0000\u0000\u0000\u0235"+ - "\u0236\u0004\u0012\u0002\u0000\u0236\u0237\u0007\u0010\u0000\u0000\u0237"+ - "\u0238\u0007\u0003\u0000\u0000\u0238\u0239\u0007\u0005\u0000\u0000\u0239"+ - "\u023a\u0007\u0006\u0000\u0000\u023a\u023b\u0007\u0001\u0000\u0000\u023b"+ - "\u023c\u0007\u0004\u0000\u0000\u023c\u023d\u0007\u0002\u0000\u0000\u023d"+ - "\u023e\u0001\u0000\u0000\u0000\u023e\u023f\u0006\u0012\t\u0000\u023f4"+ - "\u0001\u0000\u0000\u0000\u0240\u0242\b\u0015\u0000\u0000\u0241\u0240\u0001"+ - "\u0000\u0000\u0000\u0242\u0243\u0001\u0000\u0000\u0000\u0243\u0241\u0001"+ - "\u0000\u0000\u0000\u0243\u0244\u0001\u0000\u0000\u0000\u0244\u0245\u0001"+ - "\u0000\u0000\u0000\u0245\u0246\u0006\u0013\u0000\u0000\u02466\u0001\u0000"+ - "\u0000\u0000\u0247\u0248\u0005/\u0000\u0000\u0248\u0249\u0005/\u0000\u0000"+ - "\u0249\u024d\u0001\u0000\u0000\u0000\u024a\u024c\b\u0016\u0000\u0000\u024b"+ - "\u024a\u0001\u0000\u0000\u0000\u024c\u024f\u0001\u0000\u0000\u0000\u024d"+ - "\u024b\u0001\u0000\u0000\u0000\u024d\u024e\u0001\u0000\u0000\u0000\u024e"+ - "\u0251\u0001\u0000\u0000\u0000\u024f\u024d\u0001\u0000\u0000\u0000\u0250"+ - "\u0252\u0005\r\u0000\u0000\u0251\u0250\u0001\u0000\u0000\u0000\u0251\u0252"+ - "\u0001\u0000\u0000\u0000\u0252\u0254\u0001\u0000\u0000\u0000\u0253\u0255"+ - "\u0005\n\u0000\u0000\u0254\u0253\u0001\u0000\u0000\u0000\u0254\u0255\u0001"+ - "\u0000\u0000\u0000\u0255\u0256\u0001\u0000\u0000\u0000\u0256\u0257\u0006"+ - "\u0014\n\u0000\u02578\u0001\u0000\u0000\u0000\u0258\u0259\u0005/\u0000"+ - "\u0000\u0259\u025a\u0005*\u0000\u0000\u025a\u025f\u0001\u0000\u0000\u0000"+ - "\u025b\u025e\u00039\u0015\u0000\u025c\u025e\t\u0000\u0000\u0000\u025d"+ - "\u025b\u0001\u0000\u0000\u0000\u025d\u025c\u0001\u0000\u0000\u0000\u025e"+ - "\u0261\u0001\u0000\u0000\u0000\u025f\u0260\u0001\u0000\u0000\u0000\u025f"+ - "\u025d\u0001\u0000\u0000\u0000\u0260\u0262\u0001\u0000\u0000\u0000\u0261"+ - "\u025f\u0001\u0000\u0000\u0000\u0262\u0263\u0005*\u0000\u0000\u0263\u0264"+ - "\u0005/\u0000\u0000\u0264\u0265\u0001\u0000\u0000\u0000\u0265\u0266\u0006"+ - "\u0015\n\u0000\u0266:\u0001\u0000\u0000\u0000\u0267\u0269\u0007\u0017"+ - "\u0000\u0000\u0268\u0267\u0001\u0000\u0000\u0000\u0269\u026a\u0001\u0000"+ - "\u0000\u0000\u026a\u0268\u0001\u0000\u0000\u0000\u026a\u026b\u0001\u0000"+ - "\u0000\u0000\u026b\u026c\u0001\u0000\u0000\u0000\u026c\u026d\u0006\u0016"+ - "\n\u0000\u026d<\u0001\u0000\u0000\u0000\u026e\u026f\u0005|\u0000\u0000"+ - "\u026f\u0270\u0001\u0000\u0000\u0000\u0270\u0271\u0006\u0017\u000b\u0000"+ - "\u0271>\u0001\u0000\u0000\u0000\u0272\u0273\u0007\u0018\u0000\u0000\u0273"+ - "@\u0001\u0000\u0000\u0000\u0274\u0275\u0007\u0019\u0000\u0000\u0275B\u0001"+ - "\u0000\u0000\u0000\u0276\u0277\u0005\\\u0000\u0000\u0277\u0278\u0007\u001a"+ - "\u0000\u0000\u0278D\u0001\u0000\u0000\u0000\u0279\u027a\b\u001b\u0000"+ - "\u0000\u027aF\u0001\u0000\u0000\u0000\u027b\u027d\u0007\u0003\u0000\u0000"+ - "\u027c\u027e\u0007\u001c\u0000\u0000\u027d\u027c\u0001\u0000\u0000\u0000"+ - "\u027d\u027e\u0001\u0000\u0000\u0000\u027e\u0280\u0001\u0000\u0000\u0000"+ - "\u027f\u0281\u0003?\u0018\u0000\u0280\u027f\u0001\u0000\u0000\u0000\u0281"+ - "\u0282\u0001\u0000\u0000\u0000\u0282\u0280\u0001\u0000\u0000\u0000\u0282"+ - "\u0283\u0001\u0000\u0000\u0000\u0283H\u0001\u0000\u0000\u0000\u0284\u0285"+ - "\u0005@\u0000\u0000\u0285J\u0001\u0000\u0000\u0000\u0286\u0287\u0005`"+ - "\u0000\u0000\u0287L\u0001\u0000\u0000\u0000\u0288\u028c\b\u001d\u0000"+ - "\u0000\u0289\u028a\u0005`\u0000\u0000\u028a\u028c\u0005`\u0000\u0000\u028b"+ - "\u0288\u0001\u0000\u0000\u0000\u028b\u0289\u0001\u0000\u0000\u0000\u028c"+ - "N\u0001\u0000\u0000\u0000\u028d\u028e\u0005_\u0000\u0000\u028eP\u0001"+ - "\u0000\u0000\u0000\u028f\u0293\u0003A\u0019\u0000\u0290\u0293\u0003?\u0018"+ - "\u0000\u0291\u0293\u0003O \u0000\u0292\u028f\u0001\u0000\u0000\u0000\u0292"+ - "\u0290\u0001\u0000\u0000\u0000\u0292\u0291\u0001\u0000\u0000\u0000\u0293"+ - "R\u0001\u0000\u0000\u0000\u0294\u0299\u0005\"\u0000\u0000\u0295\u0298"+ - "\u0003C\u001a\u0000\u0296\u0298\u0003E\u001b\u0000\u0297\u0295\u0001\u0000"+ - "\u0000\u0000\u0297\u0296\u0001\u0000\u0000\u0000\u0298\u029b\u0001\u0000"+ - "\u0000\u0000\u0299\u0297\u0001\u0000\u0000\u0000\u0299\u029a\u0001\u0000"+ - "\u0000\u0000\u029a\u029c\u0001\u0000\u0000\u0000\u029b\u0299\u0001\u0000"+ - "\u0000\u0000\u029c\u02b2\u0005\"\u0000\u0000\u029d\u029e\u0005\"\u0000"+ - "\u0000\u029e\u029f\u0005\"\u0000\u0000\u029f\u02a0\u0005\"\u0000\u0000"+ - "\u02a0\u02a4\u0001\u0000\u0000\u0000\u02a1\u02a3\b\u0016\u0000\u0000\u02a2"+ - "\u02a1\u0001\u0000\u0000\u0000\u02a3\u02a6\u0001\u0000\u0000\u0000\u02a4"+ - "\u02a5\u0001\u0000\u0000\u0000\u02a4\u02a2\u0001\u0000\u0000\u0000\u02a5"+ - "\u02a7\u0001\u0000\u0000\u0000\u02a6\u02a4\u0001\u0000\u0000\u0000\u02a7"+ - "\u02a8\u0005\"\u0000\u0000\u02a8\u02a9\u0005\"\u0000\u0000\u02a9\u02aa"+ - "\u0005\"\u0000\u0000\u02aa\u02ac\u0001\u0000\u0000\u0000\u02ab\u02ad\u0005"+ - "\"\u0000\u0000\u02ac\u02ab\u0001\u0000\u0000\u0000\u02ac\u02ad\u0001\u0000"+ - "\u0000\u0000\u02ad\u02af\u0001\u0000\u0000\u0000\u02ae\u02b0\u0005\"\u0000"+ - "\u0000\u02af\u02ae\u0001\u0000\u0000\u0000\u02af\u02b0\u0001\u0000\u0000"+ - "\u0000\u02b0\u02b2\u0001\u0000\u0000\u0000\u02b1\u0294\u0001\u0000\u0000"+ - "\u0000\u02b1\u029d\u0001\u0000\u0000\u0000\u02b2T\u0001\u0000\u0000\u0000"+ - "\u02b3\u02b5\u0003?\u0018\u0000\u02b4\u02b3\u0001\u0000\u0000\u0000\u02b5"+ - "\u02b6\u0001\u0000\u0000\u0000\u02b6\u02b4\u0001\u0000\u0000\u0000\u02b6"+ - "\u02b7\u0001\u0000\u0000\u0000\u02b7V\u0001\u0000\u0000\u0000\u02b8\u02ba"+ - "\u0003?\u0018\u0000\u02b9\u02b8\u0001\u0000\u0000\u0000\u02ba\u02bb\u0001"+ - "\u0000\u0000\u0000\u02bb\u02b9\u0001\u0000\u0000\u0000\u02bb\u02bc\u0001"+ - "\u0000\u0000\u0000\u02bc\u02bd\u0001\u0000\u0000\u0000\u02bd\u02c1\u0003"+ - "g,\u0000\u02be\u02c0\u0003?\u0018\u0000\u02bf\u02be\u0001\u0000\u0000"+ - "\u0000\u02c0\u02c3\u0001\u0000\u0000\u0000\u02c1\u02bf\u0001\u0000\u0000"+ - "\u0000\u02c1\u02c2\u0001\u0000\u0000\u0000\u02c2\u02e3\u0001\u0000\u0000"+ - "\u0000\u02c3\u02c1\u0001\u0000\u0000\u0000\u02c4\u02c6\u0003g,\u0000\u02c5"+ - "\u02c7\u0003?\u0018\u0000\u02c6\u02c5\u0001\u0000\u0000\u0000\u02c7\u02c8"+ - "\u0001\u0000\u0000\u0000\u02c8\u02c6\u0001\u0000\u0000\u0000\u02c8\u02c9"+ - "\u0001\u0000\u0000\u0000\u02c9\u02e3\u0001\u0000\u0000\u0000\u02ca\u02cc"+ - "\u0003?\u0018\u0000\u02cb\u02ca\u0001\u0000\u0000\u0000\u02cc\u02cd\u0001"+ - "\u0000\u0000\u0000\u02cd\u02cb\u0001\u0000\u0000\u0000\u02cd\u02ce\u0001"+ - "\u0000\u0000\u0000\u02ce\u02d6\u0001\u0000\u0000\u0000\u02cf\u02d3\u0003"+ - "g,\u0000\u02d0\u02d2\u0003?\u0018\u0000\u02d1\u02d0\u0001\u0000\u0000"+ - "\u0000\u02d2\u02d5\u0001\u0000\u0000\u0000\u02d3\u02d1\u0001\u0000\u0000"+ - "\u0000\u02d3\u02d4\u0001\u0000\u0000\u0000\u02d4\u02d7\u0001\u0000\u0000"+ - "\u0000\u02d5\u02d3\u0001\u0000\u0000\u0000\u02d6\u02cf\u0001\u0000\u0000"+ - "\u0000\u02d6\u02d7\u0001\u0000\u0000\u0000\u02d7\u02d8\u0001\u0000\u0000"+ - "\u0000\u02d8\u02d9\u0003G\u001c\u0000\u02d9\u02e3\u0001\u0000\u0000\u0000"+ - "\u02da\u02dc\u0003g,\u0000\u02db\u02dd\u0003?\u0018\u0000\u02dc\u02db"+ - "\u0001\u0000\u0000\u0000\u02dd\u02de\u0001\u0000\u0000\u0000\u02de\u02dc"+ - "\u0001\u0000\u0000\u0000\u02de\u02df\u0001\u0000\u0000\u0000\u02df\u02e0"+ - "\u0001\u0000\u0000\u0000\u02e0\u02e1\u0003G\u001c\u0000\u02e1\u02e3\u0001"+ - "\u0000\u0000\u0000\u02e2\u02b9\u0001\u0000\u0000\u0000\u02e2\u02c4\u0001"+ - "\u0000\u0000\u0000\u02e2\u02cb\u0001\u0000\u0000\u0000\u02e2\u02da\u0001"+ - "\u0000\u0000\u0000\u02e3X\u0001\u0000\u0000\u0000\u02e4\u02e5\u0007\u001e"+ - "\u0000\u0000\u02e5\u02e6\u0007\u001f\u0000\u0000\u02e6Z\u0001\u0000\u0000"+ - "\u0000\u02e7\u02e8\u0007\f\u0000\u0000\u02e8\u02e9\u0007\t\u0000\u0000"+ - "\u02e9\u02ea\u0007\u0000\u0000\u0000\u02ea\\\u0001\u0000\u0000\u0000\u02eb"+ - "\u02ec\u0007\f\u0000\u0000\u02ec\u02ed\u0007\u0002\u0000\u0000\u02ed\u02ee"+ - "\u0007\u0004\u0000\u0000\u02ee^\u0001\u0000\u0000\u0000\u02ef\u02f0\u0005"+ - "=\u0000\u0000\u02f0`\u0001\u0000\u0000\u0000\u02f1\u02f2\u0005:\u0000"+ - "\u0000\u02f2\u02f3\u0005:\u0000\u0000\u02f3b\u0001\u0000\u0000\u0000\u02f4"+ - "\u02f5\u0005,\u0000\u0000\u02f5d\u0001\u0000\u0000\u0000\u02f6\u02f7\u0007"+ - "\u0000\u0000\u0000\u02f7\u02f8\u0007\u0003\u0000\u0000\u02f8\u02f9\u0007"+ - "\u0002\u0000\u0000\u02f9\u02fa\u0007\u0004\u0000\u0000\u02faf\u0001\u0000"+ - "\u0000\u0000\u02fb\u02fc\u0005.\u0000\u0000\u02fch\u0001\u0000\u0000\u0000"+ - "\u02fd\u02fe\u0007\u000f\u0000\u0000\u02fe\u02ff\u0007\f\u0000\u0000\u02ff"+ - "\u0300\u0007\r\u0000\u0000\u0300\u0301\u0007\u0002\u0000\u0000\u0301\u0302"+ - "\u0007\u0003\u0000\u0000\u0302j\u0001\u0000\u0000\u0000\u0303\u0304\u0007"+ - "\u000f\u0000\u0000\u0304\u0305\u0007\u0001\u0000\u0000\u0305\u0306\u0007"+ - "\u0006\u0000\u0000\u0306\u0307\u0007\u0002\u0000\u0000\u0307\u0308\u0007"+ - "\u0005\u0000\u0000\u0308l\u0001\u0000\u0000\u0000\u0309\u030a\u0007\u0001"+ - "\u0000\u0000\u030a\u030b\u0007\t\u0000\u0000\u030bn\u0001\u0000\u0000"+ - "\u0000\u030c\u030d\u0007\u0001\u0000\u0000\u030d\u030e\u0007\u0002\u0000"+ - "\u0000\u030ep\u0001\u0000\u0000\u0000\u030f\u0310\u0007\r\u0000\u0000"+ - "\u0310\u0311\u0007\f\u0000\u0000\u0311\u0312\u0007\u0002\u0000\u0000\u0312"+ - "\u0313\u0007\u0005\u0000\u0000\u0313r\u0001\u0000\u0000\u0000\u0314\u0315"+ - "\u0007\r\u0000\u0000\u0315\u0316\u0007\u0001\u0000\u0000\u0316\u0317\u0007"+ - "\u0012\u0000\u0000\u0317\u0318\u0007\u0003\u0000\u0000\u0318t\u0001\u0000"+ - "\u0000\u0000\u0319\u031a\u0005(\u0000\u0000\u031av\u0001\u0000\u0000\u0000"+ - "\u031b\u031c\u0007\t\u0000\u0000\u031c\u031d\u0007\u0007\u0000\u0000\u031d"+ - "\u031e\u0007\u0005\u0000\u0000\u031ex\u0001\u0000\u0000\u0000\u031f\u0320"+ - "\u0007\t\u0000\u0000\u0320\u0321\u0007\u0014\u0000\u0000\u0321\u0322\u0007"+ - "\r\u0000\u0000\u0322\u0323\u0007\r\u0000\u0000\u0323z\u0001\u0000\u0000"+ - "\u0000\u0324\u0325\u0007\t\u0000\u0000\u0325\u0326\u0007\u0014\u0000\u0000"+ - "\u0326\u0327\u0007\r\u0000\u0000\u0327\u0328\u0007\r\u0000\u0000\u0328"+ - "\u0329\u0007\u0002\u0000\u0000\u0329|\u0001\u0000\u0000\u0000\u032a\u032b"+ - "\u0007\u0007\u0000\u0000\u032b\u032c\u0007\u0006\u0000\u0000\u032c~\u0001"+ - "\u0000\u0000\u0000\u032d\u032e\u0005?\u0000\u0000\u032e\u0080\u0001\u0000"+ - "\u0000\u0000\u032f\u0330\u0007\u0006\u0000\u0000\u0330\u0331\u0007\r\u0000"+ - "\u0000\u0331\u0332\u0007\u0001\u0000\u0000\u0332\u0333\u0007\u0012\u0000"+ - "\u0000\u0333\u0334\u0007\u0003\u0000\u0000\u0334\u0082\u0001\u0000\u0000"+ - "\u0000\u0335\u0336\u0005)\u0000\u0000\u0336\u0084\u0001\u0000\u0000\u0000"+ - "\u0337\u0338\u0007\u0005\u0000\u0000\u0338\u0339\u0007\u0006\u0000\u0000"+ - "\u0339\u033a\u0007\u0014\u0000\u0000\u033a\u033b\u0007\u0003\u0000\u0000"+ - "\u033b\u0086\u0001\u0000\u0000\u0000\u033c\u033d\u0005=\u0000\u0000\u033d"+ - "\u033e\u0005=\u0000\u0000\u033e\u0088\u0001\u0000\u0000\u0000\u033f\u0340"+ - "\u0005=\u0000\u0000\u0340\u0341\u0005~\u0000\u0000\u0341\u008a\u0001\u0000"+ - "\u0000\u0000\u0342\u0343\u0005!\u0000\u0000\u0343\u0344\u0005=\u0000\u0000"+ - "\u0344\u008c\u0001\u0000\u0000\u0000\u0345\u0346\u0005<\u0000\u0000\u0346"+ - "\u008e\u0001\u0000\u0000\u0000\u0347\u0348\u0005<\u0000\u0000\u0348\u0349"+ - "\u0005=\u0000\u0000\u0349\u0090\u0001\u0000\u0000\u0000\u034a\u034b\u0005"+ - ">\u0000\u0000\u034b\u0092\u0001\u0000\u0000\u0000\u034c\u034d\u0005>\u0000"+ - "\u0000\u034d\u034e\u0005=\u0000\u0000\u034e\u0094\u0001\u0000\u0000\u0000"+ - "\u034f\u0350\u0005+\u0000\u0000\u0350\u0096\u0001\u0000\u0000\u0000\u0351"+ - "\u0352\u0005-\u0000\u0000\u0352\u0098\u0001\u0000\u0000\u0000\u0353\u0354"+ - "\u0005*\u0000\u0000\u0354\u009a\u0001\u0000\u0000\u0000\u0355\u0356\u0005"+ - "/\u0000\u0000\u0356\u009c\u0001\u0000\u0000\u0000\u0357\u0358\u0005%\u0000"+ - "\u0000\u0358\u009e\u0001\u0000\u0000\u0000\u0359\u035a\u0007\u0010\u0000"+ - "\u0000\u035a\u035b\u0007\f\u0000\u0000\u035b\u035c\u0007\u0005\u0000\u0000"+ - "\u035c\u035d\u0007\u0004\u0000\u0000\u035d\u035e\u0007\n\u0000\u0000\u035e"+ - "\u00a0\u0001\u0000\u0000\u0000\u035f\u0360\u0004I\u0003\u0000\u0360\u0361"+ - "\u0003-\u000f\u0000\u0361\u0362\u0001\u0000\u0000\u0000\u0362\u0363\u0006"+ - "I\f\u0000\u0363\u00a2\u0001\u0000\u0000\u0000\u0364\u0367\u0003\u007f"+ - "8\u0000\u0365\u0368\u0003A\u0019\u0000\u0366\u0368\u0003O \u0000\u0367"+ - "\u0365\u0001\u0000\u0000\u0000\u0367\u0366\u0001\u0000\u0000\u0000\u0368"+ - "\u036c\u0001\u0000\u0000\u0000\u0369\u036b\u0003Q!\u0000\u036a\u0369\u0001"+ - "\u0000\u0000\u0000\u036b\u036e\u0001\u0000\u0000\u0000\u036c\u036a\u0001"+ - "\u0000\u0000\u0000\u036c\u036d\u0001\u0000\u0000\u0000\u036d\u0376\u0001"+ - "\u0000\u0000\u0000\u036e\u036c\u0001\u0000\u0000\u0000\u036f\u0371\u0003"+ - "\u007f8\u0000\u0370\u0372\u0003?\u0018\u0000\u0371\u0370\u0001\u0000\u0000"+ - "\u0000\u0372\u0373\u0001\u0000\u0000\u0000\u0373\u0371\u0001\u0000\u0000"+ - "\u0000\u0373\u0374\u0001\u0000\u0000\u0000\u0374\u0376\u0001\u0000\u0000"+ - "\u0000\u0375\u0364\u0001\u0000\u0000\u0000\u0375\u036f\u0001\u0000\u0000"+ - "\u0000\u0376\u00a4\u0001\u0000\u0000\u0000\u0377\u0378\u0005[\u0000\u0000"+ - "\u0378\u0379\u0001\u0000\u0000\u0000\u0379\u037a\u0006K\u0000\u0000\u037a"+ - "\u037b\u0006K\u0000\u0000\u037b\u00a6\u0001\u0000\u0000\u0000\u037c\u037d"+ - "\u0005]\u0000\u0000\u037d\u037e\u0001\u0000\u0000\u0000\u037e\u037f\u0006"+ - "L\u000b\u0000\u037f\u0380\u0006L\u000b\u0000\u0380\u00a8\u0001\u0000\u0000"+ - "\u0000\u0381\u0385\u0003A\u0019\u0000\u0382\u0384\u0003Q!\u0000\u0383"+ - "\u0382\u0001\u0000\u0000\u0000\u0384\u0387\u0001\u0000\u0000\u0000\u0385"+ - "\u0383\u0001\u0000\u0000\u0000\u0385\u0386\u0001\u0000\u0000\u0000\u0386"+ - "\u0392\u0001\u0000\u0000\u0000\u0387\u0385\u0001\u0000\u0000\u0000\u0388"+ - "\u038b\u0003O \u0000\u0389\u038b\u0003I\u001d\u0000\u038a\u0388\u0001"+ - "\u0000\u0000\u0000\u038a\u0389\u0001\u0000\u0000\u0000\u038b\u038d\u0001"+ - "\u0000\u0000\u0000\u038c\u038e\u0003Q!\u0000\u038d\u038c\u0001\u0000\u0000"+ - "\u0000\u038e\u038f\u0001\u0000\u0000\u0000\u038f\u038d\u0001\u0000\u0000"+ - "\u0000\u038f\u0390\u0001\u0000\u0000\u0000\u0390\u0392\u0001\u0000\u0000"+ - "\u0000\u0391\u0381\u0001\u0000\u0000\u0000\u0391\u038a\u0001\u0000\u0000"+ - "\u0000\u0392\u00aa\u0001\u0000\u0000\u0000\u0393\u0395\u0003K\u001e\u0000"+ - "\u0394\u0396\u0003M\u001f\u0000\u0395\u0394\u0001\u0000\u0000\u0000\u0396"+ - "\u0397\u0001\u0000\u0000\u0000\u0397\u0395\u0001\u0000\u0000\u0000\u0397"+ - "\u0398\u0001\u0000\u0000\u0000\u0398\u0399\u0001\u0000\u0000\u0000\u0399"+ - "\u039a\u0003K\u001e\u0000\u039a\u00ac\u0001\u0000\u0000\u0000\u039b\u039c"+ - "\u0003\u00abN\u0000\u039c\u00ae\u0001\u0000\u0000\u0000\u039d\u039e\u0003"+ - "7\u0014\u0000\u039e\u039f\u0001\u0000\u0000\u0000\u039f\u03a0\u0006P\n"+ - "\u0000\u03a0\u00b0\u0001\u0000\u0000\u0000\u03a1\u03a2\u00039\u0015\u0000"+ - "\u03a2\u03a3\u0001\u0000\u0000\u0000\u03a3\u03a4\u0006Q\n\u0000\u03a4"+ - "\u00b2\u0001\u0000\u0000\u0000\u03a5\u03a6\u0003;\u0016\u0000\u03a6\u03a7"+ - "\u0001\u0000\u0000\u0000\u03a7\u03a8\u0006R\n\u0000\u03a8\u00b4\u0001"+ - "\u0000\u0000\u0000\u03a9\u03aa\u0003\u00a5K\u0000\u03aa\u03ab\u0001\u0000"+ - "\u0000\u0000\u03ab\u03ac\u0006S\r\u0000\u03ac\u03ad\u0006S\u000e\u0000"+ - "\u03ad\u00b6\u0001\u0000\u0000\u0000\u03ae\u03af\u0003=\u0017\u0000\u03af"+ - "\u03b0\u0001\u0000\u0000\u0000\u03b0\u03b1\u0006T\u000f\u0000\u03b1\u03b2"+ - "\u0006T\u000b\u0000\u03b2\u00b8\u0001\u0000\u0000\u0000\u03b3\u03b4\u0003"+ - ";\u0016\u0000\u03b4\u03b5\u0001\u0000\u0000\u0000\u03b5\u03b6\u0006U\n"+ - "\u0000\u03b6\u00ba\u0001\u0000\u0000\u0000\u03b7\u03b8\u00037\u0014\u0000"+ - "\u03b8\u03b9\u0001\u0000\u0000\u0000\u03b9\u03ba\u0006V\n\u0000\u03ba"+ - "\u00bc\u0001\u0000\u0000\u0000\u03bb\u03bc\u00039\u0015\u0000\u03bc\u03bd"+ - "\u0001\u0000\u0000\u0000\u03bd\u03be\u0006W\n\u0000\u03be\u00be\u0001"+ - "\u0000\u0000\u0000\u03bf\u03c0\u0003=\u0017\u0000\u03c0\u03c1\u0001\u0000"+ - "\u0000\u0000\u03c1\u03c2\u0006X\u000f\u0000\u03c2\u03c3\u0006X\u000b\u0000"+ - "\u03c3\u00c0\u0001\u0000\u0000\u0000\u03c4\u03c5\u0003\u00a5K\u0000\u03c5"+ - "\u03c6\u0001\u0000\u0000\u0000\u03c6\u03c7\u0006Y\r\u0000\u03c7\u00c2"+ - "\u0001\u0000\u0000\u0000\u03c8\u03c9\u0003\u00a7L\u0000\u03c9\u03ca\u0001"+ - "\u0000\u0000\u0000\u03ca\u03cb\u0006Z\u0010\u0000\u03cb\u00c4\u0001\u0000"+ - "\u0000\u0000\u03cc\u03cd\u0003\u0151\u00a1\u0000\u03cd\u03ce\u0001\u0000"+ - "\u0000\u0000\u03ce\u03cf\u0006[\u0011\u0000\u03cf\u00c6\u0001\u0000\u0000"+ - "\u0000\u03d0\u03d1\u0003c*\u0000\u03d1\u03d2\u0001\u0000\u0000\u0000\u03d2"+ - "\u03d3\u0006\\\u0012\u0000\u03d3\u00c8\u0001\u0000\u0000\u0000\u03d4\u03d5"+ - "\u0003_(\u0000\u03d5\u03d6\u0001\u0000\u0000\u0000\u03d6\u03d7\u0006]"+ - "\u0013\u0000\u03d7\u00ca\u0001\u0000\u0000\u0000\u03d8\u03d9\u0007\u0010"+ - "\u0000\u0000\u03d9\u03da\u0007\u0003\u0000\u0000\u03da\u03db\u0007\u0005"+ - "\u0000\u0000\u03db\u03dc\u0007\f\u0000\u0000\u03dc\u03dd\u0007\u0000\u0000"+ - "\u0000\u03dd\u03de\u0007\f\u0000\u0000\u03de\u03df\u0007\u0005\u0000\u0000"+ - "\u03df\u03e0\u0007\f\u0000\u0000\u03e0\u00cc\u0001\u0000\u0000\u0000\u03e1"+ - "\u03e5\b \u0000\u0000\u03e2\u03e3\u0005/\u0000\u0000\u03e3\u03e5\b!\u0000"+ - "\u0000\u03e4\u03e1\u0001\u0000\u0000\u0000\u03e4\u03e2\u0001\u0000\u0000"+ - "\u0000\u03e5\u00ce\u0001\u0000\u0000\u0000\u03e6\u03e8\u0003\u00cd_\u0000"+ - "\u03e7\u03e6\u0001\u0000\u0000\u0000\u03e8\u03e9\u0001\u0000\u0000\u0000"+ - "\u03e9\u03e7\u0001\u0000\u0000\u0000\u03e9\u03ea\u0001\u0000\u0000\u0000"+ - "\u03ea\u00d0\u0001\u0000\u0000\u0000\u03eb\u03ec\u0003\u00cf`\u0000\u03ec"+ - "\u03ed\u0001\u0000\u0000\u0000\u03ed\u03ee\u0006a\u0014\u0000\u03ee\u00d2"+ - "\u0001\u0000\u0000\u0000\u03ef\u03f0\u0003S\"\u0000\u03f0\u03f1\u0001"+ - "\u0000\u0000\u0000\u03f1\u03f2\u0006b\u0015\u0000\u03f2\u00d4\u0001\u0000"+ - "\u0000\u0000\u03f3\u03f4\u00037\u0014\u0000\u03f4\u03f5\u0001\u0000\u0000"+ - "\u0000\u03f5\u03f6\u0006c\n\u0000\u03f6\u00d6\u0001\u0000\u0000\u0000"+ - "\u03f7\u03f8\u00039\u0015\u0000\u03f8\u03f9\u0001\u0000\u0000\u0000\u03f9"+ - "\u03fa\u0006d\n\u0000\u03fa\u00d8\u0001\u0000\u0000\u0000\u03fb\u03fc"+ - "\u0003;\u0016\u0000\u03fc\u03fd\u0001\u0000\u0000\u0000\u03fd\u03fe\u0006"+ - "e\n\u0000\u03fe\u00da\u0001\u0000\u0000\u0000\u03ff\u0400\u0003=\u0017"+ - "\u0000\u0400\u0401\u0001\u0000\u0000\u0000\u0401\u0402\u0006f\u000f\u0000"+ - "\u0402\u0403\u0006f\u000b\u0000\u0403\u00dc\u0001\u0000\u0000\u0000\u0404"+ - "\u0405\u0003g,\u0000\u0405\u0406\u0001\u0000\u0000\u0000\u0406\u0407\u0006"+ - "g\u0016\u0000\u0407\u00de\u0001\u0000\u0000\u0000\u0408\u0409\u0003c*"+ - "\u0000\u0409\u040a\u0001\u0000\u0000\u0000\u040a\u040b\u0006h\u0012\u0000"+ - "\u040b\u00e0\u0001\u0000\u0000\u0000\u040c\u040d\u0003\u007f8\u0000\u040d"+ - "\u040e\u0001\u0000\u0000\u0000\u040e\u040f\u0006i\u0017\u0000\u040f\u00e2"+ - "\u0001\u0000\u0000\u0000\u0410\u0411\u0003\u00a3J\u0000\u0411\u0412\u0001"+ - "\u0000\u0000\u0000\u0412\u0413\u0006j\u0018\u0000\u0413\u00e4\u0001\u0000"+ - "\u0000\u0000\u0414\u0419\u0003A\u0019\u0000\u0415\u0419\u0003?\u0018\u0000"+ - "\u0416\u0419\u0003O \u0000\u0417\u0419\u0003\u0099E\u0000\u0418\u0414"+ - "\u0001\u0000\u0000\u0000\u0418\u0415\u0001\u0000\u0000\u0000\u0418\u0416"+ - "\u0001\u0000\u0000\u0000\u0418\u0417\u0001\u0000\u0000\u0000\u0419\u00e6"+ - "\u0001\u0000\u0000\u0000\u041a\u041d\u0003A\u0019\u0000\u041b\u041d\u0003"+ - "\u0099E\u0000\u041c\u041a\u0001\u0000\u0000\u0000\u041c\u041b\u0001\u0000"+ - "\u0000\u0000\u041d\u0421\u0001\u0000\u0000\u0000\u041e\u0420\u0003\u00e5"+ - "k\u0000\u041f\u041e\u0001\u0000\u0000\u0000\u0420\u0423\u0001\u0000\u0000"+ - "\u0000\u0421\u041f\u0001\u0000\u0000\u0000\u0421\u0422\u0001\u0000\u0000"+ - "\u0000\u0422\u042e\u0001\u0000\u0000\u0000\u0423\u0421\u0001\u0000\u0000"+ - "\u0000\u0424\u0427\u0003O \u0000\u0425\u0427\u0003I\u001d\u0000\u0426"+ - "\u0424\u0001\u0000\u0000\u0000\u0426\u0425\u0001\u0000\u0000\u0000\u0427"+ - "\u0429\u0001\u0000\u0000\u0000\u0428\u042a\u0003\u00e5k\u0000\u0429\u0428"+ - "\u0001\u0000\u0000\u0000\u042a\u042b\u0001\u0000\u0000\u0000\u042b\u0429"+ - "\u0001\u0000\u0000\u0000\u042b\u042c\u0001\u0000\u0000\u0000\u042c\u042e"+ - "\u0001\u0000\u0000\u0000\u042d\u041c\u0001\u0000\u0000\u0000\u042d\u0426"+ - "\u0001\u0000\u0000\u0000\u042e\u00e8\u0001\u0000\u0000\u0000\u042f\u0432"+ - "\u0003\u00e7l\u0000\u0430\u0432\u0003\u00abN\u0000\u0431\u042f\u0001\u0000"+ - "\u0000\u0000\u0431\u0430\u0001\u0000\u0000\u0000\u0432\u0433\u0001\u0000"+ - "\u0000\u0000\u0433\u0431\u0001\u0000\u0000\u0000\u0433\u0434\u0001\u0000"+ - "\u0000\u0000\u0434\u00ea\u0001\u0000\u0000\u0000\u0435\u0436\u00037\u0014"+ - "\u0000\u0436\u0437\u0001\u0000\u0000\u0000\u0437\u0438\u0006n\n\u0000"+ - "\u0438\u00ec\u0001\u0000\u0000\u0000\u0439\u043a\u00039\u0015\u0000\u043a"+ - "\u043b\u0001\u0000\u0000\u0000\u043b\u043c\u0006o\n\u0000\u043c\u00ee"+ - "\u0001\u0000\u0000\u0000\u043d\u043e\u0003;\u0016\u0000\u043e\u043f\u0001"+ - "\u0000\u0000\u0000\u043f\u0440\u0006p\n\u0000\u0440\u00f0\u0001\u0000"+ - "\u0000\u0000\u0441\u0442\u0003=\u0017\u0000\u0442\u0443\u0001\u0000\u0000"+ - "\u0000\u0443\u0444\u0006q\u000f\u0000\u0444\u0445\u0006q\u000b\u0000\u0445"+ - "\u00f2\u0001\u0000\u0000\u0000\u0446\u0447\u0003_(\u0000\u0447\u0448\u0001"+ - "\u0000\u0000\u0000\u0448\u0449\u0006r\u0013\u0000\u0449\u00f4\u0001\u0000"+ - "\u0000\u0000\u044a\u044b\u0003c*\u0000\u044b\u044c\u0001\u0000\u0000\u0000"+ - "\u044c\u044d\u0006s\u0012\u0000\u044d\u00f6\u0001\u0000\u0000\u0000\u044e"+ - "\u044f\u0003g,\u0000\u044f\u0450\u0001\u0000\u0000\u0000\u0450\u0451\u0006"+ - "t\u0016\u0000\u0451\u00f8\u0001\u0000\u0000\u0000\u0452\u0453\u0003\u007f"+ - "8\u0000\u0453\u0454\u0001\u0000\u0000\u0000\u0454\u0455\u0006u\u0017\u0000"+ - "\u0455\u00fa\u0001\u0000\u0000\u0000\u0456\u0457\u0003\u00a3J\u0000\u0457"+ - "\u0458\u0001\u0000\u0000\u0000\u0458\u0459\u0006v\u0018\u0000\u0459\u00fc"+ - "\u0001\u0000\u0000\u0000\u045a\u045b\u0007\f\u0000\u0000\u045b\u045c\u0007"+ - "\u0002\u0000\u0000\u045c\u00fe\u0001\u0000\u0000\u0000\u045d\u045e\u0003"+ - "\u00e9m\u0000\u045e\u045f\u0001\u0000\u0000\u0000\u045f\u0460\u0006x\u0019"+ - "\u0000\u0460\u0100\u0001\u0000\u0000\u0000\u0461\u0462\u00037\u0014\u0000"+ - "\u0462\u0463\u0001\u0000\u0000\u0000\u0463\u0464\u0006y\n\u0000\u0464"+ - "\u0102\u0001\u0000\u0000\u0000\u0465\u0466\u00039\u0015\u0000\u0466\u0467"+ - "\u0001\u0000\u0000\u0000\u0467\u0468\u0006z\n\u0000\u0468\u0104\u0001"+ - "\u0000\u0000\u0000\u0469\u046a\u0003;\u0016\u0000\u046a\u046b\u0001\u0000"+ - "\u0000\u0000\u046b\u046c\u0006{\n\u0000\u046c\u0106\u0001\u0000\u0000"+ - "\u0000\u046d\u046e\u0003=\u0017\u0000\u046e\u046f\u0001\u0000\u0000\u0000"+ - "\u046f\u0470\u0006|\u000f\u0000\u0470\u0471\u0006|\u000b\u0000\u0471\u0108"+ - "\u0001\u0000\u0000\u0000\u0472\u0473\u0003\u00a5K\u0000\u0473\u0474\u0001"+ - "\u0000\u0000\u0000\u0474\u0475\u0006}\r\u0000\u0475\u0476\u0006}\u001a"+ - "\u0000\u0476\u010a\u0001\u0000\u0000\u0000\u0477\u0478\u0007\u0007\u0000"+ - "\u0000\u0478\u0479\u0007\t\u0000\u0000\u0479\u047a\u0001\u0000\u0000\u0000"+ - "\u047a\u047b\u0006~\u001b\u0000\u047b\u010c\u0001\u0000\u0000\u0000\u047c"+ - "\u047d\u0007\u0013\u0000\u0000\u047d\u047e\u0007\u0001\u0000\u0000\u047e"+ - "\u047f\u0007\u0005\u0000\u0000\u047f\u0480\u0007\n\u0000\u0000\u0480\u0481"+ - "\u0001\u0000\u0000\u0000\u0481\u0482\u0006\u007f\u001b\u0000\u0482\u010e"+ - "\u0001\u0000\u0000\u0000\u0483\u0484\b\"\u0000\u0000\u0484\u0110\u0001"+ - "\u0000\u0000\u0000\u0485\u0487\u0003\u010f\u0080\u0000\u0486\u0485\u0001"+ - "\u0000\u0000\u0000\u0487\u0488\u0001\u0000\u0000\u0000\u0488\u0486\u0001"+ - "\u0000\u0000\u0000\u0488\u0489\u0001\u0000\u0000\u0000\u0489\u048a\u0001"+ - "\u0000\u0000\u0000\u048a\u048b\u0003\u0151\u00a1\u0000\u048b\u048d\u0001"+ - "\u0000\u0000\u0000\u048c\u0486\u0001\u0000\u0000\u0000\u048c\u048d\u0001"+ - "\u0000\u0000\u0000\u048d\u048f\u0001\u0000\u0000\u0000\u048e\u0490\u0003"+ - "\u010f\u0080\u0000\u048f\u048e\u0001\u0000\u0000\u0000\u0490\u0491\u0001"+ - "\u0000\u0000\u0000\u0491\u048f\u0001\u0000\u0000\u0000\u0491\u0492\u0001"+ - "\u0000\u0000\u0000\u0492\u0112\u0001\u0000\u0000\u0000\u0493\u0494\u0003"+ - "\u0111\u0081\u0000\u0494\u0495\u0001\u0000\u0000\u0000\u0495\u0496\u0006"+ - "\u0082\u001c\u0000\u0496\u0114\u0001\u0000\u0000\u0000\u0497\u0498\u0003"+ - "7\u0014\u0000\u0498\u0499\u0001\u0000\u0000\u0000\u0499\u049a\u0006\u0083"+ - "\n\u0000\u049a\u0116\u0001\u0000\u0000\u0000\u049b\u049c\u00039\u0015"+ - "\u0000\u049c\u049d\u0001\u0000\u0000\u0000\u049d\u049e\u0006\u0084\n\u0000"+ - "\u049e\u0118\u0001\u0000\u0000\u0000\u049f\u04a0\u0003;\u0016\u0000\u04a0"+ - "\u04a1\u0001\u0000\u0000\u0000\u04a1\u04a2\u0006\u0085\n\u0000\u04a2\u011a"+ - "\u0001\u0000\u0000\u0000\u04a3\u04a4\u0003=\u0017\u0000\u04a4\u04a5\u0001"+ - "\u0000\u0000\u0000\u04a5\u04a6\u0006\u0086\u000f\u0000\u04a6\u04a7\u0006"+ - "\u0086\u000b\u0000\u04a7\u04a8\u0006\u0086\u000b\u0000\u04a8\u011c\u0001"+ - "\u0000\u0000\u0000\u04a9\u04aa\u0003_(\u0000\u04aa\u04ab\u0001\u0000\u0000"+ - "\u0000\u04ab\u04ac\u0006\u0087\u0013\u0000\u04ac\u011e\u0001\u0000\u0000"+ - "\u0000\u04ad\u04ae\u0003c*\u0000\u04ae\u04af\u0001\u0000\u0000\u0000\u04af"+ - "\u04b0\u0006\u0088\u0012\u0000\u04b0\u0120\u0001\u0000\u0000\u0000\u04b1"+ - "\u04b2\u0003g,\u0000\u04b2\u04b3\u0001\u0000\u0000\u0000\u04b3\u04b4\u0006"+ - "\u0089\u0016\u0000\u04b4\u0122\u0001\u0000\u0000\u0000\u04b5\u04b6\u0003"+ - "\u010d\u007f\u0000\u04b6\u04b7\u0001\u0000\u0000\u0000\u04b7\u04b8\u0006"+ - "\u008a\u001d\u0000\u04b8\u0124\u0001\u0000\u0000\u0000\u04b9\u04ba\u0003"+ - "\u00e9m\u0000\u04ba\u04bb\u0001\u0000\u0000\u0000\u04bb\u04bc\u0006\u008b"+ - "\u0019\u0000\u04bc\u0126\u0001\u0000\u0000\u0000\u04bd\u04be\u0003\u00ad"+ - "O\u0000\u04be\u04bf\u0001\u0000\u0000\u0000\u04bf\u04c0\u0006\u008c\u001e"+ - "\u0000\u04c0\u0128\u0001\u0000\u0000\u0000\u04c1\u04c2\u0003\u007f8\u0000"+ - "\u04c2\u04c3\u0001\u0000\u0000\u0000\u04c3\u04c4\u0006\u008d\u0017\u0000"+ - "\u04c4\u012a\u0001\u0000\u0000\u0000\u04c5\u04c6\u0003\u00a3J\u0000\u04c6"+ - "\u04c7\u0001\u0000\u0000\u0000\u04c7\u04c8\u0006\u008e\u0018\u0000\u04c8"+ - "\u012c\u0001\u0000\u0000\u0000\u04c9\u04ca\u00037\u0014\u0000\u04ca\u04cb"+ - "\u0001\u0000\u0000\u0000\u04cb\u04cc\u0006\u008f\n\u0000\u04cc\u012e\u0001"+ - "\u0000\u0000\u0000\u04cd\u04ce\u00039\u0015\u0000\u04ce\u04cf\u0001\u0000"+ - "\u0000\u0000\u04cf\u04d0\u0006\u0090\n\u0000\u04d0\u0130\u0001\u0000\u0000"+ - "\u0000\u04d1\u04d2\u0003;\u0016\u0000\u04d2\u04d3\u0001\u0000\u0000\u0000"+ - "\u04d3\u04d4\u0006\u0091\n\u0000\u04d4\u0132\u0001\u0000\u0000\u0000\u04d5"+ - "\u04d6\u0003=\u0017\u0000\u04d6\u04d7\u0001\u0000\u0000\u0000\u04d7\u04d8"+ - "\u0006\u0092\u000f\u0000\u04d8\u04d9\u0006\u0092\u000b\u0000\u04d9\u0134"+ - "\u0001\u0000\u0000\u0000\u04da\u04db\u0003g,\u0000\u04db\u04dc\u0001\u0000"+ - "\u0000\u0000\u04dc\u04dd\u0006\u0093\u0016\u0000\u04dd\u0136\u0001\u0000"+ - "\u0000\u0000\u04de\u04df\u0003\u007f8\u0000\u04df\u04e0\u0001\u0000\u0000"+ - "\u0000\u04e0\u04e1\u0006\u0094\u0017\u0000\u04e1\u0138\u0001\u0000\u0000"+ - "\u0000\u04e2\u04e3\u0003\u00a3J\u0000\u04e3\u04e4\u0001\u0000\u0000\u0000"+ - "\u04e4\u04e5\u0006\u0095\u0018\u0000\u04e5\u013a\u0001\u0000\u0000\u0000"+ - "\u04e6\u04e7\u0003\u00adO\u0000\u04e7\u04e8\u0001\u0000\u0000\u0000\u04e8"+ - "\u04e9\u0006\u0096\u001e\u0000\u04e9\u013c\u0001\u0000\u0000\u0000\u04ea"+ - "\u04eb\u0003\u00a9M\u0000\u04eb\u04ec\u0001\u0000\u0000\u0000\u04ec\u04ed"+ - "\u0006\u0097\u001f\u0000\u04ed\u013e\u0001\u0000\u0000\u0000\u04ee\u04ef"+ - "\u00037\u0014\u0000\u04ef\u04f0\u0001\u0000\u0000\u0000\u04f0\u04f1\u0006"+ - "\u0098\n\u0000\u04f1\u0140\u0001\u0000\u0000\u0000\u04f2\u04f3\u00039"+ - "\u0015\u0000\u04f3\u04f4\u0001\u0000\u0000\u0000\u04f4\u04f5\u0006\u0099"+ - "\n\u0000\u04f5\u0142\u0001\u0000\u0000\u0000\u04f6\u04f7\u0003;\u0016"+ - "\u0000\u04f7\u04f8\u0001\u0000\u0000\u0000\u04f8\u04f9\u0006\u009a\n\u0000"+ - "\u04f9\u0144\u0001\u0000\u0000\u0000\u04fa\u04fb\u0003=\u0017\u0000\u04fb"+ - "\u04fc\u0001\u0000\u0000\u0000\u04fc\u04fd\u0006\u009b\u000f\u0000\u04fd"+ - "\u04fe\u0006\u009b\u000b\u0000\u04fe\u0146\u0001\u0000\u0000\u0000\u04ff"+ - "\u0500\u0007\u0001\u0000\u0000\u0500\u0501\u0007\t\u0000\u0000\u0501\u0502"+ - "\u0007\u000f\u0000\u0000\u0502\u0503\u0007\u0007\u0000\u0000\u0503\u0148"+ - "\u0001\u0000\u0000\u0000\u0504\u0505\u00037\u0014\u0000\u0505\u0506\u0001"+ - "\u0000\u0000\u0000\u0506\u0507\u0006\u009d\n\u0000\u0507\u014a\u0001\u0000"+ - "\u0000\u0000\u0508\u0509\u00039\u0015\u0000\u0509\u050a\u0001\u0000\u0000"+ - "\u0000\u050a\u050b\u0006\u009e\n\u0000\u050b\u014c\u0001\u0000\u0000\u0000"+ - "\u050c\u050d\u0003;\u0016\u0000\u050d\u050e\u0001\u0000\u0000\u0000\u050e"+ - "\u050f\u0006\u009f\n\u0000\u050f\u014e\u0001\u0000\u0000\u0000\u0510\u0511"+ - "\u0003\u00a7L\u0000\u0511\u0512\u0001\u0000\u0000\u0000\u0512\u0513\u0006"+ - "\u00a0\u0010\u0000\u0513\u0514\u0006\u00a0\u000b\u0000\u0514\u0150\u0001"+ - "\u0000\u0000\u0000\u0515\u0516\u0005:\u0000\u0000\u0516\u0152\u0001\u0000"+ - "\u0000\u0000\u0517\u051d\u0003I\u001d\u0000\u0518\u051d\u0003?\u0018\u0000"+ - "\u0519\u051d\u0003g,\u0000\u051a\u051d\u0003A\u0019\u0000\u051b\u051d"+ - "\u0003O \u0000\u051c\u0517\u0001\u0000\u0000\u0000\u051c\u0518\u0001\u0000"+ - "\u0000\u0000\u051c\u0519\u0001\u0000\u0000\u0000\u051c\u051a\u0001\u0000"+ - "\u0000\u0000\u051c\u051b\u0001\u0000\u0000\u0000\u051d\u051e\u0001\u0000"+ - "\u0000\u0000\u051e\u051c\u0001\u0000\u0000\u0000\u051e\u051f\u0001\u0000"+ - "\u0000\u0000\u051f\u0154\u0001\u0000\u0000\u0000\u0520\u0521\u00037\u0014"+ - "\u0000\u0521\u0522\u0001\u0000\u0000\u0000\u0522\u0523\u0006\u00a3\n\u0000"+ - "\u0523\u0156\u0001\u0000\u0000\u0000\u0524\u0525\u00039\u0015\u0000\u0525"+ - "\u0526\u0001\u0000\u0000\u0000\u0526\u0527\u0006\u00a4\n\u0000\u0527\u0158"+ - "\u0001\u0000\u0000\u0000\u0528\u0529\u0003;\u0016\u0000\u0529\u052a\u0001"+ - "\u0000\u0000\u0000\u052a\u052b\u0006\u00a5\n\u0000\u052b\u015a\u0001\u0000"+ - "\u0000\u0000\u052c\u052d\u0003=\u0017\u0000\u052d\u052e\u0001\u0000\u0000"+ - "\u0000\u052e\u052f\u0006\u00a6\u000f\u0000\u052f\u0530\u0006\u00a6\u000b"+ - "\u0000\u0530\u015c\u0001\u0000\u0000\u0000\u0531\u0532\u0003\u0151\u00a1"+ - "\u0000\u0532\u0533\u0001\u0000\u0000\u0000\u0533\u0534\u0006\u00a7\u0011"+ - "\u0000\u0534\u015e\u0001\u0000\u0000\u0000\u0535\u0536\u0003c*\u0000\u0536"+ - "\u0537\u0001\u0000\u0000\u0000\u0537\u0538\u0006\u00a8\u0012\u0000\u0538"+ - "\u0160\u0001\u0000\u0000\u0000\u0539\u053a\u0003g,\u0000\u053a\u053b\u0001"+ - "\u0000\u0000\u0000\u053b\u053c\u0006\u00a9\u0016\u0000\u053c\u0162\u0001"+ - "\u0000\u0000\u0000\u053d\u053e\u0003\u010b~\u0000\u053e\u053f\u0001\u0000"+ - "\u0000\u0000\u053f\u0540\u0006\u00aa \u0000\u0540\u0541\u0006\u00aa!\u0000"+ - "\u0541\u0164\u0001\u0000\u0000\u0000\u0542\u0543\u0003\u00cf`\u0000\u0543"+ - "\u0544\u0001\u0000\u0000\u0000\u0544\u0545\u0006\u00ab\u0014\u0000\u0545"+ - "\u0166\u0001\u0000\u0000\u0000\u0546\u0547\u0003S\"\u0000\u0547\u0548"+ - "\u0001\u0000\u0000\u0000\u0548\u0549\u0006\u00ac\u0015\u0000\u0549\u0168"+ - "\u0001\u0000\u0000\u0000\u054a\u054b\u00037\u0014\u0000\u054b\u054c\u0001"+ - "\u0000\u0000\u0000\u054c\u054d\u0006\u00ad\n\u0000\u054d\u016a\u0001\u0000"+ - "\u0000\u0000\u054e\u054f\u00039\u0015\u0000\u054f\u0550\u0001\u0000\u0000"+ - "\u0000\u0550\u0551\u0006\u00ae\n\u0000\u0551\u016c\u0001\u0000\u0000\u0000"+ - "\u0552\u0553\u0003;\u0016\u0000\u0553\u0554\u0001\u0000\u0000\u0000\u0554"+ - "\u0555\u0006\u00af\n\u0000\u0555\u016e\u0001\u0000\u0000\u0000\u0556\u0557"+ - "\u0003=\u0017\u0000\u0557\u0558\u0001\u0000\u0000\u0000\u0558\u0559\u0006"+ - "\u00b0\u000f\u0000\u0559\u055a\u0006\u00b0\u000b\u0000\u055a\u055b\u0006"+ - "\u00b0\u000b\u0000\u055b\u0170\u0001\u0000\u0000\u0000\u055c\u055d\u0003"+ - "c*\u0000\u055d\u055e\u0001\u0000\u0000\u0000\u055e\u055f\u0006\u00b1\u0012"+ - "\u0000\u055f\u0172\u0001\u0000\u0000\u0000\u0560\u0561\u0003g,\u0000\u0561"+ - "\u0562\u0001\u0000\u0000\u0000\u0562\u0563\u0006\u00b2\u0016\u0000\u0563"+ - "\u0174\u0001\u0000\u0000\u0000\u0564\u0565\u0003\u00e9m\u0000\u0565\u0566"+ - "\u0001\u0000\u0000\u0000\u0566\u0567\u0006\u00b3\u0019\u0000\u0567\u0176"+ - "\u0001\u0000\u0000\u0000\u0568\u0569\u00037\u0014\u0000\u0569\u056a\u0001"+ - "\u0000\u0000\u0000\u056a\u056b\u0006\u00b4\n\u0000\u056b\u0178\u0001\u0000"+ - "\u0000\u0000\u056c\u056d\u00039\u0015\u0000\u056d\u056e\u0001\u0000\u0000"+ - "\u0000\u056e\u056f\u0006\u00b5\n\u0000\u056f\u017a\u0001\u0000\u0000\u0000"+ - "\u0570\u0571\u0003;\u0016\u0000\u0571\u0572\u0001\u0000\u0000\u0000\u0572"+ - "\u0573\u0006\u00b6\n\u0000\u0573\u017c\u0001\u0000\u0000\u0000\u0574\u0575"+ - "\u0003=\u0017\u0000\u0575\u0576\u0001\u0000\u0000\u0000\u0576\u0577\u0006"+ - "\u00b7\u000f\u0000\u0577\u0578\u0006\u00b7\u000b\u0000\u0578\u017e\u0001"+ - "\u0000\u0000\u0000\u0579\u057a\u0003\u00cf`\u0000\u057a\u057b\u0001\u0000"+ - "\u0000\u0000\u057b\u057c\u0006\u00b8\u0014\u0000\u057c\u057d\u0006\u00b8"+ - "\u000b\u0000\u057d\u057e\u0006\u00b8\"\u0000\u057e\u0180\u0001\u0000\u0000"+ - "\u0000\u057f\u0580\u0003S\"\u0000\u0580\u0581\u0001\u0000\u0000\u0000"+ - "\u0581\u0582\u0006\u00b9\u0015\u0000\u0582\u0583\u0006\u00b9\u000b\u0000"+ - "\u0583\u0584\u0006\u00b9\"\u0000\u0584\u0182\u0001\u0000\u0000\u0000\u0585"+ - "\u0586\u00037\u0014\u0000\u0586\u0587\u0001\u0000\u0000\u0000\u0587\u0588"+ - "\u0006\u00ba\n\u0000\u0588\u0184\u0001\u0000\u0000\u0000\u0589\u058a\u0003"+ - "9\u0015\u0000\u058a\u058b\u0001\u0000\u0000\u0000\u058b\u058c\u0006\u00bb"+ - "\n\u0000\u058c\u0186\u0001\u0000\u0000\u0000\u058d\u058e\u0003;\u0016"+ - "\u0000\u058e\u058f\u0001\u0000\u0000\u0000\u058f\u0590\u0006\u00bc\n\u0000"+ - "\u0590\u0188\u0001\u0000\u0000\u0000\u0591\u0592\u0003\u0151\u00a1\u0000"+ - "\u0592\u0593\u0001\u0000\u0000\u0000\u0593\u0594\u0006\u00bd\u0011\u0000"+ - "\u0594\u0595\u0006\u00bd\u000b\u0000\u0595\u0596\u0006\u00bd\t\u0000\u0596"+ - "\u018a\u0001\u0000\u0000\u0000\u0597\u0598\u0003c*\u0000\u0598\u0599\u0001"+ - "\u0000\u0000\u0000\u0599\u059a\u0006\u00be\u0012\u0000\u059a\u059b\u0006"+ - "\u00be\u000b\u0000\u059b\u059c\u0006\u00be\t\u0000\u059c\u018c\u0001\u0000"+ - "\u0000\u0000\u059d\u059e\u00037\u0014\u0000\u059e\u059f\u0001\u0000\u0000"+ - "\u0000\u059f\u05a0\u0006\u00bf\n\u0000\u05a0\u018e\u0001\u0000\u0000\u0000"+ - "\u05a1\u05a2\u00039\u0015\u0000\u05a2\u05a3\u0001\u0000\u0000\u0000\u05a3"+ - "\u05a4\u0006\u00c0\n\u0000\u05a4\u0190\u0001\u0000\u0000\u0000\u05a5\u05a6"+ - "\u0003;\u0016\u0000\u05a6\u05a7\u0001\u0000\u0000\u0000\u05a7\u05a8\u0006"+ - "\u00c1\n\u0000\u05a8\u0192\u0001\u0000\u0000\u0000\u05a9\u05aa\u0003\u00ad"+ - "O\u0000\u05aa\u05ab\u0001\u0000\u0000\u0000\u05ab\u05ac\u0006\u00c2\u000b"+ - "\u0000\u05ac\u05ad\u0006\u00c2\u0000\u0000\u05ad\u05ae\u0006\u00c2\u001e"+ - "\u0000\u05ae\u0194\u0001\u0000\u0000\u0000\u05af\u05b0\u0003\u00a9M\u0000"+ - "\u05b0\u05b1\u0001\u0000\u0000\u0000\u05b1\u05b2\u0006\u00c3\u000b\u0000"+ - "\u05b2\u05b3\u0006\u00c3\u0000\u0000\u05b3\u05b4\u0006\u00c3\u001f\u0000"+ - "\u05b4\u0196\u0001\u0000\u0000\u0000\u05b5\u05b6\u0003Y%\u0000\u05b6\u05b7"+ - "\u0001\u0000\u0000\u0000\u05b7\u05b8\u0006\u00c4\u000b\u0000\u05b8\u05b9"+ - "\u0006\u00c4\u0000\u0000\u05b9\u05ba\u0006\u00c4#\u0000\u05ba\u0198\u0001"+ - "\u0000\u0000\u0000\u05bb\u05bc\u0003=\u0017\u0000\u05bc\u05bd\u0001\u0000"+ - "\u0000\u0000\u05bd\u05be\u0006\u00c5\u000f\u0000\u05be\u05bf\u0006\u00c5"+ - "\u000b\u0000\u05bf\u019a\u0001\u0000\u0000\u0000A\u0000\u0001\u0002\u0003"+ - "\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u0243\u024d\u0251\u0254"+ - "\u025d\u025f\u026a\u027d\u0282\u028b\u0292\u0297\u0299\u02a4\u02ac\u02af"+ - "\u02b1\u02b6\u02bb\u02c1\u02c8\u02cd\u02d3\u02d6\u02de\u02e2\u0367\u036c"+ - "\u0373\u0375\u0385\u038a\u038f\u0391\u0397\u03e4\u03e9\u0418\u041c\u0421"+ - "\u0426\u042b\u042d\u0431\u0433\u0488\u048c\u0491\u051c\u051e$\u0005\u0001"+ - "\u0000\u0005\u0004\u0000\u0005\u0006\u0000\u0005\u0002\u0000\u0005\u0003"+ - "\u0000\u0005\b\u0000\u0005\u0005\u0000\u0005\t\u0000\u0005\u000b\u0000"+ - "\u0005\r\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0007\u0010\u0000\u0007"+ - "A\u0000\u0005\u0000\u0000\u0007\u0018\u0000\u0007B\u0000\u0007h\u0000"+ - "\u0007!\u0000\u0007\u001f\u0000\u0007L\u0000\u0007\u0019\u0000\u0007#"+ - "\u0000\u0007/\u0000\u0007@\u0000\u0007P\u0000\u0005\n\u0000\u0005\u0007"+ - "\u0000\u0007Z\u0000\u0007Y\u0000\u0007D\u0000\u0007C\u0000\u0007X\u0000"+ - "\u0005\f\u0000\u0005\u000e\u0000\u0007\u001c\u0000"; + "H\u0001H\u0001H\u0001H\u0001I\u0001I\u0001I\u0001I\u0001J\u0001J\u0001"+ + "J\u0003J\u0367\bJ\u0001J\u0005J\u036a\bJ\nJ\fJ\u036d\tJ\u0001J\u0001J"+ + "\u0004J\u0371\bJ\u000bJ\fJ\u0372\u0003J\u0375\bJ\u0001K\u0001K\u0001K"+ + "\u0001K\u0001K\u0001L\u0001L\u0001L\u0001L\u0001L\u0001M\u0001M\u0005"+ + "M\u0383\bM\nM\fM\u0386\tM\u0001M\u0001M\u0003M\u038a\bM\u0001M\u0004M"+ + "\u038d\bM\u000bM\fM\u038e\u0003M\u0391\bM\u0001N\u0001N\u0004N\u0395\b"+ + "N\u000bN\fN\u0396\u0001N\u0001N\u0001O\u0001O\u0001P\u0001P\u0001P\u0001"+ + "P\u0001Q\u0001Q\u0001Q\u0001Q\u0001R\u0001R\u0001R\u0001R\u0001S\u0001"+ + "S\u0001S\u0001S\u0001S\u0001T\u0001T\u0001T\u0001T\u0001T\u0001U\u0001"+ + "U\u0001U\u0001U\u0001V\u0001V\u0001V\u0001V\u0001W\u0001W\u0001W\u0001"+ + "W\u0001X\u0001X\u0001X\u0001X\u0001X\u0001Y\u0001Y\u0001Y\u0001Y\u0001"+ + "Z\u0001Z\u0001Z\u0001Z\u0001[\u0001[\u0001[\u0001[\u0001\\\u0001\\\u0001"+ + "\\\u0001\\\u0001]\u0001]\u0001]\u0001]\u0001^\u0001^\u0001^\u0001^\u0001"+ + "^\u0001^\u0001^\u0001^\u0001^\u0001_\u0001_\u0001_\u0003_\u03e4\b_\u0001"+ + "`\u0004`\u03e7\b`\u000b`\f`\u03e8\u0001a\u0001a\u0001a\u0001a\u0001b\u0001"+ + "b\u0001b\u0001b\u0001c\u0001c\u0001c\u0001c\u0001d\u0001d\u0001d\u0001"+ + "d\u0001e\u0001e\u0001e\u0001e\u0001f\u0001f\u0001f\u0001f\u0001f\u0001"+ + "g\u0001g\u0001g\u0001g\u0001h\u0001h\u0001h\u0001h\u0001i\u0001i\u0001"+ + "i\u0001i\u0001j\u0001j\u0001j\u0001j\u0001k\u0001k\u0001k\u0001k\u0003"+ + "k\u0418\bk\u0001l\u0001l\u0003l\u041c\bl\u0001l\u0005l\u041f\bl\nl\fl"+ + "\u0422\tl\u0001l\u0001l\u0003l\u0426\bl\u0001l\u0004l\u0429\bl\u000bl"+ + "\fl\u042a\u0003l\u042d\bl\u0001m\u0001m\u0004m\u0431\bm\u000bm\fm\u0432"+ + "\u0001n\u0001n\u0001n\u0001n\u0001o\u0001o\u0001o\u0001o\u0001p\u0001"+ + "p\u0001p\u0001p\u0001q\u0001q\u0001q\u0001q\u0001q\u0001r\u0001r\u0001"+ + "r\u0001r\u0001s\u0001s\u0001s\u0001s\u0001t\u0001t\u0001t\u0001t\u0001"+ + "u\u0001u\u0001u\u0001u\u0001v\u0001v\u0001v\u0001v\u0001w\u0001w\u0001"+ + "w\u0001x\u0001x\u0001x\u0001x\u0001y\u0001y\u0001y\u0001y\u0001z\u0001"+ + "z\u0001z\u0001z\u0001{\u0001{\u0001{\u0001{\u0001|\u0001|\u0001|\u0001"+ + "|\u0001|\u0001}\u0001}\u0001}\u0001}\u0001}\u0001~\u0001~\u0001~\u0001"+ + "~\u0001~\u0001\u007f\u0001\u007f\u0001\u007f\u0001\u007f\u0001\u007f\u0001"+ + "\u007f\u0001\u007f\u0001\u0080\u0001\u0080\u0001\u0081\u0004\u0081\u0486"+ + "\b\u0081\u000b\u0081\f\u0081\u0487\u0001\u0081\u0001\u0081\u0003\u0081"+ + "\u048c\b\u0081\u0001\u0081\u0004\u0081\u048f\b\u0081\u000b\u0081\f\u0081"+ + "\u0490\u0001\u0082\u0001\u0082\u0001\u0082\u0001\u0082\u0001\u0083\u0001"+ + "\u0083\u0001\u0083\u0001\u0083\u0001\u0084\u0001\u0084\u0001\u0084\u0001"+ + "\u0084\u0001\u0085\u0001\u0085\u0001\u0085\u0001\u0085\u0001\u0086\u0001"+ + "\u0086\u0001\u0086\u0001\u0086\u0001\u0086\u0001\u0086\u0001\u0087\u0001"+ + "\u0087\u0001\u0087\u0001\u0087\u0001\u0088\u0001\u0088\u0001\u0088\u0001"+ + "\u0088\u0001\u0089\u0001\u0089\u0001\u0089\u0001\u0089\u0001\u008a\u0001"+ + "\u008a\u0001\u008a\u0001\u008a\u0001\u008b\u0001\u008b\u0001\u008b\u0001"+ + "\u008b\u0001\u008c\u0001\u008c\u0001\u008c\u0001\u008c\u0001\u008d\u0001"+ + "\u008d\u0001\u008d\u0001\u008d\u0001\u008e\u0001\u008e\u0001\u008e\u0001"+ + "\u008e\u0001\u008f\u0001\u008f\u0001\u008f\u0001\u008f\u0001\u0090\u0001"+ + "\u0090\u0001\u0090\u0001\u0090\u0001\u0091\u0001\u0091\u0001\u0091\u0001"+ + "\u0091\u0001\u0092\u0001\u0092\u0001\u0092\u0001\u0092\u0001\u0092\u0001"+ + "\u0093\u0001\u0093\u0001\u0093\u0001\u0093\u0001\u0094\u0001\u0094\u0001"+ + "\u0094\u0001\u0094\u0001\u0095\u0001\u0095\u0001\u0095\u0001\u0095\u0001"+ + "\u0096\u0001\u0096\u0001\u0096\u0001\u0096\u0001\u0097\u0001\u0097\u0001"+ + "\u0097\u0001\u0097\u0001\u0098\u0001\u0098\u0001\u0098\u0001\u0098\u0001"+ + "\u0099\u0001\u0099\u0001\u0099\u0001\u0099\u0001\u009a\u0001\u009a\u0001"+ + "\u009a\u0001\u009a\u0001\u009b\u0001\u009b\u0001\u009b\u0001\u009b\u0001"+ + "\u009b\u0001\u009c\u0001\u009c\u0001\u009c\u0001\u009c\u0001\u009c\u0001"+ + "\u009d\u0001\u009d\u0001\u009d\u0001\u009d\u0001\u009e\u0001\u009e\u0001"+ + "\u009e\u0001\u009e\u0001\u009f\u0001\u009f\u0001\u009f\u0001\u009f\u0001"+ + "\u00a0\u0001\u00a0\u0001\u00a0\u0001\u00a0\u0001\u00a0\u0001\u00a1\u0001"+ + "\u00a1\u0001\u00a2\u0001\u00a2\u0001\u00a2\u0001\u00a2\u0001\u00a2\u0004"+ + "\u00a2\u051c\b\u00a2\u000b\u00a2\f\u00a2\u051d\u0001\u00a3\u0001\u00a3"+ + "\u0001\u00a3\u0001\u00a3\u0001\u00a4\u0001\u00a4\u0001\u00a4\u0001\u00a4"+ + "\u0001\u00a5\u0001\u00a5\u0001\u00a5\u0001\u00a5\u0001\u00a6\u0001\u00a6"+ + "\u0001\u00a6\u0001\u00a6\u0001\u00a6\u0001\u00a7\u0001\u00a7\u0001\u00a7"+ + "\u0001\u00a7\u0001\u00a8\u0001\u00a8\u0001\u00a8\u0001\u00a8\u0001\u00a9"+ + "\u0001\u00a9\u0001\u00a9\u0001\u00a9\u0001\u00aa\u0001\u00aa\u0001\u00aa"+ + "\u0001\u00aa\u0001\u00aa\u0001\u00ab\u0001\u00ab\u0001\u00ab\u0001\u00ab"+ + "\u0001\u00ac\u0001\u00ac\u0001\u00ac\u0001\u00ac\u0001\u00ad\u0001\u00ad"+ + "\u0001\u00ad\u0001\u00ad\u0001\u00ae\u0001\u00ae\u0001\u00ae\u0001\u00ae"+ + "\u0001\u00af\u0001\u00af\u0001\u00af\u0001\u00af\u0001\u00b0\u0001\u00b0"+ + "\u0001\u00b0\u0001\u00b0\u0001\u00b0\u0001\u00b0\u0001\u00b1\u0001\u00b1"+ + "\u0001\u00b1\u0001\u00b1\u0001\u00b2\u0001\u00b2\u0001\u00b2\u0001\u00b2"+ + "\u0001\u00b3\u0001\u00b3\u0001\u00b3\u0001\u00b3\u0001\u00b4\u0001\u00b4"+ + "\u0001\u00b4\u0001\u00b4\u0001\u00b5\u0001\u00b5\u0001\u00b5\u0001\u00b5"+ + "\u0001\u00b6\u0001\u00b6\u0001\u00b6\u0001\u00b6\u0001\u00b7\u0001\u00b7"+ + "\u0001\u00b7\u0001\u00b7\u0001\u00b7\u0001\u00b8\u0001\u00b8\u0001\u00b8"+ + "\u0001\u00b8\u0001\u00b8\u0001\u00b8\u0001\u00b9\u0001\u00b9\u0001\u00b9"+ + "\u0001\u00b9\u0001\u00b9\u0001\u00b9\u0001\u00ba\u0001\u00ba\u0001\u00ba"+ + "\u0001\u00ba\u0001\u00bb\u0001\u00bb\u0001\u00bb\u0001\u00bb\u0001\u00bc"+ + "\u0001\u00bc\u0001\u00bc\u0001\u00bc\u0001\u00bd\u0001\u00bd\u0001\u00bd"+ + "\u0001\u00bd\u0001\u00bd\u0001\u00bd\u0001\u00be\u0001\u00be\u0001\u00be"+ + "\u0001\u00be\u0001\u00be\u0001\u00be\u0001\u00bf\u0001\u00bf\u0001\u00bf"+ + "\u0001\u00bf\u0001\u00c0\u0001\u00c0\u0001\u00c0\u0001\u00c0\u0001\u00c1"+ + "\u0001\u00c1\u0001\u00c1\u0001\u00c1\u0001\u00c2\u0001\u00c2\u0001\u00c2"+ + "\u0001\u00c2\u0001\u00c2\u0001\u00c2\u0001\u00c3\u0001\u00c3\u0001\u00c3"+ + "\u0001\u00c3\u0001\u00c3\u0001\u00c3\u0001\u00c4\u0001\u00c4\u0001\u00c4"+ + "\u0001\u00c4\u0001\u00c4\u0001\u00c4\u0001\u00c5\u0001\u00c5\u0001\u00c5"+ + "\u0001\u00c5\u0001\u00c5\u0002\u025f\u02a4\u0000\u00c6\u000f\u0001\u0011"+ + "\u0002\u0013\u0003\u0015\u0004\u0017\u0005\u0019\u0006\u001b\u0007\u001d"+ + "\b\u001f\t!\n#\u000b%\f\'\r)\u000e+\u000f-\u0010/\u00111\u00123\u0013"+ + "5\u00147\u00159\u0016;\u0017=\u0018?\u0000A\u0000C\u0000E\u0000G\u0000"+ + "I\u0000K\u0000M\u0000O\u0000Q\u0000S\u0019U\u001aW\u001bY\u001c[\u001d"+ + "]\u001e_\u001fa c!e\"g#i$k%m&o\'q(s)u*w+y,{-}.\u007f/\u00810\u00831\u0085"+ + "2\u00873\u00894\u008b5\u008d6\u008f7\u00918\u00939\u0095:\u0097;\u0099"+ + "<\u009b=\u009d>\u009f?\u00a1\u0000\u00a3@\u00a5A\u00a7B\u00a9C\u00ab\u0000"+ + "\u00adD\u00afE\u00b1F\u00b3G\u00b5\u0000\u00b7\u0000\u00b9H\u00bbI\u00bd"+ + "J\u00bf\u0000\u00c1\u0000\u00c3\u0000\u00c5\u0000\u00c7\u0000\u00c9\u0000"+ + "\u00cbK\u00cd\u0000\u00cfL\u00d1\u0000\u00d3\u0000\u00d5M\u00d7N\u00d9"+ + "O\u00db\u0000\u00dd\u0000\u00df\u0000\u00e1\u0000\u00e3\u0000\u00e5\u0000"+ + "\u00e7\u0000\u00e9P\u00ebQ\u00edR\u00efS\u00f1\u0000\u00f3\u0000\u00f5"+ + "\u0000\u00f7\u0000\u00f9\u0000\u00fb\u0000\u00fdT\u00ff\u0000\u0101U\u0103"+ + "V\u0105W\u0107\u0000\u0109\u0000\u010bX\u010dY\u010f\u0000\u0111Z\u0113"+ + "\u0000\u0115[\u0117\\\u0119]\u011b\u0000\u011d\u0000\u011f\u0000\u0121"+ + "\u0000\u0123\u0000\u0125\u0000\u0127\u0000\u0129\u0000\u012b\u0000\u012d"+ + "^\u012f_\u0131`\u0133\u0000\u0135\u0000\u0137\u0000\u0139\u0000\u013b"+ + "\u0000\u013d\u0000\u013fa\u0141b\u0143c\u0145\u0000\u0147d\u0149e\u014b"+ + "f\u014dg\u014f\u0000\u0151h\u0153i\u0155j\u0157k\u0159l\u015b\u0000\u015d"+ + "\u0000\u015f\u0000\u0161\u0000\u0163\u0000\u0165\u0000\u0167\u0000\u0169"+ + "m\u016bn\u016do\u016f\u0000\u0171\u0000\u0173\u0000\u0175\u0000\u0177"+ + "p\u0179q\u017br\u017d\u0000\u017f\u0000\u0181\u0000\u0183s\u0185t\u0187"+ + "u\u0189\u0000\u018b\u0000\u018dv\u018fw\u0191x\u0193\u0000\u0195\u0000"+ + "\u0197\u0000\u0199\u0000\u000f\u0000\u0001\u0002\u0003\u0004\u0005\u0006"+ + "\u0007\b\t\n\u000b\f\r\u000e#\u0002\u0000DDdd\u0002\u0000IIii\u0002\u0000"+ + "SSss\u0002\u0000EEee\u0002\u0000CCcc\u0002\u0000TTtt\u0002\u0000RRrr\u0002"+ + "\u0000OOoo\u0002\u0000PPpp\u0002\u0000NNnn\u0002\u0000HHhh\u0002\u0000"+ + "VVvv\u0002\u0000AAaa\u0002\u0000LLll\u0002\u0000XXxx\u0002\u0000FFff\u0002"+ + "\u0000MMmm\u0002\u0000GGgg\u0002\u0000KKkk\u0002\u0000WWww\u0002\u0000"+ + "UUuu\u0006\u0000\t\n\r\r //[[]]\u0002\u0000\n\n\r\r\u0003\u0000\t\n\r"+ + "\r \u0001\u000009\u0002\u0000AZaz\b\u0000\"\"NNRRTT\\\\nnrrtt\u0004\u0000"+ + "\n\n\r\r\"\"\\\\\u0002\u0000++--\u0001\u0000``\u0002\u0000BBbb\u0002\u0000"+ + "YYyy\u000b\u0000\t\n\r\r \"\",,//::==[[]]||\u0002\u0000**//\u000b\u0000"+ + "\t\n\r\r \"#,,//::<<>?\\\\||\u05db\u0000\u000f\u0001\u0000\u0000\u0000"+ + "\u0000\u0011\u0001\u0000\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000"+ + "\u0000\u0015\u0001\u0000\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000"+ + "\u0000\u0019\u0001\u0000\u0000\u0000\u0000\u001b\u0001\u0000\u0000\u0000"+ + "\u0000\u001d\u0001\u0000\u0000\u0000\u0000\u001f\u0001\u0000\u0000\u0000"+ + "\u0000!\u0001\u0000\u0000\u0000\u0000#\u0001\u0000\u0000\u0000\u0000%"+ + "\u0001\u0000\u0000\u0000\u0000\'\u0001\u0000\u0000\u0000\u0000)\u0001"+ + "\u0000\u0000\u0000\u0000+\u0001\u0000\u0000\u0000\u0000-\u0001\u0000\u0000"+ + "\u0000\u0000/\u0001\u0000\u0000\u0000\u00001\u0001\u0000\u0000\u0000\u0000"+ + "3\u0001\u0000\u0000\u0000\u00005\u0001\u0000\u0000\u0000\u00007\u0001"+ + "\u0000\u0000\u0000\u00009\u0001\u0000\u0000\u0000\u0000;\u0001\u0000\u0000"+ + "\u0000\u0001=\u0001\u0000\u0000\u0000\u0001S\u0001\u0000\u0000\u0000\u0001"+ + "U\u0001\u0000\u0000\u0000\u0001W\u0001\u0000\u0000\u0000\u0001Y\u0001"+ + "\u0000\u0000\u0000\u0001[\u0001\u0000\u0000\u0000\u0001]\u0001\u0000\u0000"+ + "\u0000\u0001_\u0001\u0000\u0000\u0000\u0001a\u0001\u0000\u0000\u0000\u0001"+ + "c\u0001\u0000\u0000\u0000\u0001e\u0001\u0000\u0000\u0000\u0001g\u0001"+ + "\u0000\u0000\u0000\u0001i\u0001\u0000\u0000\u0000\u0001k\u0001\u0000\u0000"+ + "\u0000\u0001m\u0001\u0000\u0000\u0000\u0001o\u0001\u0000\u0000\u0000\u0001"+ + "q\u0001\u0000\u0000\u0000\u0001s\u0001\u0000\u0000\u0000\u0001u\u0001"+ + "\u0000\u0000\u0000\u0001w\u0001\u0000\u0000\u0000\u0001y\u0001\u0000\u0000"+ + "\u0000\u0001{\u0001\u0000\u0000\u0000\u0001}\u0001\u0000\u0000\u0000\u0001"+ + "\u007f\u0001\u0000\u0000\u0000\u0001\u0081\u0001\u0000\u0000\u0000\u0001"+ + "\u0083\u0001\u0000\u0000\u0000\u0001\u0085\u0001\u0000\u0000\u0000\u0001"+ + "\u0087\u0001\u0000\u0000\u0000\u0001\u0089\u0001\u0000\u0000\u0000\u0001"+ + "\u008b\u0001\u0000\u0000\u0000\u0001\u008d\u0001\u0000\u0000\u0000\u0001"+ + "\u008f\u0001\u0000\u0000\u0000\u0001\u0091\u0001\u0000\u0000\u0000\u0001"+ + "\u0093\u0001\u0000\u0000\u0000\u0001\u0095\u0001\u0000\u0000\u0000\u0001"+ + "\u0097\u0001\u0000\u0000\u0000\u0001\u0099\u0001\u0000\u0000\u0000\u0001"+ + "\u009b\u0001\u0000\u0000\u0000\u0001\u009d\u0001\u0000\u0000\u0000\u0001"+ + "\u009f\u0001\u0000\u0000\u0000\u0001\u00a1\u0001\u0000\u0000\u0000\u0001"+ + "\u00a3\u0001\u0000\u0000\u0000\u0001\u00a5\u0001\u0000\u0000\u0000\u0001"+ + "\u00a7\u0001\u0000\u0000\u0000\u0001\u00a9\u0001\u0000\u0000\u0000\u0001"+ + "\u00ad\u0001\u0000\u0000\u0000\u0001\u00af\u0001\u0000\u0000\u0000\u0001"+ + "\u00b1\u0001\u0000\u0000\u0000\u0001\u00b3\u0001\u0000\u0000\u0000\u0002"+ + "\u00b5\u0001\u0000\u0000\u0000\u0002\u00b7\u0001\u0000\u0000\u0000\u0002"+ + "\u00b9\u0001\u0000\u0000\u0000\u0002\u00bb\u0001\u0000\u0000\u0000\u0002"+ + "\u00bd\u0001\u0000\u0000\u0000\u0003\u00bf\u0001\u0000\u0000\u0000\u0003"+ + "\u00c1\u0001\u0000\u0000\u0000\u0003\u00c3\u0001\u0000\u0000\u0000\u0003"+ + "\u00c5\u0001\u0000\u0000\u0000\u0003\u00c7\u0001\u0000\u0000\u0000\u0003"+ + "\u00c9\u0001\u0000\u0000\u0000\u0003\u00cb\u0001\u0000\u0000\u0000\u0003"+ + "\u00cf\u0001\u0000\u0000\u0000\u0003\u00d1\u0001\u0000\u0000\u0000\u0003"+ + "\u00d3\u0001\u0000\u0000\u0000\u0003\u00d5\u0001\u0000\u0000\u0000\u0003"+ + "\u00d7\u0001\u0000\u0000\u0000\u0003\u00d9\u0001\u0000\u0000\u0000\u0004"+ + "\u00db\u0001\u0000\u0000\u0000\u0004\u00dd\u0001\u0000\u0000\u0000\u0004"+ + "\u00df\u0001\u0000\u0000\u0000\u0004\u00e1\u0001\u0000\u0000\u0000\u0004"+ + "\u00e3\u0001\u0000\u0000\u0000\u0004\u00e9\u0001\u0000\u0000\u0000\u0004"+ + "\u00eb\u0001\u0000\u0000\u0000\u0004\u00ed\u0001\u0000\u0000\u0000\u0004"+ + "\u00ef\u0001\u0000\u0000\u0000\u0005\u00f1\u0001\u0000\u0000\u0000\u0005"+ + "\u00f3\u0001\u0000\u0000\u0000\u0005\u00f5\u0001\u0000\u0000\u0000\u0005"+ + "\u00f7\u0001\u0000\u0000\u0000\u0005\u00f9\u0001\u0000\u0000\u0000\u0005"+ + "\u00fb\u0001\u0000\u0000\u0000\u0005\u00fd\u0001\u0000\u0000\u0000\u0005"+ + "\u00ff\u0001\u0000\u0000\u0000\u0005\u0101\u0001\u0000\u0000\u0000\u0005"+ + "\u0103\u0001\u0000\u0000\u0000\u0005\u0105\u0001\u0000\u0000\u0000\u0006"+ + "\u0107\u0001\u0000\u0000\u0000\u0006\u0109\u0001\u0000\u0000\u0000\u0006"+ + "\u010b\u0001\u0000\u0000\u0000\u0006\u010d\u0001\u0000\u0000\u0000\u0006"+ + "\u0111\u0001\u0000\u0000\u0000\u0006\u0113\u0001\u0000\u0000\u0000\u0006"+ + "\u0115\u0001\u0000\u0000\u0000\u0006\u0117\u0001\u0000\u0000\u0000\u0006"+ + "\u0119\u0001\u0000\u0000\u0000\u0007\u011b\u0001\u0000\u0000\u0000\u0007"+ + "\u011d\u0001\u0000\u0000\u0000\u0007\u011f\u0001\u0000\u0000\u0000\u0007"+ + "\u0121\u0001\u0000\u0000\u0000\u0007\u0123\u0001\u0000\u0000\u0000\u0007"+ + "\u0125\u0001\u0000\u0000\u0000\u0007\u0127\u0001\u0000\u0000\u0000\u0007"+ + "\u0129\u0001\u0000\u0000\u0000\u0007\u012b\u0001\u0000\u0000\u0000\u0007"+ + "\u012d\u0001\u0000\u0000\u0000\u0007\u012f\u0001\u0000\u0000\u0000\u0007"+ + "\u0131\u0001\u0000\u0000\u0000\b\u0133\u0001\u0000\u0000\u0000\b\u0135"+ + "\u0001\u0000\u0000\u0000\b\u0137\u0001\u0000\u0000\u0000\b\u0139\u0001"+ + "\u0000\u0000\u0000\b\u013b\u0001\u0000\u0000\u0000\b\u013d\u0001\u0000"+ + "\u0000\u0000\b\u013f\u0001\u0000\u0000\u0000\b\u0141\u0001\u0000\u0000"+ + "\u0000\b\u0143\u0001\u0000\u0000\u0000\t\u0145\u0001\u0000\u0000\u0000"+ + "\t\u0147\u0001\u0000\u0000\u0000\t\u0149\u0001\u0000\u0000\u0000\t\u014b"+ + "\u0001\u0000\u0000\u0000\t\u014d\u0001\u0000\u0000\u0000\n\u014f\u0001"+ + "\u0000\u0000\u0000\n\u0151\u0001\u0000\u0000\u0000\n\u0153\u0001\u0000"+ + "\u0000\u0000\n\u0155\u0001\u0000\u0000\u0000\n\u0157\u0001\u0000\u0000"+ + "\u0000\n\u0159\u0001\u0000\u0000\u0000\u000b\u015b\u0001\u0000\u0000\u0000"+ + "\u000b\u015d\u0001\u0000\u0000\u0000\u000b\u015f\u0001\u0000\u0000\u0000"+ + "\u000b\u0161\u0001\u0000\u0000\u0000\u000b\u0163\u0001\u0000\u0000\u0000"+ + "\u000b\u0165\u0001\u0000\u0000\u0000\u000b\u0167\u0001\u0000\u0000\u0000"+ + "\u000b\u0169\u0001\u0000\u0000\u0000\u000b\u016b\u0001\u0000\u0000\u0000"+ + "\u000b\u016d\u0001\u0000\u0000\u0000\f\u016f\u0001\u0000\u0000\u0000\f"+ + "\u0171\u0001\u0000\u0000\u0000\f\u0173\u0001\u0000\u0000\u0000\f\u0175"+ + "\u0001\u0000\u0000\u0000\f\u0177\u0001\u0000\u0000\u0000\f\u0179\u0001"+ + "\u0000\u0000\u0000\f\u017b\u0001\u0000\u0000\u0000\r\u017d\u0001\u0000"+ + "\u0000\u0000\r\u017f\u0001\u0000\u0000\u0000\r\u0181\u0001\u0000\u0000"+ + "\u0000\r\u0183\u0001\u0000\u0000\u0000\r\u0185\u0001\u0000\u0000\u0000"+ + "\r\u0187\u0001\u0000\u0000\u0000\u000e\u0189\u0001\u0000\u0000\u0000\u000e"+ + "\u018b\u0001\u0000\u0000\u0000\u000e\u018d\u0001\u0000\u0000\u0000\u000e"+ + "\u018f\u0001\u0000\u0000\u0000\u000e\u0191\u0001\u0000\u0000\u0000\u000e"+ + "\u0193\u0001\u0000\u0000\u0000\u000e\u0195\u0001\u0000\u0000\u0000\u000e"+ + "\u0197\u0001\u0000\u0000\u0000\u000e\u0199\u0001\u0000\u0000\u0000\u000f"+ + "\u019b\u0001\u0000\u0000\u0000\u0011\u01a5\u0001\u0000\u0000\u0000\u0013"+ + "\u01ac\u0001\u0000\u0000\u0000\u0015\u01b5\u0001\u0000\u0000\u0000\u0017"+ + "\u01bc\u0001\u0000\u0000\u0000\u0019\u01c6\u0001\u0000\u0000\u0000\u001b"+ + "\u01cd\u0001\u0000\u0000\u0000\u001d\u01d4\u0001\u0000\u0000\u0000\u001f"+ + "\u01db\u0001\u0000\u0000\u0000!\u01e3\u0001\u0000\u0000\u0000#\u01ef\u0001"+ + "\u0000\u0000\u0000%\u01f8\u0001\u0000\u0000\u0000\'\u01fe\u0001\u0000"+ + "\u0000\u0000)\u0205\u0001\u0000\u0000\u0000+\u020c\u0001\u0000\u0000\u0000"+ + "-\u0214\u0001\u0000\u0000\u0000/\u021c\u0001\u0000\u0000\u00001\u022b"+ + "\u0001\u0000\u0000\u00003\u0235\u0001\u0000\u0000\u00005\u0241\u0001\u0000"+ + "\u0000\u00007\u0247\u0001\u0000\u0000\u00009\u0258\u0001\u0000\u0000\u0000"+ + ";\u0268\u0001\u0000\u0000\u0000=\u026e\u0001\u0000\u0000\u0000?\u0272"+ + "\u0001\u0000\u0000\u0000A\u0274\u0001\u0000\u0000\u0000C\u0276\u0001\u0000"+ + "\u0000\u0000E\u0279\u0001\u0000\u0000\u0000G\u027b\u0001\u0000\u0000\u0000"+ + "I\u0284\u0001\u0000\u0000\u0000K\u0286\u0001\u0000\u0000\u0000M\u028b"+ + "\u0001\u0000\u0000\u0000O\u028d\u0001\u0000\u0000\u0000Q\u0292\u0001\u0000"+ + "\u0000\u0000S\u02b1\u0001\u0000\u0000\u0000U\u02b4\u0001\u0000\u0000\u0000"+ + "W\u02e2\u0001\u0000\u0000\u0000Y\u02e4\u0001\u0000\u0000\u0000[\u02e7"+ + "\u0001\u0000\u0000\u0000]\u02eb\u0001\u0000\u0000\u0000_\u02ef\u0001\u0000"+ + "\u0000\u0000a\u02f1\u0001\u0000\u0000\u0000c\u02f4\u0001\u0000\u0000\u0000"+ + "e\u02f6\u0001\u0000\u0000\u0000g\u02fb\u0001\u0000\u0000\u0000i\u02fd"+ + "\u0001\u0000\u0000\u0000k\u0303\u0001\u0000\u0000\u0000m\u0309\u0001\u0000"+ + "\u0000\u0000o\u030c\u0001\u0000\u0000\u0000q\u030f\u0001\u0000\u0000\u0000"+ + "s\u0314\u0001\u0000\u0000\u0000u\u0319\u0001\u0000\u0000\u0000w\u031b"+ + "\u0001\u0000\u0000\u0000y\u031f\u0001\u0000\u0000\u0000{\u0324\u0001\u0000"+ + "\u0000\u0000}\u032a\u0001\u0000\u0000\u0000\u007f\u032d\u0001\u0000\u0000"+ + "\u0000\u0081\u032f\u0001\u0000\u0000\u0000\u0083\u0335\u0001\u0000\u0000"+ + "\u0000\u0085\u0337\u0001\u0000\u0000\u0000\u0087\u033c\u0001\u0000\u0000"+ + "\u0000\u0089\u033f\u0001\u0000\u0000\u0000\u008b\u0342\u0001\u0000\u0000"+ + "\u0000\u008d\u0345\u0001\u0000\u0000\u0000\u008f\u0347\u0001\u0000\u0000"+ + "\u0000\u0091\u034a\u0001\u0000\u0000\u0000\u0093\u034c\u0001\u0000\u0000"+ + "\u0000\u0095\u034f\u0001\u0000\u0000\u0000\u0097\u0351\u0001\u0000\u0000"+ + "\u0000\u0099\u0353\u0001\u0000\u0000\u0000\u009b\u0355\u0001\u0000\u0000"+ + "\u0000\u009d\u0357\u0001\u0000\u0000\u0000\u009f\u0359\u0001\u0000\u0000"+ + "\u0000\u00a1\u035f\u0001\u0000\u0000\u0000\u00a3\u0374\u0001\u0000\u0000"+ + "\u0000\u00a5\u0376\u0001\u0000\u0000\u0000\u00a7\u037b\u0001\u0000\u0000"+ + "\u0000\u00a9\u0390\u0001\u0000\u0000\u0000\u00ab\u0392\u0001\u0000\u0000"+ + "\u0000\u00ad\u039a\u0001\u0000\u0000\u0000\u00af\u039c\u0001\u0000\u0000"+ + "\u0000\u00b1\u03a0\u0001\u0000\u0000\u0000\u00b3\u03a4\u0001\u0000\u0000"+ + "\u0000\u00b5\u03a8\u0001\u0000\u0000\u0000\u00b7\u03ad\u0001\u0000\u0000"+ + "\u0000\u00b9\u03b2\u0001\u0000\u0000\u0000\u00bb\u03b6\u0001\u0000\u0000"+ + "\u0000\u00bd\u03ba\u0001\u0000\u0000\u0000\u00bf\u03be\u0001\u0000\u0000"+ + "\u0000\u00c1\u03c3\u0001\u0000\u0000\u0000\u00c3\u03c7\u0001\u0000\u0000"+ + "\u0000\u00c5\u03cb\u0001\u0000\u0000\u0000\u00c7\u03cf\u0001\u0000\u0000"+ + "\u0000\u00c9\u03d3\u0001\u0000\u0000\u0000\u00cb\u03d7\u0001\u0000\u0000"+ + "\u0000\u00cd\u03e3\u0001\u0000\u0000\u0000\u00cf\u03e6\u0001\u0000\u0000"+ + "\u0000\u00d1\u03ea\u0001\u0000\u0000\u0000\u00d3\u03ee\u0001\u0000\u0000"+ + "\u0000\u00d5\u03f2\u0001\u0000\u0000\u0000\u00d7\u03f6\u0001\u0000\u0000"+ + "\u0000\u00d9\u03fa\u0001\u0000\u0000\u0000\u00db\u03fe\u0001\u0000\u0000"+ + "\u0000\u00dd\u0403\u0001\u0000\u0000\u0000\u00df\u0407\u0001\u0000\u0000"+ + "\u0000\u00e1\u040b\u0001\u0000\u0000\u0000\u00e3\u040f\u0001\u0000\u0000"+ + "\u0000\u00e5\u0417\u0001\u0000\u0000\u0000\u00e7\u042c\u0001\u0000\u0000"+ + "\u0000\u00e9\u0430\u0001\u0000\u0000\u0000\u00eb\u0434\u0001\u0000\u0000"+ + "\u0000\u00ed\u0438\u0001\u0000\u0000\u0000\u00ef\u043c\u0001\u0000\u0000"+ + "\u0000\u00f1\u0440\u0001\u0000\u0000\u0000\u00f3\u0445\u0001\u0000\u0000"+ + "\u0000\u00f5\u0449\u0001\u0000\u0000\u0000\u00f7\u044d\u0001\u0000\u0000"+ + "\u0000\u00f9\u0451\u0001\u0000\u0000\u0000\u00fb\u0455\u0001\u0000\u0000"+ + "\u0000\u00fd\u0459\u0001\u0000\u0000\u0000\u00ff\u045c\u0001\u0000\u0000"+ + "\u0000\u0101\u0460\u0001\u0000\u0000\u0000\u0103\u0464\u0001\u0000\u0000"+ + "\u0000\u0105\u0468\u0001\u0000\u0000\u0000\u0107\u046c\u0001\u0000\u0000"+ + "\u0000\u0109\u0471\u0001\u0000\u0000\u0000\u010b\u0476\u0001\u0000\u0000"+ + "\u0000\u010d\u047b\u0001\u0000\u0000\u0000\u010f\u0482\u0001\u0000\u0000"+ + "\u0000\u0111\u048b\u0001\u0000\u0000\u0000\u0113\u0492\u0001\u0000\u0000"+ + "\u0000\u0115\u0496\u0001\u0000\u0000\u0000\u0117\u049a\u0001\u0000\u0000"+ + "\u0000\u0119\u049e\u0001\u0000\u0000\u0000\u011b\u04a2\u0001\u0000\u0000"+ + "\u0000\u011d\u04a8\u0001\u0000\u0000\u0000\u011f\u04ac\u0001\u0000\u0000"+ + "\u0000\u0121\u04b0\u0001\u0000\u0000\u0000\u0123\u04b4\u0001\u0000\u0000"+ + "\u0000\u0125\u04b8\u0001\u0000\u0000\u0000\u0127\u04bc\u0001\u0000\u0000"+ + "\u0000\u0129\u04c0\u0001\u0000\u0000\u0000\u012b\u04c4\u0001\u0000\u0000"+ + "\u0000\u012d\u04c8\u0001\u0000\u0000\u0000\u012f\u04cc\u0001\u0000\u0000"+ + "\u0000\u0131\u04d0\u0001\u0000\u0000\u0000\u0133\u04d4\u0001\u0000\u0000"+ + "\u0000\u0135\u04d9\u0001\u0000\u0000\u0000\u0137\u04dd\u0001\u0000\u0000"+ + "\u0000\u0139\u04e1\u0001\u0000\u0000\u0000\u013b\u04e5\u0001\u0000\u0000"+ + "\u0000\u013d\u04e9\u0001\u0000\u0000\u0000\u013f\u04ed\u0001\u0000\u0000"+ + "\u0000\u0141\u04f1\u0001\u0000\u0000\u0000\u0143\u04f5\u0001\u0000\u0000"+ + "\u0000\u0145\u04f9\u0001\u0000\u0000\u0000\u0147\u04fe\u0001\u0000\u0000"+ + "\u0000\u0149\u0503\u0001\u0000\u0000\u0000\u014b\u0507\u0001\u0000\u0000"+ + "\u0000\u014d\u050b\u0001\u0000\u0000\u0000\u014f\u050f\u0001\u0000\u0000"+ + "\u0000\u0151\u0514\u0001\u0000\u0000\u0000\u0153\u051b\u0001\u0000\u0000"+ + "\u0000\u0155\u051f\u0001\u0000\u0000\u0000\u0157\u0523\u0001\u0000\u0000"+ + "\u0000\u0159\u0527\u0001\u0000\u0000\u0000\u015b\u052b\u0001\u0000\u0000"+ + "\u0000\u015d\u0530\u0001\u0000\u0000\u0000\u015f\u0534\u0001\u0000\u0000"+ + "\u0000\u0161\u0538\u0001\u0000\u0000\u0000\u0163\u053c\u0001\u0000\u0000"+ + "\u0000\u0165\u0541\u0001\u0000\u0000\u0000\u0167\u0545\u0001\u0000\u0000"+ + "\u0000\u0169\u0549\u0001\u0000\u0000\u0000\u016b\u054d\u0001\u0000\u0000"+ + "\u0000\u016d\u0551\u0001\u0000\u0000\u0000\u016f\u0555\u0001\u0000\u0000"+ + "\u0000\u0171\u055b\u0001\u0000\u0000\u0000\u0173\u055f\u0001\u0000\u0000"+ + "\u0000\u0175\u0563\u0001\u0000\u0000\u0000\u0177\u0567\u0001\u0000\u0000"+ + "\u0000\u0179\u056b\u0001\u0000\u0000\u0000\u017b\u056f\u0001\u0000\u0000"+ + "\u0000\u017d\u0573\u0001\u0000\u0000\u0000\u017f\u0578\u0001\u0000\u0000"+ + "\u0000\u0181\u057e\u0001\u0000\u0000\u0000\u0183\u0584\u0001\u0000\u0000"+ + "\u0000\u0185\u0588\u0001\u0000\u0000\u0000\u0187\u058c\u0001\u0000\u0000"+ + "\u0000\u0189\u0590\u0001\u0000\u0000\u0000\u018b\u0596\u0001\u0000\u0000"+ + "\u0000\u018d\u059c\u0001\u0000\u0000\u0000\u018f\u05a0\u0001\u0000\u0000"+ + "\u0000\u0191\u05a4\u0001\u0000\u0000\u0000\u0193\u05a8\u0001\u0000\u0000"+ + "\u0000\u0195\u05ae\u0001\u0000\u0000\u0000\u0197\u05b4\u0001\u0000\u0000"+ + "\u0000\u0199\u05ba\u0001\u0000\u0000\u0000\u019b\u019c\u0007\u0000\u0000"+ + "\u0000\u019c\u019d\u0007\u0001\u0000\u0000\u019d\u019e\u0007\u0002\u0000"+ + "\u0000\u019e\u019f\u0007\u0002\u0000\u0000\u019f\u01a0\u0007\u0003\u0000"+ + "\u0000\u01a0\u01a1\u0007\u0004\u0000\u0000\u01a1\u01a2\u0007\u0005\u0000"+ + "\u0000\u01a2\u01a3\u0001\u0000\u0000\u0000\u01a3\u01a4\u0006\u0000\u0000"+ + "\u0000\u01a4\u0010\u0001\u0000\u0000\u0000\u01a5\u01a6\u0007\u0000\u0000"+ + "\u0000\u01a6\u01a7\u0007\u0006\u0000\u0000\u01a7\u01a8\u0007\u0007\u0000"+ + "\u0000\u01a8\u01a9\u0007\b\u0000\u0000\u01a9\u01aa\u0001\u0000\u0000\u0000"+ + "\u01aa\u01ab\u0006\u0001\u0001\u0000\u01ab\u0012\u0001\u0000\u0000\u0000"+ + "\u01ac\u01ad\u0007\u0003\u0000\u0000\u01ad\u01ae\u0007\t\u0000\u0000\u01ae"+ + "\u01af\u0007\u0006\u0000\u0000\u01af\u01b0\u0007\u0001\u0000\u0000\u01b0"+ + "\u01b1\u0007\u0004\u0000\u0000\u01b1\u01b2\u0007\n\u0000\u0000\u01b2\u01b3"+ + "\u0001\u0000\u0000\u0000\u01b3\u01b4\u0006\u0002\u0002\u0000\u01b4\u0014"+ + "\u0001\u0000\u0000\u0000\u01b5\u01b6\u0007\u0003\u0000\u0000\u01b6\u01b7"+ + "\u0007\u000b\u0000\u0000\u01b7\u01b8\u0007\f\u0000\u0000\u01b8\u01b9\u0007"+ + "\r\u0000\u0000\u01b9\u01ba\u0001\u0000\u0000\u0000\u01ba\u01bb\u0006\u0003"+ + "\u0000\u0000\u01bb\u0016\u0001\u0000\u0000\u0000\u01bc\u01bd\u0007\u0003"+ + "\u0000\u0000\u01bd\u01be\u0007\u000e\u0000\u0000\u01be\u01bf\u0007\b\u0000"+ + "\u0000\u01bf\u01c0\u0007\r\u0000\u0000\u01c0\u01c1\u0007\f\u0000\u0000"+ + "\u01c1\u01c2\u0007\u0001\u0000\u0000\u01c2\u01c3\u0007\t\u0000\u0000\u01c3"+ + "\u01c4\u0001\u0000\u0000\u0000\u01c4\u01c5\u0006\u0004\u0003\u0000\u01c5"+ + "\u0018\u0001\u0000\u0000\u0000\u01c6\u01c7\u0007\u000f\u0000\u0000\u01c7"+ + "\u01c8\u0007\u0006\u0000\u0000\u01c8\u01c9\u0007\u0007\u0000\u0000\u01c9"+ + "\u01ca\u0007\u0010\u0000\u0000\u01ca\u01cb\u0001\u0000\u0000\u0000\u01cb"+ + "\u01cc\u0006\u0005\u0004\u0000\u01cc\u001a\u0001\u0000\u0000\u0000\u01cd"+ + "\u01ce\u0007\u0011\u0000\u0000\u01ce\u01cf\u0007\u0006\u0000\u0000\u01cf"+ + "\u01d0\u0007\u0007\u0000\u0000\u01d0\u01d1\u0007\u0012\u0000\u0000\u01d1"+ + "\u01d2\u0001\u0000\u0000\u0000\u01d2\u01d3\u0006\u0006\u0000\u0000\u01d3"+ + "\u001c\u0001\u0000\u0000\u0000\u01d4\u01d5\u0007\u0012\u0000\u0000\u01d5"+ + "\u01d6\u0007\u0003\u0000\u0000\u01d6\u01d7\u0007\u0003\u0000\u0000\u01d7"+ + "\u01d8\u0007\b\u0000\u0000\u01d8\u01d9\u0001\u0000\u0000\u0000\u01d9\u01da"+ + "\u0006\u0007\u0001\u0000\u01da\u001e\u0001\u0000\u0000\u0000\u01db\u01dc"+ + "\u0007\r\u0000\u0000\u01dc\u01dd\u0007\u0001\u0000\u0000\u01dd\u01de\u0007"+ + "\u0010\u0000\u0000\u01de\u01df\u0007\u0001\u0000\u0000\u01df\u01e0\u0007"+ + "\u0005\u0000\u0000\u01e0\u01e1\u0001\u0000\u0000\u0000\u01e1\u01e2\u0006"+ + "\b\u0000\u0000\u01e2 \u0001\u0000\u0000\u0000\u01e3\u01e4\u0007\u0010"+ + "\u0000\u0000\u01e4\u01e5\u0007\u000b\u0000\u0000\u01e5\u01e6\u0005_\u0000"+ + "\u0000\u01e6\u01e7\u0007\u0003\u0000\u0000\u01e7\u01e8\u0007\u000e\u0000"+ + "\u0000\u01e8\u01e9\u0007\b\u0000\u0000\u01e9\u01ea\u0007\f\u0000\u0000"+ + "\u01ea\u01eb\u0007\t\u0000\u0000\u01eb\u01ec\u0007\u0000\u0000\u0000\u01ec"+ + "\u01ed\u0001\u0000\u0000\u0000\u01ed\u01ee\u0006\t\u0005\u0000\u01ee\""+ + "\u0001\u0000\u0000\u0000\u01ef\u01f0\u0007\u0006\u0000\u0000\u01f0\u01f1"+ + "\u0007\u0003\u0000\u0000\u01f1\u01f2\u0007\t\u0000\u0000\u01f2\u01f3\u0007"+ + "\f\u0000\u0000\u01f3\u01f4\u0007\u0010\u0000\u0000\u01f4\u01f5\u0007\u0003"+ + "\u0000\u0000\u01f5\u01f6\u0001\u0000\u0000\u0000\u01f6\u01f7\u0006\n\u0006"+ + "\u0000\u01f7$\u0001\u0000\u0000\u0000\u01f8\u01f9\u0007\u0006\u0000\u0000"+ + "\u01f9\u01fa\u0007\u0007\u0000\u0000\u01fa\u01fb\u0007\u0013\u0000\u0000"+ + "\u01fb\u01fc\u0001\u0000\u0000\u0000\u01fc\u01fd\u0006\u000b\u0000\u0000"+ + "\u01fd&\u0001\u0000\u0000\u0000\u01fe\u01ff\u0007\u0002\u0000\u0000\u01ff"+ + "\u0200\u0007\n\u0000\u0000\u0200\u0201\u0007\u0007\u0000\u0000\u0201\u0202"+ + "\u0007\u0013\u0000\u0000\u0202\u0203\u0001\u0000\u0000\u0000\u0203\u0204"+ + "\u0006\f\u0007\u0000\u0204(\u0001\u0000\u0000\u0000\u0205\u0206\u0007"+ + "\u0002\u0000\u0000\u0206\u0207\u0007\u0007\u0000\u0000\u0207\u0208\u0007"+ + "\u0006\u0000\u0000\u0208\u0209\u0007\u0005\u0000\u0000\u0209\u020a\u0001"+ + "\u0000\u0000\u0000\u020a\u020b\u0006\r\u0000\u0000\u020b*\u0001\u0000"+ + "\u0000\u0000\u020c\u020d\u0007\u0002\u0000\u0000\u020d\u020e\u0007\u0005"+ + "\u0000\u0000\u020e\u020f\u0007\f\u0000\u0000\u020f\u0210\u0007\u0005\u0000"+ + "\u0000\u0210\u0211\u0007\u0002\u0000\u0000\u0211\u0212\u0001\u0000\u0000"+ + "\u0000\u0212\u0213\u0006\u000e\u0000\u0000\u0213,\u0001\u0000\u0000\u0000"+ + "\u0214\u0215\u0007\u0013\u0000\u0000\u0215\u0216\u0007\n\u0000\u0000\u0216"+ + "\u0217\u0007\u0003\u0000\u0000\u0217\u0218\u0007\u0006\u0000\u0000\u0218"+ + "\u0219\u0007\u0003\u0000\u0000\u0219\u021a\u0001\u0000\u0000\u0000\u021a"+ + "\u021b\u0006\u000f\u0000\u0000\u021b.\u0001\u0000\u0000\u0000\u021c\u021d"+ + "\u0004\u0010\u0000\u0000\u021d\u021e\u0007\u0001\u0000\u0000\u021e\u021f"+ + "\u0007\t\u0000\u0000\u021f\u0220\u0007\r\u0000\u0000\u0220\u0221\u0007"+ + "\u0001\u0000\u0000\u0221\u0222\u0007\t\u0000\u0000\u0222\u0223\u0007\u0003"+ + "\u0000\u0000\u0223\u0224\u0007\u0002\u0000\u0000\u0224\u0225\u0007\u0005"+ + "\u0000\u0000\u0225\u0226\u0007\f\u0000\u0000\u0226\u0227\u0007\u0005\u0000"+ + "\u0000\u0227\u0228\u0007\u0002\u0000\u0000\u0228\u0229\u0001\u0000\u0000"+ + "\u0000\u0229\u022a\u0006\u0010\u0000\u0000\u022a0\u0001\u0000\u0000\u0000"+ + "\u022b\u022c\u0004\u0011\u0001\u0000\u022c\u022d\u0007\r\u0000\u0000\u022d"+ + "\u022e\u0007\u0007\u0000\u0000\u022e\u022f\u0007\u0007\u0000\u0000\u022f"+ + "\u0230\u0007\u0012\u0000\u0000\u0230\u0231\u0007\u0014\u0000\u0000\u0231"+ + "\u0232\u0007\b\u0000\u0000\u0232\u0233\u0001\u0000\u0000\u0000\u0233\u0234"+ + "\u0006\u0011\b\u0000\u02342\u0001\u0000\u0000\u0000\u0235\u0236\u0004"+ + "\u0012\u0002\u0000\u0236\u0237\u0007\u0010\u0000\u0000\u0237\u0238\u0007"+ + "\u0003\u0000\u0000\u0238\u0239\u0007\u0005\u0000\u0000\u0239\u023a\u0007"+ + "\u0006\u0000\u0000\u023a\u023b\u0007\u0001\u0000\u0000\u023b\u023c\u0007"+ + "\u0004\u0000\u0000\u023c\u023d\u0007\u0002\u0000\u0000\u023d\u023e\u0001"+ + "\u0000\u0000\u0000\u023e\u023f\u0006\u0012\t\u0000\u023f4\u0001\u0000"+ + "\u0000\u0000\u0240\u0242\b\u0015\u0000\u0000\u0241\u0240\u0001\u0000\u0000"+ + "\u0000\u0242\u0243\u0001\u0000\u0000\u0000\u0243\u0241\u0001\u0000\u0000"+ + "\u0000\u0243\u0244\u0001\u0000\u0000\u0000\u0244\u0245\u0001\u0000\u0000"+ + "\u0000\u0245\u0246\u0006\u0013\u0000\u0000\u02466\u0001\u0000\u0000\u0000"+ + "\u0247\u0248\u0005/\u0000\u0000\u0248\u0249\u0005/\u0000\u0000\u0249\u024d"+ + "\u0001\u0000\u0000\u0000\u024a\u024c\b\u0016\u0000\u0000\u024b\u024a\u0001"+ + "\u0000\u0000\u0000\u024c\u024f\u0001\u0000\u0000\u0000\u024d\u024b\u0001"+ + "\u0000\u0000\u0000\u024d\u024e\u0001\u0000\u0000\u0000\u024e\u0251\u0001"+ + "\u0000\u0000\u0000\u024f\u024d\u0001\u0000\u0000\u0000\u0250\u0252\u0005"+ + "\r\u0000\u0000\u0251\u0250\u0001\u0000\u0000\u0000\u0251\u0252\u0001\u0000"+ + "\u0000\u0000\u0252\u0254\u0001\u0000\u0000\u0000\u0253\u0255\u0005\n\u0000"+ + "\u0000\u0254\u0253\u0001\u0000\u0000\u0000\u0254\u0255\u0001\u0000\u0000"+ + "\u0000\u0255\u0256\u0001\u0000\u0000\u0000\u0256\u0257\u0006\u0014\n\u0000"+ + "\u02578\u0001\u0000\u0000\u0000\u0258\u0259\u0005/\u0000\u0000\u0259\u025a"+ + "\u0005*\u0000\u0000\u025a\u025f\u0001\u0000\u0000\u0000\u025b\u025e\u0003"+ + "9\u0015\u0000\u025c\u025e\t\u0000\u0000\u0000\u025d\u025b\u0001\u0000"+ + "\u0000\u0000\u025d\u025c\u0001\u0000\u0000\u0000\u025e\u0261\u0001\u0000"+ + "\u0000\u0000\u025f\u0260\u0001\u0000\u0000\u0000\u025f\u025d\u0001\u0000"+ + "\u0000\u0000\u0260\u0262\u0001\u0000\u0000\u0000\u0261\u025f\u0001\u0000"+ + "\u0000\u0000\u0262\u0263\u0005*\u0000\u0000\u0263\u0264\u0005/\u0000\u0000"+ + "\u0264\u0265\u0001\u0000\u0000\u0000\u0265\u0266\u0006\u0015\n\u0000\u0266"+ + ":\u0001\u0000\u0000\u0000\u0267\u0269\u0007\u0017\u0000\u0000\u0268\u0267"+ + "\u0001\u0000\u0000\u0000\u0269\u026a\u0001\u0000\u0000\u0000\u026a\u0268"+ + "\u0001\u0000\u0000\u0000\u026a\u026b\u0001\u0000\u0000\u0000\u026b\u026c"+ + "\u0001\u0000\u0000\u0000\u026c\u026d\u0006\u0016\n\u0000\u026d<\u0001"+ + "\u0000\u0000\u0000\u026e\u026f\u0005|\u0000\u0000\u026f\u0270\u0001\u0000"+ + "\u0000\u0000\u0270\u0271\u0006\u0017\u000b\u0000\u0271>\u0001\u0000\u0000"+ + "\u0000\u0272\u0273\u0007\u0018\u0000\u0000\u0273@\u0001\u0000\u0000\u0000"+ + "\u0274\u0275\u0007\u0019\u0000\u0000\u0275B\u0001\u0000\u0000\u0000\u0276"+ + "\u0277\u0005\\\u0000\u0000\u0277\u0278\u0007\u001a\u0000\u0000\u0278D"+ + "\u0001\u0000\u0000\u0000\u0279\u027a\b\u001b\u0000\u0000\u027aF\u0001"+ + "\u0000\u0000\u0000\u027b\u027d\u0007\u0003\u0000\u0000\u027c\u027e\u0007"+ + "\u001c\u0000\u0000\u027d\u027c\u0001\u0000\u0000\u0000\u027d\u027e\u0001"+ + "\u0000\u0000\u0000\u027e\u0280\u0001\u0000\u0000\u0000\u027f\u0281\u0003"+ + "?\u0018\u0000\u0280\u027f\u0001\u0000\u0000\u0000\u0281\u0282\u0001\u0000"+ + "\u0000\u0000\u0282\u0280\u0001\u0000\u0000\u0000\u0282\u0283\u0001\u0000"+ + "\u0000\u0000\u0283H\u0001\u0000\u0000\u0000\u0284\u0285\u0005@\u0000\u0000"+ + "\u0285J\u0001\u0000\u0000\u0000\u0286\u0287\u0005`\u0000\u0000\u0287L"+ + "\u0001\u0000\u0000\u0000\u0288\u028c\b\u001d\u0000\u0000\u0289\u028a\u0005"+ + "`\u0000\u0000\u028a\u028c\u0005`\u0000\u0000\u028b\u0288\u0001\u0000\u0000"+ + "\u0000\u028b\u0289\u0001\u0000\u0000\u0000\u028cN\u0001\u0000\u0000\u0000"+ + "\u028d\u028e\u0005_\u0000\u0000\u028eP\u0001\u0000\u0000\u0000\u028f\u0293"+ + "\u0003A\u0019\u0000\u0290\u0293\u0003?\u0018\u0000\u0291\u0293\u0003O"+ + " \u0000\u0292\u028f\u0001\u0000\u0000\u0000\u0292\u0290\u0001\u0000\u0000"+ + "\u0000\u0292\u0291\u0001\u0000\u0000\u0000\u0293R\u0001\u0000\u0000\u0000"+ + "\u0294\u0299\u0005\"\u0000\u0000\u0295\u0298\u0003C\u001a\u0000\u0296"+ + "\u0298\u0003E\u001b\u0000\u0297\u0295\u0001\u0000\u0000\u0000\u0297\u0296"+ + "\u0001\u0000\u0000\u0000\u0298\u029b\u0001\u0000\u0000\u0000\u0299\u0297"+ + "\u0001\u0000\u0000\u0000\u0299\u029a\u0001\u0000\u0000\u0000\u029a\u029c"+ + "\u0001\u0000\u0000\u0000\u029b\u0299\u0001\u0000\u0000\u0000\u029c\u02b2"+ + "\u0005\"\u0000\u0000\u029d\u029e\u0005\"\u0000\u0000\u029e\u029f\u0005"+ + "\"\u0000\u0000\u029f\u02a0\u0005\"\u0000\u0000\u02a0\u02a4\u0001\u0000"+ + "\u0000\u0000\u02a1\u02a3\b\u0016\u0000\u0000\u02a2\u02a1\u0001\u0000\u0000"+ + "\u0000\u02a3\u02a6\u0001\u0000\u0000\u0000\u02a4\u02a5\u0001\u0000\u0000"+ + "\u0000\u02a4\u02a2\u0001\u0000\u0000\u0000\u02a5\u02a7\u0001\u0000\u0000"+ + "\u0000\u02a6\u02a4\u0001\u0000\u0000\u0000\u02a7\u02a8\u0005\"\u0000\u0000"+ + "\u02a8\u02a9\u0005\"\u0000\u0000\u02a9\u02aa\u0005\"\u0000\u0000\u02aa"+ + "\u02ac\u0001\u0000\u0000\u0000\u02ab\u02ad\u0005\"\u0000\u0000\u02ac\u02ab"+ + "\u0001\u0000\u0000\u0000\u02ac\u02ad\u0001\u0000\u0000\u0000\u02ad\u02af"+ + "\u0001\u0000\u0000\u0000\u02ae\u02b0\u0005\"\u0000\u0000\u02af\u02ae\u0001"+ + "\u0000\u0000\u0000\u02af\u02b0\u0001\u0000\u0000\u0000\u02b0\u02b2\u0001"+ + "\u0000\u0000\u0000\u02b1\u0294\u0001\u0000\u0000\u0000\u02b1\u029d\u0001"+ + "\u0000\u0000\u0000\u02b2T\u0001\u0000\u0000\u0000\u02b3\u02b5\u0003?\u0018"+ + "\u0000\u02b4\u02b3\u0001\u0000\u0000\u0000\u02b5\u02b6\u0001\u0000\u0000"+ + "\u0000\u02b6\u02b4\u0001\u0000\u0000\u0000\u02b6\u02b7\u0001\u0000\u0000"+ + "\u0000\u02b7V\u0001\u0000\u0000\u0000\u02b8\u02ba\u0003?\u0018\u0000\u02b9"+ + "\u02b8\u0001\u0000\u0000\u0000\u02ba\u02bb\u0001\u0000\u0000\u0000\u02bb"+ + "\u02b9\u0001\u0000\u0000\u0000\u02bb\u02bc\u0001\u0000\u0000\u0000\u02bc"+ + "\u02bd\u0001\u0000\u0000\u0000\u02bd\u02c1\u0003g,\u0000\u02be\u02c0\u0003"+ + "?\u0018\u0000\u02bf\u02be\u0001\u0000\u0000\u0000\u02c0\u02c3\u0001\u0000"+ + "\u0000\u0000\u02c1\u02bf\u0001\u0000\u0000\u0000\u02c1\u02c2\u0001\u0000"+ + "\u0000\u0000\u02c2\u02e3\u0001\u0000\u0000\u0000\u02c3\u02c1\u0001\u0000"+ + "\u0000\u0000\u02c4\u02c6\u0003g,\u0000\u02c5\u02c7\u0003?\u0018\u0000"+ + "\u02c6\u02c5\u0001\u0000\u0000\u0000\u02c7\u02c8\u0001\u0000\u0000\u0000"+ + "\u02c8\u02c6\u0001\u0000\u0000\u0000\u02c8\u02c9\u0001\u0000\u0000\u0000"+ + "\u02c9\u02e3\u0001\u0000\u0000\u0000\u02ca\u02cc\u0003?\u0018\u0000\u02cb"+ + "\u02ca\u0001\u0000\u0000\u0000\u02cc\u02cd\u0001\u0000\u0000\u0000\u02cd"+ + "\u02cb\u0001\u0000\u0000\u0000\u02cd\u02ce\u0001\u0000\u0000\u0000\u02ce"+ + "\u02d6\u0001\u0000\u0000\u0000\u02cf\u02d3\u0003g,\u0000\u02d0\u02d2\u0003"+ + "?\u0018\u0000\u02d1\u02d0\u0001\u0000\u0000\u0000\u02d2\u02d5\u0001\u0000"+ + "\u0000\u0000\u02d3\u02d1\u0001\u0000\u0000\u0000\u02d3\u02d4\u0001\u0000"+ + "\u0000\u0000\u02d4\u02d7\u0001\u0000\u0000\u0000\u02d5\u02d3\u0001\u0000"+ + "\u0000\u0000\u02d6\u02cf\u0001\u0000\u0000\u0000\u02d6\u02d7\u0001\u0000"+ + "\u0000\u0000\u02d7\u02d8\u0001\u0000\u0000\u0000\u02d8\u02d9\u0003G\u001c"+ + "\u0000\u02d9\u02e3\u0001\u0000\u0000\u0000\u02da\u02dc\u0003g,\u0000\u02db"+ + "\u02dd\u0003?\u0018\u0000\u02dc\u02db\u0001\u0000\u0000\u0000\u02dd\u02de"+ + "\u0001\u0000\u0000\u0000\u02de\u02dc\u0001\u0000\u0000\u0000\u02de\u02df"+ + "\u0001\u0000\u0000\u0000\u02df\u02e0\u0001\u0000\u0000\u0000\u02e0\u02e1"+ + "\u0003G\u001c\u0000\u02e1\u02e3\u0001\u0000\u0000\u0000\u02e2\u02b9\u0001"+ + "\u0000\u0000\u0000\u02e2\u02c4\u0001\u0000\u0000\u0000\u02e2\u02cb\u0001"+ + "\u0000\u0000\u0000\u02e2\u02da\u0001\u0000\u0000\u0000\u02e3X\u0001\u0000"+ + "\u0000\u0000\u02e4\u02e5\u0007\u001e\u0000\u0000\u02e5\u02e6\u0007\u001f"+ + "\u0000\u0000\u02e6Z\u0001\u0000\u0000\u0000\u02e7\u02e8\u0007\f\u0000"+ + "\u0000\u02e8\u02e9\u0007\t\u0000\u0000\u02e9\u02ea\u0007\u0000\u0000\u0000"+ + "\u02ea\\\u0001\u0000\u0000\u0000\u02eb\u02ec\u0007\f\u0000\u0000\u02ec"+ + "\u02ed\u0007\u0002\u0000\u0000\u02ed\u02ee\u0007\u0004\u0000\u0000\u02ee"+ + "^\u0001\u0000\u0000\u0000\u02ef\u02f0\u0005=\u0000\u0000\u02f0`\u0001"+ + "\u0000\u0000\u0000\u02f1\u02f2\u0005:\u0000\u0000\u02f2\u02f3\u0005:\u0000"+ + "\u0000\u02f3b\u0001\u0000\u0000\u0000\u02f4\u02f5\u0005,\u0000\u0000\u02f5"+ + "d\u0001\u0000\u0000\u0000\u02f6\u02f7\u0007\u0000\u0000\u0000\u02f7\u02f8"+ + "\u0007\u0003\u0000\u0000\u02f8\u02f9\u0007\u0002\u0000\u0000\u02f9\u02fa"+ + "\u0007\u0004\u0000\u0000\u02faf\u0001\u0000\u0000\u0000\u02fb\u02fc\u0005"+ + ".\u0000\u0000\u02fch\u0001\u0000\u0000\u0000\u02fd\u02fe\u0007\u000f\u0000"+ + "\u0000\u02fe\u02ff\u0007\f\u0000\u0000\u02ff\u0300\u0007\r\u0000\u0000"+ + "\u0300\u0301\u0007\u0002\u0000\u0000\u0301\u0302\u0007\u0003\u0000\u0000"+ + "\u0302j\u0001\u0000\u0000\u0000\u0303\u0304\u0007\u000f\u0000\u0000\u0304"+ + "\u0305\u0007\u0001\u0000\u0000\u0305\u0306\u0007\u0006\u0000\u0000\u0306"+ + "\u0307\u0007\u0002\u0000\u0000\u0307\u0308\u0007\u0005\u0000\u0000\u0308"+ + "l\u0001\u0000\u0000\u0000\u0309\u030a\u0007\u0001\u0000\u0000\u030a\u030b"+ + "\u0007\t\u0000\u0000\u030bn\u0001\u0000\u0000\u0000\u030c\u030d\u0007"+ + "\u0001\u0000\u0000\u030d\u030e\u0007\u0002\u0000\u0000\u030ep\u0001\u0000"+ + "\u0000\u0000\u030f\u0310\u0007\r\u0000\u0000\u0310\u0311\u0007\f\u0000"+ + "\u0000\u0311\u0312\u0007\u0002\u0000\u0000\u0312\u0313\u0007\u0005\u0000"+ + "\u0000\u0313r\u0001\u0000\u0000\u0000\u0314\u0315\u0007\r\u0000\u0000"+ + "\u0315\u0316\u0007\u0001\u0000\u0000\u0316\u0317\u0007\u0012\u0000\u0000"+ + "\u0317\u0318\u0007\u0003\u0000\u0000\u0318t\u0001\u0000\u0000\u0000\u0319"+ + "\u031a\u0005(\u0000\u0000\u031av\u0001\u0000\u0000\u0000\u031b\u031c\u0007"+ + "\t\u0000\u0000\u031c\u031d\u0007\u0007\u0000\u0000\u031d\u031e\u0007\u0005"+ + "\u0000\u0000\u031ex\u0001\u0000\u0000\u0000\u031f\u0320\u0007\t\u0000"+ + "\u0000\u0320\u0321\u0007\u0014\u0000\u0000\u0321\u0322\u0007\r\u0000\u0000"+ + "\u0322\u0323\u0007\r\u0000\u0000\u0323z\u0001\u0000\u0000\u0000\u0324"+ + "\u0325\u0007\t\u0000\u0000\u0325\u0326\u0007\u0014\u0000\u0000\u0326\u0327"+ + "\u0007\r\u0000\u0000\u0327\u0328\u0007\r\u0000\u0000\u0328\u0329\u0007"+ + "\u0002\u0000\u0000\u0329|\u0001\u0000\u0000\u0000\u032a\u032b\u0007\u0007"+ + "\u0000\u0000\u032b\u032c\u0007\u0006\u0000\u0000\u032c~\u0001\u0000\u0000"+ + "\u0000\u032d\u032e\u0005?\u0000\u0000\u032e\u0080\u0001\u0000\u0000\u0000"+ + "\u032f\u0330\u0007\u0006\u0000\u0000\u0330\u0331\u0007\r\u0000\u0000\u0331"+ + "\u0332\u0007\u0001\u0000\u0000\u0332\u0333\u0007\u0012\u0000\u0000\u0333"+ + "\u0334\u0007\u0003\u0000\u0000\u0334\u0082\u0001\u0000\u0000\u0000\u0335"+ + "\u0336\u0005)\u0000\u0000\u0336\u0084\u0001\u0000\u0000\u0000\u0337\u0338"+ + "\u0007\u0005\u0000\u0000\u0338\u0339\u0007\u0006\u0000\u0000\u0339\u033a"+ + "\u0007\u0014\u0000\u0000\u033a\u033b\u0007\u0003\u0000\u0000\u033b\u0086"+ + "\u0001\u0000\u0000\u0000\u033c\u033d\u0005=\u0000\u0000\u033d\u033e\u0005"+ + "=\u0000\u0000\u033e\u0088\u0001\u0000\u0000\u0000\u033f\u0340\u0005=\u0000"+ + "\u0000\u0340\u0341\u0005~\u0000\u0000\u0341\u008a\u0001\u0000\u0000\u0000"+ + "\u0342\u0343\u0005!\u0000\u0000\u0343\u0344\u0005=\u0000\u0000\u0344\u008c"+ + "\u0001\u0000\u0000\u0000\u0345\u0346\u0005<\u0000\u0000\u0346\u008e\u0001"+ + "\u0000\u0000\u0000\u0347\u0348\u0005<\u0000\u0000\u0348\u0349\u0005=\u0000"+ + "\u0000\u0349\u0090\u0001\u0000\u0000\u0000\u034a\u034b\u0005>\u0000\u0000"+ + "\u034b\u0092\u0001\u0000\u0000\u0000\u034c\u034d\u0005>\u0000\u0000\u034d"+ + "\u034e\u0005=\u0000\u0000\u034e\u0094\u0001\u0000\u0000\u0000\u034f\u0350"+ + "\u0005+\u0000\u0000\u0350\u0096\u0001\u0000\u0000\u0000\u0351\u0352\u0005"+ + "-\u0000\u0000\u0352\u0098\u0001\u0000\u0000\u0000\u0353\u0354\u0005*\u0000"+ + "\u0000\u0354\u009a\u0001\u0000\u0000\u0000\u0355\u0356\u0005/\u0000\u0000"+ + "\u0356\u009c\u0001\u0000\u0000\u0000\u0357\u0358\u0005%\u0000\u0000\u0358"+ + "\u009e\u0001\u0000\u0000\u0000\u0359\u035a\u0007\u0010\u0000\u0000\u035a"+ + "\u035b\u0007\f\u0000\u0000\u035b\u035c\u0007\u0005\u0000\u0000\u035c\u035d"+ + "\u0007\u0004\u0000\u0000\u035d\u035e\u0007\n\u0000\u0000\u035e\u00a0\u0001"+ + "\u0000\u0000\u0000\u035f\u0360\u0003-\u000f\u0000\u0360\u0361\u0001\u0000"+ + "\u0000\u0000\u0361\u0362\u0006I\f\u0000\u0362\u00a2\u0001\u0000\u0000"+ + "\u0000\u0363\u0366\u0003\u007f8\u0000\u0364\u0367\u0003A\u0019\u0000\u0365"+ + "\u0367\u0003O \u0000\u0366\u0364\u0001\u0000\u0000\u0000\u0366\u0365\u0001"+ + "\u0000\u0000\u0000\u0367\u036b\u0001\u0000\u0000\u0000\u0368\u036a\u0003"+ + "Q!\u0000\u0369\u0368\u0001\u0000\u0000\u0000\u036a\u036d\u0001\u0000\u0000"+ + "\u0000\u036b\u0369\u0001\u0000\u0000\u0000\u036b\u036c\u0001\u0000\u0000"+ + "\u0000\u036c\u0375\u0001\u0000\u0000\u0000\u036d\u036b\u0001\u0000\u0000"+ + "\u0000\u036e\u0370\u0003\u007f8\u0000\u036f\u0371\u0003?\u0018\u0000\u0370"+ + "\u036f\u0001\u0000\u0000\u0000\u0371\u0372\u0001\u0000\u0000\u0000\u0372"+ + "\u0370\u0001\u0000\u0000\u0000\u0372\u0373\u0001\u0000\u0000\u0000\u0373"+ + "\u0375\u0001\u0000\u0000\u0000\u0374\u0363\u0001\u0000\u0000\u0000\u0374"+ + "\u036e\u0001\u0000\u0000\u0000\u0375\u00a4\u0001\u0000\u0000\u0000\u0376"+ + "\u0377\u0005[\u0000\u0000\u0377\u0378\u0001\u0000\u0000\u0000\u0378\u0379"+ + "\u0006K\u0000\u0000\u0379\u037a\u0006K\u0000\u0000\u037a\u00a6\u0001\u0000"+ + "\u0000\u0000\u037b\u037c\u0005]\u0000\u0000\u037c\u037d\u0001\u0000\u0000"+ + "\u0000\u037d\u037e\u0006L\u000b\u0000\u037e\u037f\u0006L\u000b\u0000\u037f"+ + "\u00a8\u0001\u0000\u0000\u0000\u0380\u0384\u0003A\u0019\u0000\u0381\u0383"+ + "\u0003Q!\u0000\u0382\u0381\u0001\u0000\u0000\u0000\u0383\u0386\u0001\u0000"+ + "\u0000\u0000\u0384\u0382\u0001\u0000\u0000\u0000\u0384\u0385\u0001\u0000"+ + "\u0000\u0000\u0385\u0391\u0001\u0000\u0000\u0000\u0386\u0384\u0001\u0000"+ + "\u0000\u0000\u0387\u038a\u0003O \u0000\u0388\u038a\u0003I\u001d\u0000"+ + "\u0389\u0387\u0001\u0000\u0000\u0000\u0389\u0388\u0001\u0000\u0000\u0000"+ + "\u038a\u038c\u0001\u0000\u0000\u0000\u038b\u038d\u0003Q!\u0000\u038c\u038b"+ + "\u0001\u0000\u0000\u0000\u038d\u038e\u0001\u0000\u0000\u0000\u038e\u038c"+ + "\u0001\u0000\u0000\u0000\u038e\u038f\u0001\u0000\u0000\u0000\u038f\u0391"+ + "\u0001\u0000\u0000\u0000\u0390\u0380\u0001\u0000\u0000\u0000\u0390\u0389"+ + "\u0001\u0000\u0000\u0000\u0391\u00aa\u0001\u0000\u0000\u0000\u0392\u0394"+ + "\u0003K\u001e\u0000\u0393\u0395\u0003M\u001f\u0000\u0394\u0393\u0001\u0000"+ + "\u0000\u0000\u0395\u0396\u0001\u0000\u0000\u0000\u0396\u0394\u0001\u0000"+ + "\u0000\u0000\u0396\u0397\u0001\u0000\u0000\u0000\u0397\u0398\u0001\u0000"+ + "\u0000\u0000\u0398\u0399\u0003K\u001e\u0000\u0399\u00ac\u0001\u0000\u0000"+ + "\u0000\u039a\u039b\u0003\u00abN\u0000\u039b\u00ae\u0001\u0000\u0000\u0000"+ + "\u039c\u039d\u00037\u0014\u0000\u039d\u039e\u0001\u0000\u0000\u0000\u039e"+ + "\u039f\u0006P\n\u0000\u039f\u00b0\u0001\u0000\u0000\u0000\u03a0\u03a1"+ + "\u00039\u0015\u0000\u03a1\u03a2\u0001\u0000\u0000\u0000\u03a2\u03a3\u0006"+ + "Q\n\u0000\u03a3\u00b2\u0001\u0000\u0000\u0000\u03a4\u03a5\u0003;\u0016"+ + "\u0000\u03a5\u03a6\u0001\u0000\u0000\u0000\u03a6\u03a7\u0006R\n\u0000"+ + "\u03a7\u00b4\u0001\u0000\u0000\u0000\u03a8\u03a9\u0003\u00a5K\u0000\u03a9"+ + "\u03aa\u0001\u0000\u0000\u0000\u03aa\u03ab\u0006S\r\u0000\u03ab\u03ac"+ + "\u0006S\u000e\u0000\u03ac\u00b6\u0001\u0000\u0000\u0000\u03ad\u03ae\u0003"+ + "=\u0017\u0000\u03ae\u03af\u0001\u0000\u0000\u0000\u03af\u03b0\u0006T\u000f"+ + "\u0000\u03b0\u03b1\u0006T\u000b\u0000\u03b1\u00b8\u0001\u0000\u0000\u0000"+ + "\u03b2\u03b3\u0003;\u0016\u0000\u03b3\u03b4\u0001\u0000\u0000\u0000\u03b4"+ + "\u03b5\u0006U\n\u0000\u03b5\u00ba\u0001\u0000\u0000\u0000\u03b6\u03b7"+ + "\u00037\u0014\u0000\u03b7\u03b8\u0001\u0000\u0000\u0000\u03b8\u03b9\u0006"+ + "V\n\u0000\u03b9\u00bc\u0001\u0000\u0000\u0000\u03ba\u03bb\u00039\u0015"+ + "\u0000\u03bb\u03bc\u0001\u0000\u0000\u0000\u03bc\u03bd\u0006W\n\u0000"+ + "\u03bd\u00be\u0001\u0000\u0000\u0000\u03be\u03bf\u0003=\u0017\u0000\u03bf"+ + "\u03c0\u0001\u0000\u0000\u0000\u03c0\u03c1\u0006X\u000f\u0000\u03c1\u03c2"+ + "\u0006X\u000b\u0000\u03c2\u00c0\u0001\u0000\u0000\u0000\u03c3\u03c4\u0003"+ + "\u00a5K\u0000\u03c4\u03c5\u0001\u0000\u0000\u0000\u03c5\u03c6\u0006Y\r"+ + "\u0000\u03c6\u00c2\u0001\u0000\u0000\u0000\u03c7\u03c8\u0003\u00a7L\u0000"+ + "\u03c8\u03c9\u0001\u0000\u0000\u0000\u03c9\u03ca\u0006Z\u0010\u0000\u03ca"+ + "\u00c4\u0001\u0000\u0000\u0000\u03cb\u03cc\u0003\u0151\u00a1\u0000\u03cc"+ + "\u03cd\u0001\u0000\u0000\u0000\u03cd\u03ce\u0006[\u0011\u0000\u03ce\u00c6"+ + "\u0001\u0000\u0000\u0000\u03cf\u03d0\u0003c*\u0000\u03d0\u03d1\u0001\u0000"+ + "\u0000\u0000\u03d1\u03d2\u0006\\\u0012\u0000\u03d2\u00c8\u0001\u0000\u0000"+ + "\u0000\u03d3\u03d4\u0003_(\u0000\u03d4\u03d5\u0001\u0000\u0000\u0000\u03d5"+ + "\u03d6\u0006]\u0013\u0000\u03d6\u00ca\u0001\u0000\u0000\u0000\u03d7\u03d8"+ + "\u0007\u0010\u0000\u0000\u03d8\u03d9\u0007\u0003\u0000\u0000\u03d9\u03da"+ + "\u0007\u0005\u0000\u0000\u03da\u03db\u0007\f\u0000\u0000\u03db\u03dc\u0007"+ + "\u0000\u0000\u0000\u03dc\u03dd\u0007\f\u0000\u0000\u03dd\u03de\u0007\u0005"+ + "\u0000\u0000\u03de\u03df\u0007\f\u0000\u0000\u03df\u00cc\u0001\u0000\u0000"+ + "\u0000\u03e0\u03e4\b \u0000\u0000\u03e1\u03e2\u0005/\u0000\u0000\u03e2"+ + "\u03e4\b!\u0000\u0000\u03e3\u03e0\u0001\u0000\u0000\u0000\u03e3\u03e1"+ + "\u0001\u0000\u0000\u0000\u03e4\u00ce\u0001\u0000\u0000\u0000\u03e5\u03e7"+ + "\u0003\u00cd_\u0000\u03e6\u03e5\u0001\u0000\u0000\u0000\u03e7\u03e8\u0001"+ + "\u0000\u0000\u0000\u03e8\u03e6\u0001\u0000\u0000\u0000\u03e8\u03e9\u0001"+ + "\u0000\u0000\u0000\u03e9\u00d0\u0001\u0000\u0000\u0000\u03ea\u03eb\u0003"+ + "\u00cf`\u0000\u03eb\u03ec\u0001\u0000\u0000\u0000\u03ec\u03ed\u0006a\u0014"+ + "\u0000\u03ed\u00d2\u0001\u0000\u0000\u0000\u03ee\u03ef\u0003S\"\u0000"+ + "\u03ef\u03f0\u0001\u0000\u0000\u0000\u03f0\u03f1\u0006b\u0015\u0000\u03f1"+ + "\u00d4\u0001\u0000\u0000\u0000\u03f2\u03f3\u00037\u0014\u0000\u03f3\u03f4"+ + "\u0001\u0000\u0000\u0000\u03f4\u03f5\u0006c\n\u0000\u03f5\u00d6\u0001"+ + "\u0000\u0000\u0000\u03f6\u03f7\u00039\u0015\u0000\u03f7\u03f8\u0001\u0000"+ + "\u0000\u0000\u03f8\u03f9\u0006d\n\u0000\u03f9\u00d8\u0001\u0000\u0000"+ + "\u0000\u03fa\u03fb\u0003;\u0016\u0000\u03fb\u03fc\u0001\u0000\u0000\u0000"+ + "\u03fc\u03fd\u0006e\n\u0000\u03fd\u00da\u0001\u0000\u0000\u0000\u03fe"+ + "\u03ff\u0003=\u0017\u0000\u03ff\u0400\u0001\u0000\u0000\u0000\u0400\u0401"+ + "\u0006f\u000f\u0000\u0401\u0402\u0006f\u000b\u0000\u0402\u00dc\u0001\u0000"+ + "\u0000\u0000\u0403\u0404\u0003g,\u0000\u0404\u0405\u0001\u0000\u0000\u0000"+ + "\u0405\u0406\u0006g\u0016\u0000\u0406\u00de\u0001\u0000\u0000\u0000\u0407"+ + "\u0408\u0003c*\u0000\u0408\u0409\u0001\u0000\u0000\u0000\u0409\u040a\u0006"+ + "h\u0012\u0000\u040a\u00e0\u0001\u0000\u0000\u0000\u040b\u040c\u0003\u007f"+ + "8\u0000\u040c\u040d\u0001\u0000\u0000\u0000\u040d\u040e\u0006i\u0017\u0000"+ + "\u040e\u00e2\u0001\u0000\u0000\u0000\u040f\u0410\u0003\u00a3J\u0000\u0410"+ + "\u0411\u0001\u0000\u0000\u0000\u0411\u0412\u0006j\u0018\u0000\u0412\u00e4"+ + "\u0001\u0000\u0000\u0000\u0413\u0418\u0003A\u0019\u0000\u0414\u0418\u0003"+ + "?\u0018\u0000\u0415\u0418\u0003O \u0000\u0416\u0418\u0003\u0099E\u0000"+ + "\u0417\u0413\u0001\u0000\u0000\u0000\u0417\u0414\u0001\u0000\u0000\u0000"+ + "\u0417\u0415\u0001\u0000\u0000\u0000\u0417\u0416\u0001\u0000\u0000\u0000"+ + "\u0418\u00e6\u0001\u0000\u0000\u0000\u0419\u041c\u0003A\u0019\u0000\u041a"+ + "\u041c\u0003\u0099E\u0000\u041b\u0419\u0001\u0000\u0000\u0000\u041b\u041a"+ + "\u0001\u0000\u0000\u0000\u041c\u0420\u0001\u0000\u0000\u0000\u041d\u041f"+ + "\u0003\u00e5k\u0000\u041e\u041d\u0001\u0000\u0000\u0000\u041f\u0422\u0001"+ + "\u0000\u0000\u0000\u0420\u041e\u0001\u0000\u0000\u0000\u0420\u0421\u0001"+ + "\u0000\u0000\u0000\u0421\u042d\u0001\u0000\u0000\u0000\u0422\u0420\u0001"+ + "\u0000\u0000\u0000\u0423\u0426\u0003O \u0000\u0424\u0426\u0003I\u001d"+ + "\u0000\u0425\u0423\u0001\u0000\u0000\u0000\u0425\u0424\u0001\u0000\u0000"+ + "\u0000\u0426\u0428\u0001\u0000\u0000\u0000\u0427\u0429\u0003\u00e5k\u0000"+ + "\u0428\u0427\u0001\u0000\u0000\u0000\u0429\u042a\u0001\u0000\u0000\u0000"+ + "\u042a\u0428\u0001\u0000\u0000\u0000\u042a\u042b\u0001\u0000\u0000\u0000"+ + "\u042b\u042d\u0001\u0000\u0000\u0000\u042c\u041b\u0001\u0000\u0000\u0000"+ + "\u042c\u0425\u0001\u0000\u0000\u0000\u042d\u00e8\u0001\u0000\u0000\u0000"+ + "\u042e\u0431\u0003\u00e7l\u0000\u042f\u0431\u0003\u00abN\u0000\u0430\u042e"+ + "\u0001\u0000\u0000\u0000\u0430\u042f\u0001\u0000\u0000\u0000\u0431\u0432"+ + "\u0001\u0000\u0000\u0000\u0432\u0430\u0001\u0000\u0000\u0000\u0432\u0433"+ + "\u0001\u0000\u0000\u0000\u0433\u00ea\u0001\u0000\u0000\u0000\u0434\u0435"+ + "\u00037\u0014\u0000\u0435\u0436\u0001\u0000\u0000\u0000\u0436\u0437\u0006"+ + "n\n\u0000\u0437\u00ec\u0001\u0000\u0000\u0000\u0438\u0439\u00039\u0015"+ + "\u0000\u0439\u043a\u0001\u0000\u0000\u0000\u043a\u043b\u0006o\n\u0000"+ + "\u043b\u00ee\u0001\u0000\u0000\u0000\u043c\u043d\u0003;\u0016\u0000\u043d"+ + "\u043e\u0001\u0000\u0000\u0000\u043e\u043f\u0006p\n\u0000\u043f\u00f0"+ + "\u0001\u0000\u0000\u0000\u0440\u0441\u0003=\u0017\u0000\u0441\u0442\u0001"+ + "\u0000\u0000\u0000\u0442\u0443\u0006q\u000f\u0000\u0443\u0444\u0006q\u000b"+ + "\u0000\u0444\u00f2\u0001\u0000\u0000\u0000\u0445\u0446\u0003_(\u0000\u0446"+ + "\u0447\u0001\u0000\u0000\u0000\u0447\u0448\u0006r\u0013\u0000\u0448\u00f4"+ + "\u0001\u0000\u0000\u0000\u0449\u044a\u0003c*\u0000\u044a\u044b\u0001\u0000"+ + "\u0000\u0000\u044b\u044c\u0006s\u0012\u0000\u044c\u00f6\u0001\u0000\u0000"+ + "\u0000\u044d\u044e\u0003g,\u0000\u044e\u044f\u0001\u0000\u0000\u0000\u044f"+ + "\u0450\u0006t\u0016\u0000\u0450\u00f8\u0001\u0000\u0000\u0000\u0451\u0452"+ + "\u0003\u007f8\u0000\u0452\u0453\u0001\u0000\u0000\u0000\u0453\u0454\u0006"+ + "u\u0017\u0000\u0454\u00fa\u0001\u0000\u0000\u0000\u0455\u0456\u0003\u00a3"+ + "J\u0000\u0456\u0457\u0001\u0000\u0000\u0000\u0457\u0458\u0006v\u0018\u0000"+ + "\u0458\u00fc\u0001\u0000\u0000\u0000\u0459\u045a\u0007\f\u0000\u0000\u045a"+ + "\u045b\u0007\u0002\u0000\u0000\u045b\u00fe\u0001\u0000\u0000\u0000\u045c"+ + "\u045d\u0003\u00e9m\u0000\u045d\u045e\u0001\u0000\u0000\u0000\u045e\u045f"+ + "\u0006x\u0019\u0000\u045f\u0100\u0001\u0000\u0000\u0000\u0460\u0461\u0003"+ + "7\u0014\u0000\u0461\u0462\u0001\u0000\u0000\u0000\u0462\u0463\u0006y\n"+ + "\u0000\u0463\u0102\u0001\u0000\u0000\u0000\u0464\u0465\u00039\u0015\u0000"+ + "\u0465\u0466\u0001\u0000\u0000\u0000\u0466\u0467\u0006z\n\u0000\u0467"+ + "\u0104\u0001\u0000\u0000\u0000\u0468\u0469\u0003;\u0016\u0000\u0469\u046a"+ + "\u0001\u0000\u0000\u0000\u046a\u046b\u0006{\n\u0000\u046b\u0106\u0001"+ + "\u0000\u0000\u0000\u046c\u046d\u0003=\u0017\u0000\u046d\u046e\u0001\u0000"+ + "\u0000\u0000\u046e\u046f\u0006|\u000f\u0000\u046f\u0470\u0006|\u000b\u0000"+ + "\u0470\u0108\u0001\u0000\u0000\u0000\u0471\u0472\u0003\u00a5K\u0000\u0472"+ + "\u0473\u0001\u0000\u0000\u0000\u0473\u0474\u0006}\r\u0000\u0474\u0475"+ + "\u0006}\u001a\u0000\u0475\u010a\u0001\u0000\u0000\u0000\u0476\u0477\u0007"+ + "\u0007\u0000\u0000\u0477\u0478\u0007\t\u0000\u0000\u0478\u0479\u0001\u0000"+ + "\u0000\u0000\u0479\u047a\u0006~\u001b\u0000\u047a\u010c\u0001\u0000\u0000"+ + "\u0000\u047b\u047c\u0007\u0013\u0000\u0000\u047c\u047d\u0007\u0001\u0000"+ + "\u0000\u047d\u047e\u0007\u0005\u0000\u0000\u047e\u047f\u0007\n\u0000\u0000"+ + "\u047f\u0480\u0001\u0000\u0000\u0000\u0480\u0481\u0006\u007f\u001b\u0000"+ + "\u0481\u010e\u0001\u0000\u0000\u0000\u0482\u0483\b\"\u0000\u0000\u0483"+ + "\u0110\u0001\u0000\u0000\u0000\u0484\u0486\u0003\u010f\u0080\u0000\u0485"+ + "\u0484\u0001\u0000\u0000\u0000\u0486\u0487\u0001\u0000\u0000\u0000\u0487"+ + "\u0485\u0001\u0000\u0000\u0000\u0487\u0488\u0001\u0000\u0000\u0000\u0488"+ + "\u0489\u0001\u0000\u0000\u0000\u0489\u048a\u0003\u0151\u00a1\u0000\u048a"+ + "\u048c\u0001\u0000\u0000\u0000\u048b\u0485\u0001\u0000\u0000\u0000\u048b"+ + "\u048c\u0001\u0000\u0000\u0000\u048c\u048e\u0001\u0000\u0000\u0000\u048d"+ + "\u048f\u0003\u010f\u0080\u0000\u048e\u048d\u0001\u0000\u0000\u0000\u048f"+ + "\u0490\u0001\u0000\u0000\u0000\u0490\u048e\u0001\u0000\u0000\u0000\u0490"+ + "\u0491\u0001\u0000\u0000\u0000\u0491\u0112\u0001\u0000\u0000\u0000\u0492"+ + "\u0493\u0003\u0111\u0081\u0000\u0493\u0494\u0001\u0000\u0000\u0000\u0494"+ + "\u0495\u0006\u0082\u001c\u0000\u0495\u0114\u0001\u0000\u0000\u0000\u0496"+ + "\u0497\u00037\u0014\u0000\u0497\u0498\u0001\u0000\u0000\u0000\u0498\u0499"+ + "\u0006\u0083\n\u0000\u0499\u0116\u0001\u0000\u0000\u0000\u049a\u049b\u0003"+ + "9\u0015\u0000\u049b\u049c\u0001\u0000\u0000\u0000\u049c\u049d\u0006\u0084"+ + "\n\u0000\u049d\u0118\u0001\u0000\u0000\u0000\u049e\u049f\u0003;\u0016"+ + "\u0000\u049f\u04a0\u0001\u0000\u0000\u0000\u04a0\u04a1\u0006\u0085\n\u0000"+ + "\u04a1\u011a\u0001\u0000\u0000\u0000\u04a2\u04a3\u0003=\u0017\u0000\u04a3"+ + "\u04a4\u0001\u0000\u0000\u0000\u04a4\u04a5\u0006\u0086\u000f\u0000\u04a5"+ + "\u04a6\u0006\u0086\u000b\u0000\u04a6\u04a7\u0006\u0086\u000b\u0000\u04a7"+ + "\u011c\u0001\u0000\u0000\u0000\u04a8\u04a9\u0003_(\u0000\u04a9\u04aa\u0001"+ + "\u0000\u0000\u0000\u04aa\u04ab\u0006\u0087\u0013\u0000\u04ab\u011e\u0001"+ + "\u0000\u0000\u0000\u04ac\u04ad\u0003c*\u0000\u04ad\u04ae\u0001\u0000\u0000"+ + "\u0000\u04ae\u04af\u0006\u0088\u0012\u0000\u04af\u0120\u0001\u0000\u0000"+ + "\u0000\u04b0\u04b1\u0003g,\u0000\u04b1\u04b2\u0001\u0000\u0000\u0000\u04b2"+ + "\u04b3\u0006\u0089\u0016\u0000\u04b3\u0122\u0001\u0000\u0000\u0000\u04b4"+ + "\u04b5\u0003\u010d\u007f\u0000\u04b5\u04b6\u0001\u0000\u0000\u0000\u04b6"+ + "\u04b7\u0006\u008a\u001d\u0000\u04b7\u0124\u0001\u0000\u0000\u0000\u04b8"+ + "\u04b9\u0003\u00e9m\u0000\u04b9\u04ba\u0001\u0000\u0000\u0000\u04ba\u04bb"+ + "\u0006\u008b\u0019\u0000\u04bb\u0126\u0001\u0000\u0000\u0000\u04bc\u04bd"+ + "\u0003\u00adO\u0000\u04bd\u04be\u0001\u0000\u0000\u0000\u04be\u04bf\u0006"+ + "\u008c\u001e\u0000\u04bf\u0128\u0001\u0000\u0000\u0000\u04c0\u04c1\u0003"+ + "\u007f8\u0000\u04c1\u04c2\u0001\u0000\u0000\u0000\u04c2\u04c3\u0006\u008d"+ + "\u0017\u0000\u04c3\u012a\u0001\u0000\u0000\u0000\u04c4\u04c5\u0003\u00a3"+ + "J\u0000\u04c5\u04c6\u0001\u0000\u0000\u0000\u04c6\u04c7\u0006\u008e\u0018"+ + "\u0000\u04c7\u012c\u0001\u0000\u0000\u0000\u04c8\u04c9\u00037\u0014\u0000"+ + "\u04c9\u04ca\u0001\u0000\u0000\u0000\u04ca\u04cb\u0006\u008f\n\u0000\u04cb"+ + "\u012e\u0001\u0000\u0000\u0000\u04cc\u04cd\u00039\u0015\u0000\u04cd\u04ce"+ + "\u0001\u0000\u0000\u0000\u04ce\u04cf\u0006\u0090\n\u0000\u04cf\u0130\u0001"+ + "\u0000\u0000\u0000\u04d0\u04d1\u0003;\u0016\u0000\u04d1\u04d2\u0001\u0000"+ + "\u0000\u0000\u04d2\u04d3\u0006\u0091\n\u0000\u04d3\u0132\u0001\u0000\u0000"+ + "\u0000\u04d4\u04d5\u0003=\u0017\u0000\u04d5\u04d6\u0001\u0000\u0000\u0000"+ + "\u04d6\u04d7\u0006\u0092\u000f\u0000\u04d7\u04d8\u0006\u0092\u000b\u0000"+ + "\u04d8\u0134\u0001\u0000\u0000\u0000\u04d9\u04da\u0003g,\u0000\u04da\u04db"+ + "\u0001\u0000\u0000\u0000\u04db\u04dc\u0006\u0093\u0016\u0000\u04dc\u0136"+ + "\u0001\u0000\u0000\u0000\u04dd\u04de\u0003\u007f8\u0000\u04de\u04df\u0001"+ + "\u0000\u0000\u0000\u04df\u04e0\u0006\u0094\u0017\u0000\u04e0\u0138\u0001"+ + "\u0000\u0000\u0000\u04e1\u04e2\u0003\u00a3J\u0000\u04e2\u04e3\u0001\u0000"+ + "\u0000\u0000\u04e3\u04e4\u0006\u0095\u0018\u0000\u04e4\u013a\u0001\u0000"+ + "\u0000\u0000\u04e5\u04e6\u0003\u00adO\u0000\u04e6\u04e7\u0001\u0000\u0000"+ + "\u0000\u04e7\u04e8\u0006\u0096\u001e\u0000\u04e8\u013c\u0001\u0000\u0000"+ + "\u0000\u04e9\u04ea\u0003\u00a9M\u0000\u04ea\u04eb\u0001\u0000\u0000\u0000"+ + "\u04eb\u04ec\u0006\u0097\u001f\u0000\u04ec\u013e\u0001\u0000\u0000\u0000"+ + "\u04ed\u04ee\u00037\u0014\u0000\u04ee\u04ef\u0001\u0000\u0000\u0000\u04ef"+ + "\u04f0\u0006\u0098\n\u0000\u04f0\u0140\u0001\u0000\u0000\u0000\u04f1\u04f2"+ + "\u00039\u0015\u0000\u04f2\u04f3\u0001\u0000\u0000\u0000\u04f3\u04f4\u0006"+ + "\u0099\n\u0000\u04f4\u0142\u0001\u0000\u0000\u0000\u04f5\u04f6\u0003;"+ + "\u0016\u0000\u04f6\u04f7\u0001\u0000\u0000\u0000\u04f7\u04f8\u0006\u009a"+ + "\n\u0000\u04f8\u0144\u0001\u0000\u0000\u0000\u04f9\u04fa\u0003=\u0017"+ + "\u0000\u04fa\u04fb\u0001\u0000\u0000\u0000\u04fb\u04fc\u0006\u009b\u000f"+ + "\u0000\u04fc\u04fd\u0006\u009b\u000b\u0000\u04fd\u0146\u0001\u0000\u0000"+ + "\u0000\u04fe\u04ff\u0007\u0001\u0000\u0000\u04ff\u0500\u0007\t\u0000\u0000"+ + "\u0500\u0501\u0007\u000f\u0000\u0000\u0501\u0502\u0007\u0007\u0000\u0000"+ + "\u0502\u0148\u0001\u0000\u0000\u0000\u0503\u0504\u00037\u0014\u0000\u0504"+ + "\u0505\u0001\u0000\u0000\u0000\u0505\u0506\u0006\u009d\n\u0000\u0506\u014a"+ + "\u0001\u0000\u0000\u0000\u0507\u0508\u00039\u0015\u0000\u0508\u0509\u0001"+ + "\u0000\u0000\u0000\u0509\u050a\u0006\u009e\n\u0000\u050a\u014c\u0001\u0000"+ + "\u0000\u0000\u050b\u050c\u0003;\u0016\u0000\u050c\u050d\u0001\u0000\u0000"+ + "\u0000\u050d\u050e\u0006\u009f\n\u0000\u050e\u014e\u0001\u0000\u0000\u0000"+ + "\u050f\u0510\u0003\u00a7L\u0000\u0510\u0511\u0001\u0000\u0000\u0000\u0511"+ + "\u0512\u0006\u00a0\u0010\u0000\u0512\u0513\u0006\u00a0\u000b\u0000\u0513"+ + "\u0150\u0001\u0000\u0000\u0000\u0514\u0515\u0005:\u0000\u0000\u0515\u0152"+ + "\u0001\u0000\u0000\u0000\u0516\u051c\u0003I\u001d\u0000\u0517\u051c\u0003"+ + "?\u0018\u0000\u0518\u051c\u0003g,\u0000\u0519\u051c\u0003A\u0019\u0000"+ + "\u051a\u051c\u0003O \u0000\u051b\u0516\u0001\u0000\u0000\u0000\u051b\u0517"+ + "\u0001\u0000\u0000\u0000\u051b\u0518\u0001\u0000\u0000\u0000\u051b\u0519"+ + "\u0001\u0000\u0000\u0000\u051b\u051a\u0001\u0000\u0000\u0000\u051c\u051d"+ + "\u0001\u0000\u0000\u0000\u051d\u051b\u0001\u0000\u0000\u0000\u051d\u051e"+ + "\u0001\u0000\u0000\u0000\u051e\u0154\u0001\u0000\u0000\u0000\u051f\u0520"+ + "\u00037\u0014\u0000\u0520\u0521\u0001\u0000\u0000\u0000\u0521\u0522\u0006"+ + "\u00a3\n\u0000\u0522\u0156\u0001\u0000\u0000\u0000\u0523\u0524\u00039"+ + "\u0015\u0000\u0524\u0525\u0001\u0000\u0000\u0000\u0525\u0526\u0006\u00a4"+ + "\n\u0000\u0526\u0158\u0001\u0000\u0000\u0000\u0527\u0528\u0003;\u0016"+ + "\u0000\u0528\u0529\u0001\u0000\u0000\u0000\u0529\u052a\u0006\u00a5\n\u0000"+ + "\u052a\u015a\u0001\u0000\u0000\u0000\u052b\u052c\u0003=\u0017\u0000\u052c"+ + "\u052d\u0001\u0000\u0000\u0000\u052d\u052e\u0006\u00a6\u000f\u0000\u052e"+ + "\u052f\u0006\u00a6\u000b\u0000\u052f\u015c\u0001\u0000\u0000\u0000\u0530"+ + "\u0531\u0003\u0151\u00a1\u0000\u0531\u0532\u0001\u0000\u0000\u0000\u0532"+ + "\u0533\u0006\u00a7\u0011\u0000\u0533\u015e\u0001\u0000\u0000\u0000\u0534"+ + "\u0535\u0003c*\u0000\u0535\u0536\u0001\u0000\u0000\u0000\u0536\u0537\u0006"+ + "\u00a8\u0012\u0000\u0537\u0160\u0001\u0000\u0000\u0000\u0538\u0539\u0003"+ + "g,\u0000\u0539\u053a\u0001\u0000\u0000\u0000\u053a\u053b\u0006\u00a9\u0016"+ + "\u0000\u053b\u0162\u0001\u0000\u0000\u0000\u053c\u053d\u0003\u010b~\u0000"+ + "\u053d\u053e\u0001\u0000\u0000\u0000\u053e\u053f\u0006\u00aa \u0000\u053f"+ + "\u0540\u0006\u00aa!\u0000\u0540\u0164\u0001\u0000\u0000\u0000\u0541\u0542"+ + "\u0003\u00cf`\u0000\u0542\u0543\u0001\u0000\u0000\u0000\u0543\u0544\u0006"+ + "\u00ab\u0014\u0000\u0544\u0166\u0001\u0000\u0000\u0000\u0545\u0546\u0003"+ + "S\"\u0000\u0546\u0547\u0001\u0000\u0000\u0000\u0547\u0548\u0006\u00ac"+ + "\u0015\u0000\u0548\u0168\u0001\u0000\u0000\u0000\u0549\u054a\u00037\u0014"+ + "\u0000\u054a\u054b\u0001\u0000\u0000\u0000\u054b\u054c\u0006\u00ad\n\u0000"+ + "\u054c\u016a\u0001\u0000\u0000\u0000\u054d\u054e\u00039\u0015\u0000\u054e"+ + "\u054f\u0001\u0000\u0000\u0000\u054f\u0550\u0006\u00ae\n\u0000\u0550\u016c"+ + "\u0001\u0000\u0000\u0000\u0551\u0552\u0003;\u0016\u0000\u0552\u0553\u0001"+ + "\u0000\u0000\u0000\u0553\u0554\u0006\u00af\n\u0000\u0554\u016e\u0001\u0000"+ + "\u0000\u0000\u0555\u0556\u0003=\u0017\u0000\u0556\u0557\u0001\u0000\u0000"+ + "\u0000\u0557\u0558\u0006\u00b0\u000f\u0000\u0558\u0559\u0006\u00b0\u000b"+ + "\u0000\u0559\u055a\u0006\u00b0\u000b\u0000\u055a\u0170\u0001\u0000\u0000"+ + "\u0000\u055b\u055c\u0003c*\u0000\u055c\u055d\u0001\u0000\u0000\u0000\u055d"+ + "\u055e\u0006\u00b1\u0012\u0000\u055e\u0172\u0001\u0000\u0000\u0000\u055f"+ + "\u0560\u0003g,\u0000\u0560\u0561\u0001\u0000\u0000\u0000\u0561\u0562\u0006"+ + "\u00b2\u0016\u0000\u0562\u0174\u0001\u0000\u0000\u0000\u0563\u0564\u0003"+ + "\u00e9m\u0000\u0564\u0565\u0001\u0000\u0000\u0000\u0565\u0566\u0006\u00b3"+ + "\u0019\u0000\u0566\u0176\u0001\u0000\u0000\u0000\u0567\u0568\u00037\u0014"+ + "\u0000\u0568\u0569\u0001\u0000\u0000\u0000\u0569\u056a\u0006\u00b4\n\u0000"+ + "\u056a\u0178\u0001\u0000\u0000\u0000\u056b\u056c\u00039\u0015\u0000\u056c"+ + "\u056d\u0001\u0000\u0000\u0000\u056d\u056e\u0006\u00b5\n\u0000\u056e\u017a"+ + "\u0001\u0000\u0000\u0000\u056f\u0570\u0003;\u0016\u0000\u0570\u0571\u0001"+ + "\u0000\u0000\u0000\u0571\u0572\u0006\u00b6\n\u0000\u0572\u017c\u0001\u0000"+ + "\u0000\u0000\u0573\u0574\u0003=\u0017\u0000\u0574\u0575\u0001\u0000\u0000"+ + "\u0000\u0575\u0576\u0006\u00b7\u000f\u0000\u0576\u0577\u0006\u00b7\u000b"+ + "\u0000\u0577\u017e\u0001\u0000\u0000\u0000\u0578\u0579\u0003\u00cf`\u0000"+ + "\u0579\u057a\u0001\u0000\u0000\u0000\u057a\u057b\u0006\u00b8\u0014\u0000"+ + "\u057b\u057c\u0006\u00b8\u000b\u0000\u057c\u057d\u0006\u00b8\"\u0000\u057d"+ + "\u0180\u0001\u0000\u0000\u0000\u057e\u057f\u0003S\"\u0000\u057f\u0580"+ + "\u0001\u0000\u0000\u0000\u0580\u0581\u0006\u00b9\u0015\u0000\u0581\u0582"+ + "\u0006\u00b9\u000b\u0000\u0582\u0583\u0006\u00b9\"\u0000\u0583\u0182\u0001"+ + "\u0000\u0000\u0000\u0584\u0585\u00037\u0014\u0000\u0585\u0586\u0001\u0000"+ + "\u0000\u0000\u0586\u0587\u0006\u00ba\n\u0000\u0587\u0184\u0001\u0000\u0000"+ + "\u0000\u0588\u0589\u00039\u0015\u0000\u0589\u058a\u0001\u0000\u0000\u0000"+ + "\u058a\u058b\u0006\u00bb\n\u0000\u058b\u0186\u0001\u0000\u0000\u0000\u058c"+ + "\u058d\u0003;\u0016\u0000\u058d\u058e\u0001\u0000\u0000\u0000\u058e\u058f"+ + "\u0006\u00bc\n\u0000\u058f\u0188\u0001\u0000\u0000\u0000\u0590\u0591\u0003"+ + "\u0151\u00a1\u0000\u0591\u0592\u0001\u0000\u0000\u0000\u0592\u0593\u0006"+ + "\u00bd\u0011\u0000\u0593\u0594\u0006\u00bd\u000b\u0000\u0594\u0595\u0006"+ + "\u00bd\t\u0000\u0595\u018a\u0001\u0000\u0000\u0000\u0596\u0597\u0003c"+ + "*\u0000\u0597\u0598\u0001\u0000\u0000\u0000\u0598\u0599\u0006\u00be\u0012"+ + "\u0000\u0599\u059a\u0006\u00be\u000b\u0000\u059a\u059b\u0006\u00be\t\u0000"+ + "\u059b\u018c\u0001\u0000\u0000\u0000\u059c\u059d\u00037\u0014\u0000\u059d"+ + "\u059e\u0001\u0000\u0000\u0000\u059e\u059f\u0006\u00bf\n\u0000\u059f\u018e"+ + "\u0001\u0000\u0000\u0000\u05a0\u05a1\u00039\u0015\u0000\u05a1\u05a2\u0001"+ + "\u0000\u0000\u0000\u05a2\u05a3\u0006\u00c0\n\u0000\u05a3\u0190\u0001\u0000"+ + "\u0000\u0000\u05a4\u05a5\u0003;\u0016\u0000\u05a5\u05a6\u0001\u0000\u0000"+ + "\u0000\u05a6\u05a7\u0006\u00c1\n\u0000\u05a7\u0192\u0001\u0000\u0000\u0000"+ + "\u05a8\u05a9\u0003\u00adO\u0000\u05a9\u05aa\u0001\u0000\u0000\u0000\u05aa"+ + "\u05ab\u0006\u00c2\u000b\u0000\u05ab\u05ac\u0006\u00c2\u0000\u0000\u05ac"+ + "\u05ad\u0006\u00c2\u001e\u0000\u05ad\u0194\u0001\u0000\u0000\u0000\u05ae"+ + "\u05af\u0003\u00a9M\u0000\u05af\u05b0\u0001\u0000\u0000\u0000\u05b0\u05b1"+ + "\u0006\u00c3\u000b\u0000\u05b1\u05b2\u0006\u00c3\u0000\u0000\u05b2\u05b3"+ + "\u0006\u00c3\u001f\u0000\u05b3\u0196\u0001\u0000\u0000\u0000\u05b4\u05b5"+ + "\u0003Y%\u0000\u05b5\u05b6\u0001\u0000\u0000\u0000\u05b6\u05b7\u0006\u00c4"+ + "\u000b\u0000\u05b7\u05b8\u0006\u00c4\u0000\u0000\u05b8\u05b9\u0006\u00c4"+ + "#\u0000\u05b9\u0198\u0001\u0000\u0000\u0000\u05ba\u05bb\u0003=\u0017\u0000"+ + "\u05bb\u05bc\u0001\u0000\u0000\u0000\u05bc\u05bd\u0006\u00c5\u000f\u0000"+ + "\u05bd\u05be\u0006\u00c5\u000b\u0000\u05be\u019a\u0001\u0000\u0000\u0000"+ + "A\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e"+ + "\u0243\u024d\u0251\u0254\u025d\u025f\u026a\u027d\u0282\u028b\u0292\u0297"+ + "\u0299\u02a4\u02ac\u02af\u02b1\u02b6\u02bb\u02c1\u02c8\u02cd\u02d3\u02d6"+ + "\u02de\u02e2\u0366\u036b\u0372\u0374\u0384\u0389\u038e\u0390\u0396\u03e3"+ + "\u03e8\u0417\u041b\u0420\u0425\u042a\u042c\u0430\u0432\u0487\u048b\u0490"+ + "\u051b\u051d$\u0005\u0001\u0000\u0005\u0004\u0000\u0005\u0006\u0000\u0005"+ + "\u0002\u0000\u0005\u0003\u0000\u0005\b\u0000\u0005\u0005\u0000\u0005\t"+ + "\u0000\u0005\u000b\u0000\u0005\r\u0000\u0000\u0001\u0000\u0004\u0000\u0000"+ + "\u0007\u0010\u0000\u0007A\u0000\u0005\u0000\u0000\u0007\u0018\u0000\u0007"+ + "B\u0000\u0007h\u0000\u0007!\u0000\u0007\u001f\u0000\u0007L\u0000\u0007"+ + "\u0019\u0000\u0007#\u0000\u0007/\u0000\u0007@\u0000\u0007P\u0000\u0005"+ + "\n\u0000\u0005\u0007\u0000\u0007Z\u0000\u0007Y\u0000\u0007D\u0000\u0007"+ + "C\u0000\u0007X\u0000\u0005\f\u0000\u0005\u000e\u0000\u0007\u001c\u0000"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp index e718d402982ed..22d8ec32f3d92 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp @@ -310,4 +310,4 @@ inlinestatsCommand atn: -[4, 1, 120, 604, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 134, 8, 1, 10, 1, 12, 1, 137, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 145, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 163, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 175, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 182, 8, 5, 10, 5, 12, 5, 185, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 192, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 198, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 206, 8, 5, 10, 5, 12, 5, 209, 9, 5, 1, 6, 1, 6, 3, 6, 213, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 220, 8, 6, 1, 6, 1, 6, 1, 6, 3, 6, 225, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 236, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 242, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 5, 9, 250, 8, 9, 10, 9, 12, 9, 253, 9, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 263, 8, 10, 1, 10, 1, 10, 1, 10, 5, 10, 268, 8, 10, 10, 10, 12, 10, 271, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 279, 8, 11, 10, 11, 12, 11, 282, 9, 11, 3, 11, 284, 8, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 290, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 5, 15, 300, 8, 15, 10, 15, 12, 15, 303, 9, 15, 1, 16, 1, 16, 1, 16, 3, 16, 308, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 316, 8, 17, 10, 17, 12, 17, 319, 9, 17, 1, 17, 3, 17, 322, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 327, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 3, 21, 337, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 343, 8, 22, 10, 22, 12, 22, 346, 9, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 356, 8, 24, 10, 24, 12, 24, 359, 9, 24, 1, 24, 3, 24, 362, 8, 24, 1, 24, 1, 24, 3, 24, 366, 8, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 3, 26, 373, 8, 26, 1, 26, 1, 26, 3, 26, 377, 8, 26, 1, 27, 1, 27, 1, 27, 5, 27, 382, 8, 27, 10, 27, 12, 27, 385, 9, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 391, 8, 28, 1, 29, 1, 29, 1, 29, 5, 29, 396, 8, 29, 10, 29, 12, 29, 399, 9, 29, 1, 30, 1, 30, 1, 30, 5, 30, 404, 8, 30, 10, 30, 12, 30, 407, 9, 30, 1, 31, 1, 31, 1, 31, 5, 31, 412, 8, 31, 10, 31, 12, 31, 415, 9, 31, 1, 32, 1, 32, 1, 33, 1, 33, 3, 33, 421, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 436, 8, 34, 10, 34, 12, 34, 439, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 447, 8, 34, 10, 34, 12, 34, 450, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 458, 8, 34, 10, 34, 12, 34, 461, 9, 34, 1, 34, 1, 34, 3, 34, 465, 8, 34, 1, 35, 1, 35, 3, 35, 469, 8, 35, 1, 36, 1, 36, 3, 36, 473, 8, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 5, 38, 482, 8, 38, 10, 38, 12, 38, 485, 9, 38, 1, 39, 1, 39, 3, 39, 489, 8, 39, 1, 39, 1, 39, 3, 39, 493, 8, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 505, 8, 42, 10, 42, 12, 42, 508, 9, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 518, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 5, 47, 530, 8, 47, 10, 47, 12, 47, 533, 9, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 50, 1, 50, 3, 50, 543, 8, 50, 1, 51, 3, 51, 546, 8, 51, 1, 51, 1, 51, 1, 52, 3, 52, 551, 8, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 573, 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 579, 8, 58, 10, 58, 12, 58, 582, 9, 58, 3, 58, 584, 8, 58, 1, 59, 1, 59, 1, 59, 3, 59, 589, 8, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 602, 8, 61, 1, 61, 0, 4, 2, 10, 18, 20, 62, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 0, 8, 1, 0, 58, 59, 1, 0, 60, 62, 2, 0, 25, 25, 76, 76, 1, 0, 67, 68, 2, 0, 30, 30, 34, 34, 2, 0, 37, 37, 40, 40, 2, 0, 36, 36, 50, 50, 2, 0, 51, 51, 53, 57, 630, 0, 124, 1, 0, 0, 0, 2, 127, 1, 0, 0, 0, 4, 144, 1, 0, 0, 0, 6, 162, 1, 0, 0, 0, 8, 164, 1, 0, 0, 0, 10, 197, 1, 0, 0, 0, 12, 224, 1, 0, 0, 0, 14, 226, 1, 0, 0, 0, 16, 235, 1, 0, 0, 0, 18, 241, 1, 0, 0, 0, 20, 262, 1, 0, 0, 0, 22, 272, 1, 0, 0, 0, 24, 289, 1, 0, 0, 0, 26, 291, 1, 0, 0, 0, 28, 293, 1, 0, 0, 0, 30, 296, 1, 0, 0, 0, 32, 307, 1, 0, 0, 0, 34, 311, 1, 0, 0, 0, 36, 326, 1, 0, 0, 0, 38, 330, 1, 0, 0, 0, 40, 332, 1, 0, 0, 0, 42, 336, 1, 0, 0, 0, 44, 338, 1, 0, 0, 0, 46, 347, 1, 0, 0, 0, 48, 351, 1, 0, 0, 0, 50, 367, 1, 0, 0, 0, 52, 370, 1, 0, 0, 0, 54, 378, 1, 0, 0, 0, 56, 386, 1, 0, 0, 0, 58, 392, 1, 0, 0, 0, 60, 400, 1, 0, 0, 0, 62, 408, 1, 0, 0, 0, 64, 416, 1, 0, 0, 0, 66, 420, 1, 0, 0, 0, 68, 464, 1, 0, 0, 0, 70, 468, 1, 0, 0, 0, 72, 472, 1, 0, 0, 0, 74, 474, 1, 0, 0, 0, 76, 477, 1, 0, 0, 0, 78, 486, 1, 0, 0, 0, 80, 494, 1, 0, 0, 0, 82, 497, 1, 0, 0, 0, 84, 500, 1, 0, 0, 0, 86, 509, 1, 0, 0, 0, 88, 513, 1, 0, 0, 0, 90, 519, 1, 0, 0, 0, 92, 523, 1, 0, 0, 0, 94, 526, 1, 0, 0, 0, 96, 534, 1, 0, 0, 0, 98, 538, 1, 0, 0, 0, 100, 542, 1, 0, 0, 0, 102, 545, 1, 0, 0, 0, 104, 550, 1, 0, 0, 0, 106, 554, 1, 0, 0, 0, 108, 556, 1, 0, 0, 0, 110, 558, 1, 0, 0, 0, 112, 561, 1, 0, 0, 0, 114, 565, 1, 0, 0, 0, 116, 568, 1, 0, 0, 0, 118, 588, 1, 0, 0, 0, 120, 592, 1, 0, 0, 0, 122, 597, 1, 0, 0, 0, 124, 125, 3, 2, 1, 0, 125, 126, 5, 0, 0, 1, 126, 1, 1, 0, 0, 0, 127, 128, 6, 1, -1, 0, 128, 129, 3, 4, 2, 0, 129, 135, 1, 0, 0, 0, 130, 131, 10, 1, 0, 0, 131, 132, 5, 24, 0, 0, 132, 134, 3, 6, 3, 0, 133, 130, 1, 0, 0, 0, 134, 137, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 3, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 138, 145, 3, 110, 55, 0, 139, 145, 3, 34, 17, 0, 140, 145, 3, 28, 14, 0, 141, 145, 3, 114, 57, 0, 142, 143, 4, 2, 1, 0, 143, 145, 3, 48, 24, 0, 144, 138, 1, 0, 0, 0, 144, 139, 1, 0, 0, 0, 144, 140, 1, 0, 0, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 5, 1, 0, 0, 0, 146, 163, 3, 50, 25, 0, 147, 163, 3, 8, 4, 0, 148, 163, 3, 80, 40, 0, 149, 163, 3, 74, 37, 0, 150, 163, 3, 52, 26, 0, 151, 163, 3, 76, 38, 0, 152, 163, 3, 82, 41, 0, 153, 163, 3, 84, 42, 0, 154, 163, 3, 88, 44, 0, 155, 163, 3, 90, 45, 0, 156, 163, 3, 116, 58, 0, 157, 163, 3, 92, 46, 0, 158, 159, 4, 3, 2, 0, 159, 163, 3, 122, 61, 0, 160, 161, 4, 3, 3, 0, 161, 163, 3, 120, 60, 0, 162, 146, 1, 0, 0, 0, 162, 147, 1, 0, 0, 0, 162, 148, 1, 0, 0, 0, 162, 149, 1, 0, 0, 0, 162, 150, 1, 0, 0, 0, 162, 151, 1, 0, 0, 0, 162, 152, 1, 0, 0, 0, 162, 153, 1, 0, 0, 0, 162, 154, 1, 0, 0, 0, 162, 155, 1, 0, 0, 0, 162, 156, 1, 0, 0, 0, 162, 157, 1, 0, 0, 0, 162, 158, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 7, 1, 0, 0, 0, 164, 165, 5, 16, 0, 0, 165, 166, 3, 10, 5, 0, 166, 9, 1, 0, 0, 0, 167, 168, 6, 5, -1, 0, 168, 169, 5, 43, 0, 0, 169, 198, 3, 10, 5, 8, 170, 198, 3, 16, 8, 0, 171, 198, 3, 12, 6, 0, 172, 174, 3, 16, 8, 0, 173, 175, 5, 43, 0, 0, 174, 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 38, 0, 0, 177, 178, 5, 42, 0, 0, 178, 183, 3, 16, 8, 0, 179, 180, 5, 33, 0, 0, 180, 182, 3, 16, 8, 0, 181, 179, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 187, 5, 49, 0, 0, 187, 198, 1, 0, 0, 0, 188, 189, 3, 16, 8, 0, 189, 191, 5, 39, 0, 0, 190, 192, 5, 43, 0, 0, 191, 190, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 5, 44, 0, 0, 194, 198, 1, 0, 0, 0, 195, 196, 4, 5, 4, 0, 196, 198, 3, 14, 7, 0, 197, 167, 1, 0, 0, 0, 197, 170, 1, 0, 0, 0, 197, 171, 1, 0, 0, 0, 197, 172, 1, 0, 0, 0, 197, 188, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 207, 1, 0, 0, 0, 199, 200, 10, 5, 0, 0, 200, 201, 5, 29, 0, 0, 201, 206, 3, 10, 5, 6, 202, 203, 10, 4, 0, 0, 203, 204, 5, 46, 0, 0, 204, 206, 3, 10, 5, 5, 205, 199, 1, 0, 0, 0, 205, 202, 1, 0, 0, 0, 206, 209, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 11, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 210, 212, 3, 16, 8, 0, 211, 213, 5, 43, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 41, 0, 0, 215, 216, 3, 106, 53, 0, 216, 225, 1, 0, 0, 0, 217, 219, 3, 16, 8, 0, 218, 220, 5, 43, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 5, 48, 0, 0, 222, 223, 3, 106, 53, 0, 223, 225, 1, 0, 0, 0, 224, 210, 1, 0, 0, 0, 224, 217, 1, 0, 0, 0, 225, 13, 1, 0, 0, 0, 226, 227, 3, 16, 8, 0, 227, 228, 5, 63, 0, 0, 228, 229, 3, 106, 53, 0, 229, 15, 1, 0, 0, 0, 230, 236, 3, 18, 9, 0, 231, 232, 3, 18, 9, 0, 232, 233, 3, 108, 54, 0, 233, 234, 3, 18, 9, 0, 234, 236, 1, 0, 0, 0, 235, 230, 1, 0, 0, 0, 235, 231, 1, 0, 0, 0, 236, 17, 1, 0, 0, 0, 237, 238, 6, 9, -1, 0, 238, 242, 3, 20, 10, 0, 239, 240, 7, 0, 0, 0, 240, 242, 3, 18, 9, 3, 241, 237, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 251, 1, 0, 0, 0, 243, 244, 10, 2, 0, 0, 244, 245, 7, 1, 0, 0, 245, 250, 3, 18, 9, 3, 246, 247, 10, 1, 0, 0, 247, 248, 7, 0, 0, 0, 248, 250, 3, 18, 9, 2, 249, 243, 1, 0, 0, 0, 249, 246, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 19, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 254, 255, 6, 10, -1, 0, 255, 263, 3, 68, 34, 0, 256, 263, 3, 58, 29, 0, 257, 263, 3, 22, 11, 0, 258, 259, 5, 42, 0, 0, 259, 260, 3, 10, 5, 0, 260, 261, 5, 49, 0, 0, 261, 263, 1, 0, 0, 0, 262, 254, 1, 0, 0, 0, 262, 256, 1, 0, 0, 0, 262, 257, 1, 0, 0, 0, 262, 258, 1, 0, 0, 0, 263, 269, 1, 0, 0, 0, 264, 265, 10, 1, 0, 0, 265, 266, 5, 32, 0, 0, 266, 268, 3, 26, 13, 0, 267, 264, 1, 0, 0, 0, 268, 271, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 21, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 272, 273, 3, 24, 12, 0, 273, 283, 5, 42, 0, 0, 274, 284, 5, 60, 0, 0, 275, 280, 3, 10, 5, 0, 276, 277, 5, 33, 0, 0, 277, 279, 3, 10, 5, 0, 278, 276, 1, 0, 0, 0, 279, 282, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 284, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 274, 1, 0, 0, 0, 283, 275, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 5, 49, 0, 0, 286, 23, 1, 0, 0, 0, 287, 290, 5, 63, 0, 0, 288, 290, 3, 72, 36, 0, 289, 287, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 25, 1, 0, 0, 0, 291, 292, 3, 64, 32, 0, 292, 27, 1, 0, 0, 0, 293, 294, 5, 12, 0, 0, 294, 295, 3, 30, 15, 0, 295, 29, 1, 0, 0, 0, 296, 301, 3, 32, 16, 0, 297, 298, 5, 33, 0, 0, 298, 300, 3, 32, 16, 0, 299, 297, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 31, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 305, 3, 58, 29, 0, 305, 306, 5, 31, 0, 0, 306, 308, 1, 0, 0, 0, 307, 304, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 3, 10, 5, 0, 310, 33, 1, 0, 0, 0, 311, 312, 5, 6, 0, 0, 312, 317, 3, 36, 18, 0, 313, 314, 5, 33, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 321, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 322, 3, 42, 21, 0, 321, 320, 1, 0, 0, 0, 321, 322, 1, 0, 0, 0, 322, 35, 1, 0, 0, 0, 323, 324, 3, 38, 19, 0, 324, 325, 5, 104, 0, 0, 325, 327, 1, 0, 0, 0, 326, 323, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 329, 3, 40, 20, 0, 329, 37, 1, 0, 0, 0, 330, 331, 5, 76, 0, 0, 331, 39, 1, 0, 0, 0, 332, 333, 7, 2, 0, 0, 333, 41, 1, 0, 0, 0, 334, 337, 3, 44, 22, 0, 335, 337, 3, 46, 23, 0, 336, 334, 1, 0, 0, 0, 336, 335, 1, 0, 0, 0, 337, 43, 1, 0, 0, 0, 338, 339, 5, 75, 0, 0, 339, 344, 5, 76, 0, 0, 340, 341, 5, 33, 0, 0, 341, 343, 5, 76, 0, 0, 342, 340, 1, 0, 0, 0, 343, 346, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 45, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 347, 348, 5, 65, 0, 0, 348, 349, 3, 44, 22, 0, 349, 350, 5, 66, 0, 0, 350, 47, 1, 0, 0, 0, 351, 352, 5, 19, 0, 0, 352, 357, 3, 36, 18, 0, 353, 354, 5, 33, 0, 0, 354, 356, 3, 36, 18, 0, 355, 353, 1, 0, 0, 0, 356, 359, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 361, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 360, 362, 3, 54, 27, 0, 361, 360, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 365, 1, 0, 0, 0, 363, 364, 5, 28, 0, 0, 364, 366, 3, 30, 15, 0, 365, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 49, 1, 0, 0, 0, 367, 368, 5, 4, 0, 0, 368, 369, 3, 30, 15, 0, 369, 51, 1, 0, 0, 0, 370, 372, 5, 15, 0, 0, 371, 373, 3, 54, 27, 0, 372, 371, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 376, 1, 0, 0, 0, 374, 375, 5, 28, 0, 0, 375, 377, 3, 30, 15, 0, 376, 374, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 53, 1, 0, 0, 0, 378, 383, 3, 56, 28, 0, 379, 380, 5, 33, 0, 0, 380, 382, 3, 56, 28, 0, 381, 379, 1, 0, 0, 0, 382, 385, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 383, 384, 1, 0, 0, 0, 384, 55, 1, 0, 0, 0, 385, 383, 1, 0, 0, 0, 386, 387, 3, 32, 16, 0, 387, 390, 4, 28, 10, 0, 388, 389, 5, 16, 0, 0, 389, 391, 3, 10, 5, 0, 390, 388, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 57, 1, 0, 0, 0, 392, 397, 3, 72, 36, 0, 393, 394, 5, 35, 0, 0, 394, 396, 3, 72, 36, 0, 395, 393, 1, 0, 0, 0, 396, 399, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 59, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 400, 405, 3, 66, 33, 0, 401, 402, 5, 35, 0, 0, 402, 404, 3, 66, 33, 0, 403, 401, 1, 0, 0, 0, 404, 407, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 61, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 408, 413, 3, 60, 30, 0, 409, 410, 5, 33, 0, 0, 410, 412, 3, 60, 30, 0, 411, 409, 1, 0, 0, 0, 412, 415, 1, 0, 0, 0, 413, 411, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 63, 1, 0, 0, 0, 415, 413, 1, 0, 0, 0, 416, 417, 7, 3, 0, 0, 417, 65, 1, 0, 0, 0, 418, 421, 5, 80, 0, 0, 419, 421, 3, 70, 35, 0, 420, 418, 1, 0, 0, 0, 420, 419, 1, 0, 0, 0, 421, 67, 1, 0, 0, 0, 422, 465, 5, 44, 0, 0, 423, 424, 3, 104, 52, 0, 424, 425, 5, 67, 0, 0, 425, 465, 1, 0, 0, 0, 426, 465, 3, 102, 51, 0, 427, 465, 3, 104, 52, 0, 428, 465, 3, 98, 49, 0, 429, 465, 3, 70, 35, 0, 430, 465, 3, 106, 53, 0, 431, 432, 5, 65, 0, 0, 432, 437, 3, 100, 50, 0, 433, 434, 5, 33, 0, 0, 434, 436, 3, 100, 50, 0, 435, 433, 1, 0, 0, 0, 436, 439, 1, 0, 0, 0, 437, 435, 1, 0, 0, 0, 437, 438, 1, 0, 0, 0, 438, 440, 1, 0, 0, 0, 439, 437, 1, 0, 0, 0, 440, 441, 5, 66, 0, 0, 441, 465, 1, 0, 0, 0, 442, 443, 5, 65, 0, 0, 443, 448, 3, 98, 49, 0, 444, 445, 5, 33, 0, 0, 445, 447, 3, 98, 49, 0, 446, 444, 1, 0, 0, 0, 447, 450, 1, 0, 0, 0, 448, 446, 1, 0, 0, 0, 448, 449, 1, 0, 0, 0, 449, 451, 1, 0, 0, 0, 450, 448, 1, 0, 0, 0, 451, 452, 5, 66, 0, 0, 452, 465, 1, 0, 0, 0, 453, 454, 5, 65, 0, 0, 454, 459, 3, 106, 53, 0, 455, 456, 5, 33, 0, 0, 456, 458, 3, 106, 53, 0, 457, 455, 1, 0, 0, 0, 458, 461, 1, 0, 0, 0, 459, 457, 1, 0, 0, 0, 459, 460, 1, 0, 0, 0, 460, 462, 1, 0, 0, 0, 461, 459, 1, 0, 0, 0, 462, 463, 5, 66, 0, 0, 463, 465, 1, 0, 0, 0, 464, 422, 1, 0, 0, 0, 464, 423, 1, 0, 0, 0, 464, 426, 1, 0, 0, 0, 464, 427, 1, 0, 0, 0, 464, 428, 1, 0, 0, 0, 464, 429, 1, 0, 0, 0, 464, 430, 1, 0, 0, 0, 464, 431, 1, 0, 0, 0, 464, 442, 1, 0, 0, 0, 464, 453, 1, 0, 0, 0, 465, 69, 1, 0, 0, 0, 466, 469, 5, 47, 0, 0, 467, 469, 5, 64, 0, 0, 468, 466, 1, 0, 0, 0, 468, 467, 1, 0, 0, 0, 469, 71, 1, 0, 0, 0, 470, 473, 3, 64, 32, 0, 471, 473, 3, 70, 35, 0, 472, 470, 1, 0, 0, 0, 472, 471, 1, 0, 0, 0, 473, 73, 1, 0, 0, 0, 474, 475, 5, 9, 0, 0, 475, 476, 5, 26, 0, 0, 476, 75, 1, 0, 0, 0, 477, 478, 5, 14, 0, 0, 478, 483, 3, 78, 39, 0, 479, 480, 5, 33, 0, 0, 480, 482, 3, 78, 39, 0, 481, 479, 1, 0, 0, 0, 482, 485, 1, 0, 0, 0, 483, 481, 1, 0, 0, 0, 483, 484, 1, 0, 0, 0, 484, 77, 1, 0, 0, 0, 485, 483, 1, 0, 0, 0, 486, 488, 3, 10, 5, 0, 487, 489, 7, 4, 0, 0, 488, 487, 1, 0, 0, 0, 488, 489, 1, 0, 0, 0, 489, 492, 1, 0, 0, 0, 490, 491, 5, 45, 0, 0, 491, 493, 7, 5, 0, 0, 492, 490, 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 79, 1, 0, 0, 0, 494, 495, 5, 8, 0, 0, 495, 496, 3, 62, 31, 0, 496, 81, 1, 0, 0, 0, 497, 498, 5, 2, 0, 0, 498, 499, 3, 62, 31, 0, 499, 83, 1, 0, 0, 0, 500, 501, 5, 11, 0, 0, 501, 506, 3, 86, 43, 0, 502, 503, 5, 33, 0, 0, 503, 505, 3, 86, 43, 0, 504, 502, 1, 0, 0, 0, 505, 508, 1, 0, 0, 0, 506, 504, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 85, 1, 0, 0, 0, 508, 506, 1, 0, 0, 0, 509, 510, 3, 60, 30, 0, 510, 511, 5, 84, 0, 0, 511, 512, 3, 60, 30, 0, 512, 87, 1, 0, 0, 0, 513, 514, 5, 1, 0, 0, 514, 515, 3, 20, 10, 0, 515, 517, 3, 106, 53, 0, 516, 518, 3, 94, 47, 0, 517, 516, 1, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, 89, 1, 0, 0, 0, 519, 520, 5, 7, 0, 0, 520, 521, 3, 20, 10, 0, 521, 522, 3, 106, 53, 0, 522, 91, 1, 0, 0, 0, 523, 524, 5, 10, 0, 0, 524, 525, 3, 58, 29, 0, 525, 93, 1, 0, 0, 0, 526, 531, 3, 96, 48, 0, 527, 528, 5, 33, 0, 0, 528, 530, 3, 96, 48, 0, 529, 527, 1, 0, 0, 0, 530, 533, 1, 0, 0, 0, 531, 529, 1, 0, 0, 0, 531, 532, 1, 0, 0, 0, 532, 95, 1, 0, 0, 0, 533, 531, 1, 0, 0, 0, 534, 535, 3, 64, 32, 0, 535, 536, 5, 31, 0, 0, 536, 537, 3, 68, 34, 0, 537, 97, 1, 0, 0, 0, 538, 539, 7, 6, 0, 0, 539, 99, 1, 0, 0, 0, 540, 543, 3, 102, 51, 0, 541, 543, 3, 104, 52, 0, 542, 540, 1, 0, 0, 0, 542, 541, 1, 0, 0, 0, 543, 101, 1, 0, 0, 0, 544, 546, 7, 0, 0, 0, 545, 544, 1, 0, 0, 0, 545, 546, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 548, 5, 27, 0, 0, 548, 103, 1, 0, 0, 0, 549, 551, 7, 0, 0, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 552, 1, 0, 0, 0, 552, 553, 5, 26, 0, 0, 553, 105, 1, 0, 0, 0, 554, 555, 5, 25, 0, 0, 555, 107, 1, 0, 0, 0, 556, 557, 7, 7, 0, 0, 557, 109, 1, 0, 0, 0, 558, 559, 5, 5, 0, 0, 559, 560, 3, 112, 56, 0, 560, 111, 1, 0, 0, 0, 561, 562, 5, 65, 0, 0, 562, 563, 3, 2, 1, 0, 563, 564, 5, 66, 0, 0, 564, 113, 1, 0, 0, 0, 565, 566, 5, 13, 0, 0, 566, 567, 5, 100, 0, 0, 567, 115, 1, 0, 0, 0, 568, 569, 5, 3, 0, 0, 569, 572, 5, 90, 0, 0, 570, 571, 5, 88, 0, 0, 571, 573, 3, 60, 30, 0, 572, 570, 1, 0, 0, 0, 572, 573, 1, 0, 0, 0, 573, 583, 1, 0, 0, 0, 574, 575, 5, 89, 0, 0, 575, 580, 3, 118, 59, 0, 576, 577, 5, 33, 0, 0, 577, 579, 3, 118, 59, 0, 578, 576, 1, 0, 0, 0, 579, 582, 1, 0, 0, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 584, 1, 0, 0, 0, 582, 580, 1, 0, 0, 0, 583, 574, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 117, 1, 0, 0, 0, 585, 586, 3, 60, 30, 0, 586, 587, 5, 31, 0, 0, 587, 589, 1, 0, 0, 0, 588, 585, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 591, 3, 60, 30, 0, 591, 119, 1, 0, 0, 0, 592, 593, 5, 18, 0, 0, 593, 594, 3, 36, 18, 0, 594, 595, 5, 88, 0, 0, 595, 596, 3, 62, 31, 0, 596, 121, 1, 0, 0, 0, 597, 598, 5, 17, 0, 0, 598, 601, 3, 54, 27, 0, 599, 600, 5, 28, 0, 0, 600, 602, 3, 30, 15, 0, 601, 599, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 123, 1, 0, 0, 0, 59, 135, 144, 162, 174, 183, 191, 197, 205, 207, 212, 219, 224, 235, 241, 249, 251, 262, 269, 280, 283, 289, 301, 307, 317, 321, 326, 336, 344, 357, 361, 365, 372, 376, 383, 390, 397, 405, 413, 420, 437, 448, 459, 464, 468, 472, 483, 488, 492, 506, 517, 531, 542, 545, 550, 572, 580, 583, 588, 601] \ No newline at end of file +[4, 1, 120, 603, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 134, 8, 1, 10, 1, 12, 1, 137, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 145, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 163, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 175, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 182, 8, 5, 10, 5, 12, 5, 185, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 192, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 198, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 206, 8, 5, 10, 5, 12, 5, 209, 9, 5, 1, 6, 1, 6, 3, 6, 213, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 220, 8, 6, 1, 6, 1, 6, 1, 6, 3, 6, 225, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 236, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 242, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 5, 9, 250, 8, 9, 10, 9, 12, 9, 253, 9, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 263, 8, 10, 1, 10, 1, 10, 1, 10, 5, 10, 268, 8, 10, 10, 10, 12, 10, 271, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 279, 8, 11, 10, 11, 12, 11, 282, 9, 11, 3, 11, 284, 8, 11, 1, 11, 1, 11, 1, 12, 1, 12, 3, 12, 290, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 5, 15, 300, 8, 15, 10, 15, 12, 15, 303, 9, 15, 1, 16, 1, 16, 1, 16, 3, 16, 308, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 316, 8, 17, 10, 17, 12, 17, 319, 9, 17, 1, 17, 3, 17, 322, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 327, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 3, 21, 337, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 343, 8, 22, 10, 22, 12, 22, 346, 9, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 356, 8, 24, 10, 24, 12, 24, 359, 9, 24, 1, 24, 3, 24, 362, 8, 24, 1, 24, 1, 24, 3, 24, 366, 8, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 3, 26, 373, 8, 26, 1, 26, 1, 26, 3, 26, 377, 8, 26, 1, 27, 1, 27, 1, 27, 5, 27, 382, 8, 27, 10, 27, 12, 27, 385, 9, 27, 1, 28, 1, 28, 1, 28, 3, 28, 390, 8, 28, 1, 29, 1, 29, 1, 29, 5, 29, 395, 8, 29, 10, 29, 12, 29, 398, 9, 29, 1, 30, 1, 30, 1, 30, 5, 30, 403, 8, 30, 10, 30, 12, 30, 406, 9, 30, 1, 31, 1, 31, 1, 31, 5, 31, 411, 8, 31, 10, 31, 12, 31, 414, 9, 31, 1, 32, 1, 32, 1, 33, 1, 33, 3, 33, 420, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 435, 8, 34, 10, 34, 12, 34, 438, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 446, 8, 34, 10, 34, 12, 34, 449, 9, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 457, 8, 34, 10, 34, 12, 34, 460, 9, 34, 1, 34, 1, 34, 3, 34, 464, 8, 34, 1, 35, 1, 35, 3, 35, 468, 8, 35, 1, 36, 1, 36, 3, 36, 472, 8, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 5, 38, 481, 8, 38, 10, 38, 12, 38, 484, 9, 38, 1, 39, 1, 39, 3, 39, 488, 8, 39, 1, 39, 1, 39, 3, 39, 492, 8, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 504, 8, 42, 10, 42, 12, 42, 507, 9, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 517, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 5, 47, 529, 8, 47, 10, 47, 12, 47, 532, 9, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 50, 1, 50, 3, 50, 542, 8, 50, 1, 51, 3, 51, 545, 8, 51, 1, 51, 1, 51, 1, 52, 3, 52, 550, 8, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 572, 8, 58, 1, 58, 1, 58, 1, 58, 1, 58, 5, 58, 578, 8, 58, 10, 58, 12, 58, 581, 9, 58, 3, 58, 583, 8, 58, 1, 59, 1, 59, 1, 59, 3, 59, 588, 8, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 3, 61, 601, 8, 61, 1, 61, 0, 4, 2, 10, 18, 20, 62, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 0, 8, 1, 0, 58, 59, 1, 0, 60, 62, 2, 0, 25, 25, 76, 76, 1, 0, 67, 68, 2, 0, 30, 30, 34, 34, 2, 0, 37, 37, 40, 40, 2, 0, 36, 36, 50, 50, 2, 0, 51, 51, 53, 57, 629, 0, 124, 1, 0, 0, 0, 2, 127, 1, 0, 0, 0, 4, 144, 1, 0, 0, 0, 6, 162, 1, 0, 0, 0, 8, 164, 1, 0, 0, 0, 10, 197, 1, 0, 0, 0, 12, 224, 1, 0, 0, 0, 14, 226, 1, 0, 0, 0, 16, 235, 1, 0, 0, 0, 18, 241, 1, 0, 0, 0, 20, 262, 1, 0, 0, 0, 22, 272, 1, 0, 0, 0, 24, 289, 1, 0, 0, 0, 26, 291, 1, 0, 0, 0, 28, 293, 1, 0, 0, 0, 30, 296, 1, 0, 0, 0, 32, 307, 1, 0, 0, 0, 34, 311, 1, 0, 0, 0, 36, 326, 1, 0, 0, 0, 38, 330, 1, 0, 0, 0, 40, 332, 1, 0, 0, 0, 42, 336, 1, 0, 0, 0, 44, 338, 1, 0, 0, 0, 46, 347, 1, 0, 0, 0, 48, 351, 1, 0, 0, 0, 50, 367, 1, 0, 0, 0, 52, 370, 1, 0, 0, 0, 54, 378, 1, 0, 0, 0, 56, 386, 1, 0, 0, 0, 58, 391, 1, 0, 0, 0, 60, 399, 1, 0, 0, 0, 62, 407, 1, 0, 0, 0, 64, 415, 1, 0, 0, 0, 66, 419, 1, 0, 0, 0, 68, 463, 1, 0, 0, 0, 70, 467, 1, 0, 0, 0, 72, 471, 1, 0, 0, 0, 74, 473, 1, 0, 0, 0, 76, 476, 1, 0, 0, 0, 78, 485, 1, 0, 0, 0, 80, 493, 1, 0, 0, 0, 82, 496, 1, 0, 0, 0, 84, 499, 1, 0, 0, 0, 86, 508, 1, 0, 0, 0, 88, 512, 1, 0, 0, 0, 90, 518, 1, 0, 0, 0, 92, 522, 1, 0, 0, 0, 94, 525, 1, 0, 0, 0, 96, 533, 1, 0, 0, 0, 98, 537, 1, 0, 0, 0, 100, 541, 1, 0, 0, 0, 102, 544, 1, 0, 0, 0, 104, 549, 1, 0, 0, 0, 106, 553, 1, 0, 0, 0, 108, 555, 1, 0, 0, 0, 110, 557, 1, 0, 0, 0, 112, 560, 1, 0, 0, 0, 114, 564, 1, 0, 0, 0, 116, 567, 1, 0, 0, 0, 118, 587, 1, 0, 0, 0, 120, 591, 1, 0, 0, 0, 122, 596, 1, 0, 0, 0, 124, 125, 3, 2, 1, 0, 125, 126, 5, 0, 0, 1, 126, 1, 1, 0, 0, 0, 127, 128, 6, 1, -1, 0, 128, 129, 3, 4, 2, 0, 129, 135, 1, 0, 0, 0, 130, 131, 10, 1, 0, 0, 131, 132, 5, 24, 0, 0, 132, 134, 3, 6, 3, 0, 133, 130, 1, 0, 0, 0, 134, 137, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 3, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 138, 145, 3, 110, 55, 0, 139, 145, 3, 34, 17, 0, 140, 145, 3, 28, 14, 0, 141, 145, 3, 114, 57, 0, 142, 143, 4, 2, 1, 0, 143, 145, 3, 48, 24, 0, 144, 138, 1, 0, 0, 0, 144, 139, 1, 0, 0, 0, 144, 140, 1, 0, 0, 0, 144, 141, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 5, 1, 0, 0, 0, 146, 163, 3, 50, 25, 0, 147, 163, 3, 8, 4, 0, 148, 163, 3, 80, 40, 0, 149, 163, 3, 74, 37, 0, 150, 163, 3, 52, 26, 0, 151, 163, 3, 76, 38, 0, 152, 163, 3, 82, 41, 0, 153, 163, 3, 84, 42, 0, 154, 163, 3, 88, 44, 0, 155, 163, 3, 90, 45, 0, 156, 163, 3, 116, 58, 0, 157, 163, 3, 92, 46, 0, 158, 159, 4, 3, 2, 0, 159, 163, 3, 122, 61, 0, 160, 161, 4, 3, 3, 0, 161, 163, 3, 120, 60, 0, 162, 146, 1, 0, 0, 0, 162, 147, 1, 0, 0, 0, 162, 148, 1, 0, 0, 0, 162, 149, 1, 0, 0, 0, 162, 150, 1, 0, 0, 0, 162, 151, 1, 0, 0, 0, 162, 152, 1, 0, 0, 0, 162, 153, 1, 0, 0, 0, 162, 154, 1, 0, 0, 0, 162, 155, 1, 0, 0, 0, 162, 156, 1, 0, 0, 0, 162, 157, 1, 0, 0, 0, 162, 158, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 163, 7, 1, 0, 0, 0, 164, 165, 5, 16, 0, 0, 165, 166, 3, 10, 5, 0, 166, 9, 1, 0, 0, 0, 167, 168, 6, 5, -1, 0, 168, 169, 5, 43, 0, 0, 169, 198, 3, 10, 5, 8, 170, 198, 3, 16, 8, 0, 171, 198, 3, 12, 6, 0, 172, 174, 3, 16, 8, 0, 173, 175, 5, 43, 0, 0, 174, 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, 5, 38, 0, 0, 177, 178, 5, 42, 0, 0, 178, 183, 3, 16, 8, 0, 179, 180, 5, 33, 0, 0, 180, 182, 3, 16, 8, 0, 181, 179, 1, 0, 0, 0, 182, 185, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 186, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 186, 187, 5, 49, 0, 0, 187, 198, 1, 0, 0, 0, 188, 189, 3, 16, 8, 0, 189, 191, 5, 39, 0, 0, 190, 192, 5, 43, 0, 0, 191, 190, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 194, 5, 44, 0, 0, 194, 198, 1, 0, 0, 0, 195, 196, 4, 5, 4, 0, 196, 198, 3, 14, 7, 0, 197, 167, 1, 0, 0, 0, 197, 170, 1, 0, 0, 0, 197, 171, 1, 0, 0, 0, 197, 172, 1, 0, 0, 0, 197, 188, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 207, 1, 0, 0, 0, 199, 200, 10, 5, 0, 0, 200, 201, 5, 29, 0, 0, 201, 206, 3, 10, 5, 6, 202, 203, 10, 4, 0, 0, 203, 204, 5, 46, 0, 0, 204, 206, 3, 10, 5, 5, 205, 199, 1, 0, 0, 0, 205, 202, 1, 0, 0, 0, 206, 209, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 11, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 210, 212, 3, 16, 8, 0, 211, 213, 5, 43, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 41, 0, 0, 215, 216, 3, 106, 53, 0, 216, 225, 1, 0, 0, 0, 217, 219, 3, 16, 8, 0, 218, 220, 5, 43, 0, 0, 219, 218, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 222, 5, 48, 0, 0, 222, 223, 3, 106, 53, 0, 223, 225, 1, 0, 0, 0, 224, 210, 1, 0, 0, 0, 224, 217, 1, 0, 0, 0, 225, 13, 1, 0, 0, 0, 226, 227, 3, 16, 8, 0, 227, 228, 5, 63, 0, 0, 228, 229, 3, 106, 53, 0, 229, 15, 1, 0, 0, 0, 230, 236, 3, 18, 9, 0, 231, 232, 3, 18, 9, 0, 232, 233, 3, 108, 54, 0, 233, 234, 3, 18, 9, 0, 234, 236, 1, 0, 0, 0, 235, 230, 1, 0, 0, 0, 235, 231, 1, 0, 0, 0, 236, 17, 1, 0, 0, 0, 237, 238, 6, 9, -1, 0, 238, 242, 3, 20, 10, 0, 239, 240, 7, 0, 0, 0, 240, 242, 3, 18, 9, 3, 241, 237, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 251, 1, 0, 0, 0, 243, 244, 10, 2, 0, 0, 244, 245, 7, 1, 0, 0, 245, 250, 3, 18, 9, 3, 246, 247, 10, 1, 0, 0, 247, 248, 7, 0, 0, 0, 248, 250, 3, 18, 9, 2, 249, 243, 1, 0, 0, 0, 249, 246, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 251, 252, 1, 0, 0, 0, 252, 19, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 254, 255, 6, 10, -1, 0, 255, 263, 3, 68, 34, 0, 256, 263, 3, 58, 29, 0, 257, 263, 3, 22, 11, 0, 258, 259, 5, 42, 0, 0, 259, 260, 3, 10, 5, 0, 260, 261, 5, 49, 0, 0, 261, 263, 1, 0, 0, 0, 262, 254, 1, 0, 0, 0, 262, 256, 1, 0, 0, 0, 262, 257, 1, 0, 0, 0, 262, 258, 1, 0, 0, 0, 263, 269, 1, 0, 0, 0, 264, 265, 10, 1, 0, 0, 265, 266, 5, 32, 0, 0, 266, 268, 3, 26, 13, 0, 267, 264, 1, 0, 0, 0, 268, 271, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 21, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 272, 273, 3, 24, 12, 0, 273, 283, 5, 42, 0, 0, 274, 284, 5, 60, 0, 0, 275, 280, 3, 10, 5, 0, 276, 277, 5, 33, 0, 0, 277, 279, 3, 10, 5, 0, 278, 276, 1, 0, 0, 0, 279, 282, 1, 0, 0, 0, 280, 278, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, 284, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 274, 1, 0, 0, 0, 283, 275, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 286, 5, 49, 0, 0, 286, 23, 1, 0, 0, 0, 287, 290, 5, 63, 0, 0, 288, 290, 3, 72, 36, 0, 289, 287, 1, 0, 0, 0, 289, 288, 1, 0, 0, 0, 290, 25, 1, 0, 0, 0, 291, 292, 3, 64, 32, 0, 292, 27, 1, 0, 0, 0, 293, 294, 5, 12, 0, 0, 294, 295, 3, 30, 15, 0, 295, 29, 1, 0, 0, 0, 296, 301, 3, 32, 16, 0, 297, 298, 5, 33, 0, 0, 298, 300, 3, 32, 16, 0, 299, 297, 1, 0, 0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 31, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 305, 3, 58, 29, 0, 305, 306, 5, 31, 0, 0, 306, 308, 1, 0, 0, 0, 307, 304, 1, 0, 0, 0, 307, 308, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 310, 3, 10, 5, 0, 310, 33, 1, 0, 0, 0, 311, 312, 5, 6, 0, 0, 312, 317, 3, 36, 18, 0, 313, 314, 5, 33, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 316, 319, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 321, 1, 0, 0, 0, 319, 317, 1, 0, 0, 0, 320, 322, 3, 42, 21, 0, 321, 320, 1, 0, 0, 0, 321, 322, 1, 0, 0, 0, 322, 35, 1, 0, 0, 0, 323, 324, 3, 38, 19, 0, 324, 325, 5, 104, 0, 0, 325, 327, 1, 0, 0, 0, 326, 323, 1, 0, 0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 329, 3, 40, 20, 0, 329, 37, 1, 0, 0, 0, 330, 331, 5, 76, 0, 0, 331, 39, 1, 0, 0, 0, 332, 333, 7, 2, 0, 0, 333, 41, 1, 0, 0, 0, 334, 337, 3, 44, 22, 0, 335, 337, 3, 46, 23, 0, 336, 334, 1, 0, 0, 0, 336, 335, 1, 0, 0, 0, 337, 43, 1, 0, 0, 0, 338, 339, 5, 75, 0, 0, 339, 344, 5, 76, 0, 0, 340, 341, 5, 33, 0, 0, 341, 343, 5, 76, 0, 0, 342, 340, 1, 0, 0, 0, 343, 346, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 45, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 347, 348, 5, 65, 0, 0, 348, 349, 3, 44, 22, 0, 349, 350, 5, 66, 0, 0, 350, 47, 1, 0, 0, 0, 351, 352, 5, 19, 0, 0, 352, 357, 3, 36, 18, 0, 353, 354, 5, 33, 0, 0, 354, 356, 3, 36, 18, 0, 355, 353, 1, 0, 0, 0, 356, 359, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 361, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 360, 362, 3, 54, 27, 0, 361, 360, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 365, 1, 0, 0, 0, 363, 364, 5, 28, 0, 0, 364, 366, 3, 30, 15, 0, 365, 363, 1, 0, 0, 0, 365, 366, 1, 0, 0, 0, 366, 49, 1, 0, 0, 0, 367, 368, 5, 4, 0, 0, 368, 369, 3, 30, 15, 0, 369, 51, 1, 0, 0, 0, 370, 372, 5, 15, 0, 0, 371, 373, 3, 54, 27, 0, 372, 371, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 376, 1, 0, 0, 0, 374, 375, 5, 28, 0, 0, 375, 377, 3, 30, 15, 0, 376, 374, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 53, 1, 0, 0, 0, 378, 383, 3, 56, 28, 0, 379, 380, 5, 33, 0, 0, 380, 382, 3, 56, 28, 0, 381, 379, 1, 0, 0, 0, 382, 385, 1, 0, 0, 0, 383, 381, 1, 0, 0, 0, 383, 384, 1, 0, 0, 0, 384, 55, 1, 0, 0, 0, 385, 383, 1, 0, 0, 0, 386, 389, 3, 32, 16, 0, 387, 388, 5, 16, 0, 0, 388, 390, 3, 10, 5, 0, 389, 387, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 57, 1, 0, 0, 0, 391, 396, 3, 72, 36, 0, 392, 393, 5, 35, 0, 0, 393, 395, 3, 72, 36, 0, 394, 392, 1, 0, 0, 0, 395, 398, 1, 0, 0, 0, 396, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 59, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 399, 404, 3, 66, 33, 0, 400, 401, 5, 35, 0, 0, 401, 403, 3, 66, 33, 0, 402, 400, 1, 0, 0, 0, 403, 406, 1, 0, 0, 0, 404, 402, 1, 0, 0, 0, 404, 405, 1, 0, 0, 0, 405, 61, 1, 0, 0, 0, 406, 404, 1, 0, 0, 0, 407, 412, 3, 60, 30, 0, 408, 409, 5, 33, 0, 0, 409, 411, 3, 60, 30, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 63, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 416, 7, 3, 0, 0, 416, 65, 1, 0, 0, 0, 417, 420, 5, 80, 0, 0, 418, 420, 3, 70, 35, 0, 419, 417, 1, 0, 0, 0, 419, 418, 1, 0, 0, 0, 420, 67, 1, 0, 0, 0, 421, 464, 5, 44, 0, 0, 422, 423, 3, 104, 52, 0, 423, 424, 5, 67, 0, 0, 424, 464, 1, 0, 0, 0, 425, 464, 3, 102, 51, 0, 426, 464, 3, 104, 52, 0, 427, 464, 3, 98, 49, 0, 428, 464, 3, 70, 35, 0, 429, 464, 3, 106, 53, 0, 430, 431, 5, 65, 0, 0, 431, 436, 3, 100, 50, 0, 432, 433, 5, 33, 0, 0, 433, 435, 3, 100, 50, 0, 434, 432, 1, 0, 0, 0, 435, 438, 1, 0, 0, 0, 436, 434, 1, 0, 0, 0, 436, 437, 1, 0, 0, 0, 437, 439, 1, 0, 0, 0, 438, 436, 1, 0, 0, 0, 439, 440, 5, 66, 0, 0, 440, 464, 1, 0, 0, 0, 441, 442, 5, 65, 0, 0, 442, 447, 3, 98, 49, 0, 443, 444, 5, 33, 0, 0, 444, 446, 3, 98, 49, 0, 445, 443, 1, 0, 0, 0, 446, 449, 1, 0, 0, 0, 447, 445, 1, 0, 0, 0, 447, 448, 1, 0, 0, 0, 448, 450, 1, 0, 0, 0, 449, 447, 1, 0, 0, 0, 450, 451, 5, 66, 0, 0, 451, 464, 1, 0, 0, 0, 452, 453, 5, 65, 0, 0, 453, 458, 3, 106, 53, 0, 454, 455, 5, 33, 0, 0, 455, 457, 3, 106, 53, 0, 456, 454, 1, 0, 0, 0, 457, 460, 1, 0, 0, 0, 458, 456, 1, 0, 0, 0, 458, 459, 1, 0, 0, 0, 459, 461, 1, 0, 0, 0, 460, 458, 1, 0, 0, 0, 461, 462, 5, 66, 0, 0, 462, 464, 1, 0, 0, 0, 463, 421, 1, 0, 0, 0, 463, 422, 1, 0, 0, 0, 463, 425, 1, 0, 0, 0, 463, 426, 1, 0, 0, 0, 463, 427, 1, 0, 0, 0, 463, 428, 1, 0, 0, 0, 463, 429, 1, 0, 0, 0, 463, 430, 1, 0, 0, 0, 463, 441, 1, 0, 0, 0, 463, 452, 1, 0, 0, 0, 464, 69, 1, 0, 0, 0, 465, 468, 5, 47, 0, 0, 466, 468, 5, 64, 0, 0, 467, 465, 1, 0, 0, 0, 467, 466, 1, 0, 0, 0, 468, 71, 1, 0, 0, 0, 469, 472, 3, 64, 32, 0, 470, 472, 3, 70, 35, 0, 471, 469, 1, 0, 0, 0, 471, 470, 1, 0, 0, 0, 472, 73, 1, 0, 0, 0, 473, 474, 5, 9, 0, 0, 474, 475, 5, 26, 0, 0, 475, 75, 1, 0, 0, 0, 476, 477, 5, 14, 0, 0, 477, 482, 3, 78, 39, 0, 478, 479, 5, 33, 0, 0, 479, 481, 3, 78, 39, 0, 480, 478, 1, 0, 0, 0, 481, 484, 1, 0, 0, 0, 482, 480, 1, 0, 0, 0, 482, 483, 1, 0, 0, 0, 483, 77, 1, 0, 0, 0, 484, 482, 1, 0, 0, 0, 485, 487, 3, 10, 5, 0, 486, 488, 7, 4, 0, 0, 487, 486, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 491, 1, 0, 0, 0, 489, 490, 5, 45, 0, 0, 490, 492, 7, 5, 0, 0, 491, 489, 1, 0, 0, 0, 491, 492, 1, 0, 0, 0, 492, 79, 1, 0, 0, 0, 493, 494, 5, 8, 0, 0, 494, 495, 3, 62, 31, 0, 495, 81, 1, 0, 0, 0, 496, 497, 5, 2, 0, 0, 497, 498, 3, 62, 31, 0, 498, 83, 1, 0, 0, 0, 499, 500, 5, 11, 0, 0, 500, 505, 3, 86, 43, 0, 501, 502, 5, 33, 0, 0, 502, 504, 3, 86, 43, 0, 503, 501, 1, 0, 0, 0, 504, 507, 1, 0, 0, 0, 505, 503, 1, 0, 0, 0, 505, 506, 1, 0, 0, 0, 506, 85, 1, 0, 0, 0, 507, 505, 1, 0, 0, 0, 508, 509, 3, 60, 30, 0, 509, 510, 5, 84, 0, 0, 510, 511, 3, 60, 30, 0, 511, 87, 1, 0, 0, 0, 512, 513, 5, 1, 0, 0, 513, 514, 3, 20, 10, 0, 514, 516, 3, 106, 53, 0, 515, 517, 3, 94, 47, 0, 516, 515, 1, 0, 0, 0, 516, 517, 1, 0, 0, 0, 517, 89, 1, 0, 0, 0, 518, 519, 5, 7, 0, 0, 519, 520, 3, 20, 10, 0, 520, 521, 3, 106, 53, 0, 521, 91, 1, 0, 0, 0, 522, 523, 5, 10, 0, 0, 523, 524, 3, 58, 29, 0, 524, 93, 1, 0, 0, 0, 525, 530, 3, 96, 48, 0, 526, 527, 5, 33, 0, 0, 527, 529, 3, 96, 48, 0, 528, 526, 1, 0, 0, 0, 529, 532, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 95, 1, 0, 0, 0, 532, 530, 1, 0, 0, 0, 533, 534, 3, 64, 32, 0, 534, 535, 5, 31, 0, 0, 535, 536, 3, 68, 34, 0, 536, 97, 1, 0, 0, 0, 537, 538, 7, 6, 0, 0, 538, 99, 1, 0, 0, 0, 539, 542, 3, 102, 51, 0, 540, 542, 3, 104, 52, 0, 541, 539, 1, 0, 0, 0, 541, 540, 1, 0, 0, 0, 542, 101, 1, 0, 0, 0, 543, 545, 7, 0, 0, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 546, 1, 0, 0, 0, 546, 547, 5, 27, 0, 0, 547, 103, 1, 0, 0, 0, 548, 550, 7, 0, 0, 0, 549, 548, 1, 0, 0, 0, 549, 550, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 552, 5, 26, 0, 0, 552, 105, 1, 0, 0, 0, 553, 554, 5, 25, 0, 0, 554, 107, 1, 0, 0, 0, 555, 556, 7, 7, 0, 0, 556, 109, 1, 0, 0, 0, 557, 558, 5, 5, 0, 0, 558, 559, 3, 112, 56, 0, 559, 111, 1, 0, 0, 0, 560, 561, 5, 65, 0, 0, 561, 562, 3, 2, 1, 0, 562, 563, 5, 66, 0, 0, 563, 113, 1, 0, 0, 0, 564, 565, 5, 13, 0, 0, 565, 566, 5, 100, 0, 0, 566, 115, 1, 0, 0, 0, 567, 568, 5, 3, 0, 0, 568, 571, 5, 90, 0, 0, 569, 570, 5, 88, 0, 0, 570, 572, 3, 60, 30, 0, 571, 569, 1, 0, 0, 0, 571, 572, 1, 0, 0, 0, 572, 582, 1, 0, 0, 0, 573, 574, 5, 89, 0, 0, 574, 579, 3, 118, 59, 0, 575, 576, 5, 33, 0, 0, 576, 578, 3, 118, 59, 0, 577, 575, 1, 0, 0, 0, 578, 581, 1, 0, 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 583, 1, 0, 0, 0, 581, 579, 1, 0, 0, 0, 582, 573, 1, 0, 0, 0, 582, 583, 1, 0, 0, 0, 583, 117, 1, 0, 0, 0, 584, 585, 3, 60, 30, 0, 585, 586, 5, 31, 0, 0, 586, 588, 1, 0, 0, 0, 587, 584, 1, 0, 0, 0, 587, 588, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 590, 3, 60, 30, 0, 590, 119, 1, 0, 0, 0, 591, 592, 5, 18, 0, 0, 592, 593, 3, 36, 18, 0, 593, 594, 5, 88, 0, 0, 594, 595, 3, 62, 31, 0, 595, 121, 1, 0, 0, 0, 596, 597, 5, 17, 0, 0, 597, 600, 3, 54, 27, 0, 598, 599, 5, 28, 0, 0, 599, 601, 3, 30, 15, 0, 600, 598, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 123, 1, 0, 0, 0, 59, 135, 144, 162, 174, 183, 191, 197, 205, 207, 212, 219, 224, 235, 241, 249, 251, 262, 269, 280, 283, 289, 301, 307, 317, 321, 326, 336, 344, 357, 361, 365, 372, 376, 383, 389, 396, 404, 412, 419, 436, 447, 458, 463, 467, 471, 482, 487, 491, 505, 516, 530, 541, 544, 549, 571, 579, 582, 587, 600] \ No newline at end of file diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java index ee1ed0a05e978..af5c03a27592b 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java @@ -2935,16 +2935,14 @@ public final AggFieldContext aggField() throws RecognitionException { { setState(386); field(); - setState(387); - if (!(this.isDevVersion())) throw new FailedPredicateException(this, "this.isDevVersion()"); - setState(390); + setState(389); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) { case 1: { - setState(388); + setState(387); match(WHERE); - setState(389); + setState(388); booleanExpression(0); } break; @@ -3001,23 +2999,23 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(392); + setState(391); identifierOrParameter(); - setState(397); + setState(396); _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(393); + setState(392); match(DOT); - setState(394); + setState(393); identifierOrParameter(); } } } - setState(399); + setState(398); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,35,_ctx); } @@ -3073,23 +3071,23 @@ public final QualifiedNamePatternContext qualifiedNamePattern() throws Recogniti int _alt; enterOuterAlt(_localctx, 1); { - setState(400); + setState(399); identifierPattern(); - setState(405); + setState(404); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,36,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(401); + setState(400); match(DOT); - setState(402); + setState(401); identifierPattern(); } } } - setState(407); + setState(406); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,36,_ctx); } @@ -3145,23 +3143,23 @@ public final QualifiedNamePatternsContext qualifiedNamePatterns() throws Recogni int _alt; enterOuterAlt(_localctx, 1); { - setState(408); + setState(407); qualifiedNamePattern(); - setState(413); + setState(412); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,37,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(409); + setState(408); match(COMMA); - setState(410); + setState(409); qualifiedNamePattern(); } } } - setState(415); + setState(414); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,37,_ctx); } @@ -3209,7 +3207,7 @@ public final IdentifierContext identifier() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(416); + setState(415); _la = _input.LA(1); if ( !(_la==UNQUOTED_IDENTIFIER || _la==QUOTED_IDENTIFIER) ) { _errHandler.recoverInline(this); @@ -3262,13 +3260,13 @@ public final IdentifierPatternContext identifierPattern() throws RecognitionExce IdentifierPatternContext _localctx = new IdentifierPatternContext(_ctx, getState()); enterRule(_localctx, 66, RULE_identifierPattern); try { - setState(420); + setState(419); _errHandler.sync(this); switch (_input.LA(1)) { case ID_PATTERN: enterOuterAlt(_localctx, 1); { - setState(418); + setState(417); match(ID_PATTERN); } break; @@ -3276,7 +3274,7 @@ public final IdentifierPatternContext identifierPattern() throws RecognitionExce case NAMED_OR_POSITIONAL_PARAM: enterOuterAlt(_localctx, 2); { - setState(419); + setState(418); parameter(); } break; @@ -3551,14 +3549,14 @@ public final ConstantContext constant() throws RecognitionException { enterRule(_localctx, 68, RULE_constant); int _la; try { - setState(464); + setState(463); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) { case 1: _localctx = new NullLiteralContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(422); + setState(421); match(NULL); } break; @@ -3566,9 +3564,9 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new QualifiedIntegerLiteralContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(423); + setState(422); integerValue(); - setState(424); + setState(423); match(UNQUOTED_IDENTIFIER); } break; @@ -3576,7 +3574,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new DecimalLiteralContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(426); + setState(425); decimalValue(); } break; @@ -3584,7 +3582,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new IntegerLiteralContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(427); + setState(426); integerValue(); } break; @@ -3592,7 +3590,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new BooleanLiteralContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(428); + setState(427); booleanValue(); } break; @@ -3600,7 +3598,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new InputParameterContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(429); + setState(428); parameter(); } break; @@ -3608,7 +3606,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new StringLiteralContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(430); + setState(429); string(); } break; @@ -3616,27 +3614,27 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new NumericArrayLiteralContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(431); + setState(430); match(OPENING_BRACKET); - setState(432); + setState(431); numericValue(); - setState(437); + setState(436); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(433); + setState(432); match(COMMA); - setState(434); + setState(433); numericValue(); } } - setState(439); + setState(438); _errHandler.sync(this); _la = _input.LA(1); } - setState(440); + setState(439); match(CLOSING_BRACKET); } break; @@ -3644,27 +3642,27 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new BooleanArrayLiteralContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(442); + setState(441); match(OPENING_BRACKET); - setState(443); + setState(442); booleanValue(); - setState(448); + setState(447); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(444); + setState(443); match(COMMA); - setState(445); + setState(444); booleanValue(); } } - setState(450); + setState(449); _errHandler.sync(this); _la = _input.LA(1); } - setState(451); + setState(450); match(CLOSING_BRACKET); } break; @@ -3672,27 +3670,27 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new StringArrayLiteralContext(_localctx); enterOuterAlt(_localctx, 10); { - setState(453); + setState(452); match(OPENING_BRACKET); - setState(454); + setState(453); string(); - setState(459); + setState(458); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(455); + setState(454); match(COMMA); - setState(456); + setState(455); string(); } } - setState(461); + setState(460); _errHandler.sync(this); _la = _input.LA(1); } - setState(462); + setState(461); match(CLOSING_BRACKET); } break; @@ -3766,14 +3764,14 @@ public final ParameterContext parameter() throws RecognitionException { ParameterContext _localctx = new ParameterContext(_ctx, getState()); enterRule(_localctx, 70, RULE_parameter); try { - setState(468); + setState(467); _errHandler.sync(this); switch (_input.LA(1)) { case PARAM: _localctx = new InputParamContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(466); + setState(465); match(PARAM); } break; @@ -3781,7 +3779,7 @@ public final ParameterContext parameter() throws RecognitionException { _localctx = new InputNamedOrPositionalParamContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(467); + setState(466); match(NAMED_OR_POSITIONAL_PARAM); } break; @@ -3832,14 +3830,14 @@ public final IdentifierOrParameterContext identifierOrParameter() throws Recogni IdentifierOrParameterContext _localctx = new IdentifierOrParameterContext(_ctx, getState()); enterRule(_localctx, 72, RULE_identifierOrParameter); try { - setState(472); + setState(471); _errHandler.sync(this); switch (_input.LA(1)) { case UNQUOTED_IDENTIFIER: case QUOTED_IDENTIFIER: enterOuterAlt(_localctx, 1); { - setState(470); + setState(469); identifier(); } break; @@ -3847,7 +3845,7 @@ public final IdentifierOrParameterContext identifierOrParameter() throws Recogni case NAMED_OR_POSITIONAL_PARAM: enterOuterAlt(_localctx, 2); { - setState(471); + setState(470); parameter(); } break; @@ -3896,9 +3894,9 @@ public final LimitCommandContext limitCommand() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(474); + setState(473); match(LIMIT); - setState(475); + setState(474); match(INTEGER_LITERAL); } } @@ -3953,25 +3951,25 @@ public final SortCommandContext sortCommand() throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(477); + setState(476); match(SORT); - setState(478); + setState(477); orderExpression(); - setState(483); + setState(482); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,45,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(479); + setState(478); match(COMMA); - setState(480); + setState(479); orderExpression(); } } } - setState(485); + setState(484); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,45,_ctx); } @@ -4027,14 +4025,14 @@ public final OrderExpressionContext orderExpression() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(486); + setState(485); booleanExpression(0); - setState(488); + setState(487); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,46,_ctx) ) { case 1: { - setState(487); + setState(486); ((OrderExpressionContext)_localctx).ordering = _input.LT(1); _la = _input.LA(1); if ( !(_la==ASC || _la==DESC) ) { @@ -4048,14 +4046,14 @@ public final OrderExpressionContext orderExpression() throws RecognitionExceptio } break; } - setState(492); + setState(491); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,47,_ctx) ) { case 1: { - setState(490); + setState(489); match(NULLS); - setState(491); + setState(490); ((OrderExpressionContext)_localctx).nullOrdering = _input.LT(1); _la = _input.LA(1); if ( !(_la==FIRST || _la==LAST) ) { @@ -4114,9 +4112,9 @@ public final KeepCommandContext keepCommand() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(494); + setState(493); match(KEEP); - setState(495); + setState(494); qualifiedNamePatterns(); } } @@ -4163,9 +4161,9 @@ public final DropCommandContext dropCommand() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(497); + setState(496); match(DROP); - setState(498); + setState(497); qualifiedNamePatterns(); } } @@ -4220,25 +4218,25 @@ public final RenameCommandContext renameCommand() throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(500); + setState(499); match(RENAME); - setState(501); + setState(500); renameClause(); - setState(506); + setState(505); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,48,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(502); + setState(501); match(COMMA); - setState(503); + setState(502); renameClause(); } } } - setState(508); + setState(507); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,48,_ctx); } @@ -4292,11 +4290,11 @@ public final RenameClauseContext renameClause() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(509); + setState(508); ((RenameClauseContext)_localctx).oldName = qualifiedNamePattern(); - setState(510); + setState(509); match(AS); - setState(511); + setState(510); ((RenameClauseContext)_localctx).newName = qualifiedNamePattern(); } } @@ -4349,18 +4347,18 @@ public final DissectCommandContext dissectCommand() throws RecognitionException try { enterOuterAlt(_localctx, 1); { - setState(513); + setState(512); match(DISSECT); - setState(514); + setState(513); primaryExpression(0); - setState(515); + setState(514); string(); - setState(517); + setState(516); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,49,_ctx) ) { case 1: { - setState(516); + setState(515); commandOptions(); } break; @@ -4413,11 +4411,11 @@ public final GrokCommandContext grokCommand() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(519); + setState(518); match(GROK); - setState(520); + setState(519); primaryExpression(0); - setState(521); + setState(520); string(); } } @@ -4464,9 +4462,9 @@ public final MvExpandCommandContext mvExpandCommand() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(523); + setState(522); match(MV_EXPAND); - setState(524); + setState(523); qualifiedName(); } } @@ -4520,23 +4518,23 @@ public final CommandOptionsContext commandOptions() throws RecognitionException int _alt; enterOuterAlt(_localctx, 1); { - setState(526); + setState(525); commandOption(); - setState(531); + setState(530); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,50,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(527); + setState(526); match(COMMA); - setState(528); + setState(527); commandOption(); } } } - setState(533); + setState(532); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,50,_ctx); } @@ -4588,11 +4586,11 @@ public final CommandOptionContext commandOption() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(534); + setState(533); identifier(); - setState(535); + setState(534); match(ASSIGN); - setState(536); + setState(535); constant(); } } @@ -4638,7 +4636,7 @@ public final BooleanValueContext booleanValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(538); + setState(537); _la = _input.LA(1); if ( !(_la==FALSE || _la==TRUE) ) { _errHandler.recoverInline(this); @@ -4693,20 +4691,20 @@ public final NumericValueContext numericValue() throws RecognitionException { NumericValueContext _localctx = new NumericValueContext(_ctx, getState()); enterRule(_localctx, 100, RULE_numericValue); try { - setState(542); + setState(541); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,51,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(540); + setState(539); decimalValue(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(541); + setState(540); integerValue(); } break; @@ -4755,12 +4753,12 @@ public final DecimalValueContext decimalValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(545); + setState(544); _errHandler.sync(this); _la = _input.LA(1); if (_la==PLUS || _la==MINUS) { { - setState(544); + setState(543); _la = _input.LA(1); if ( !(_la==PLUS || _la==MINUS) ) { _errHandler.recoverInline(this); @@ -4773,7 +4771,7 @@ public final DecimalValueContext decimalValue() throws RecognitionException { } } - setState(547); + setState(546); match(DECIMAL_LITERAL); } } @@ -4820,12 +4818,12 @@ public final IntegerValueContext integerValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(550); + setState(549); _errHandler.sync(this); _la = _input.LA(1); if (_la==PLUS || _la==MINUS) { { - setState(549); + setState(548); _la = _input.LA(1); if ( !(_la==PLUS || _la==MINUS) ) { _errHandler.recoverInline(this); @@ -4838,7 +4836,7 @@ public final IntegerValueContext integerValue() throws RecognitionException { } } - setState(552); + setState(551); match(INTEGER_LITERAL); } } @@ -4882,7 +4880,7 @@ public final StringContext string() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(554); + setState(553); match(QUOTED_STRING); } } @@ -4932,7 +4930,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(556); + setState(555); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 281474976710656000L) != 0)) ) { _errHandler.recoverInline(this); @@ -4987,9 +4985,9 @@ public final ExplainCommandContext explainCommand() throws RecognitionException try { enterOuterAlt(_localctx, 1); { - setState(558); + setState(557); match(EXPLAIN); - setState(559); + setState(558); subqueryExpression(); } } @@ -5037,11 +5035,11 @@ public final SubqueryExpressionContext subqueryExpression() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(561); + setState(560); match(OPENING_BRACKET); - setState(562); + setState(561); query(0); - setState(563); + setState(562); match(CLOSING_BRACKET); } } @@ -5098,9 +5096,9 @@ public final ShowCommandContext showCommand() throws RecognitionException { _localctx = new ShowInfoContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(565); + setState(564); match(SHOW); - setState(566); + setState(565); match(INFO); } } @@ -5163,46 +5161,46 @@ public final EnrichCommandContext enrichCommand() throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(568); + setState(567); match(ENRICH); - setState(569); + setState(568); ((EnrichCommandContext)_localctx).policyName = match(ENRICH_POLICY_NAME); - setState(572); + setState(571); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,54,_ctx) ) { case 1: { - setState(570); + setState(569); match(ON); - setState(571); + setState(570); ((EnrichCommandContext)_localctx).matchField = qualifiedNamePattern(); } break; } - setState(583); + setState(582); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,56,_ctx) ) { case 1: { - setState(574); + setState(573); match(WITH); - setState(575); + setState(574); enrichWithClause(); - setState(580); + setState(579); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,55,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(576); + setState(575); match(COMMA); - setState(577); + setState(576); enrichWithClause(); } } } - setState(582); + setState(581); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,55,_ctx); } @@ -5259,19 +5257,19 @@ public final EnrichWithClauseContext enrichWithClause() throws RecognitionExcept try { enterOuterAlt(_localctx, 1); { - setState(588); + setState(587); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,57,_ctx) ) { case 1: { - setState(585); + setState(584); ((EnrichWithClauseContext)_localctx).newName = qualifiedNamePattern(); - setState(586); + setState(585); match(ASSIGN); } break; } - setState(590); + setState(589); ((EnrichWithClauseContext)_localctx).enrichField = qualifiedNamePattern(); } } @@ -5324,13 +5322,13 @@ public final LookupCommandContext lookupCommand() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(592); + setState(591); match(DEV_LOOKUP); - setState(593); + setState(592); ((LookupCommandContext)_localctx).tableName = indexPattern(); - setState(594); + setState(593); match(ON); - setState(595); + setState(594); ((LookupCommandContext)_localctx).matchFields = qualifiedNamePatterns(); } } @@ -5383,18 +5381,18 @@ public final InlinestatsCommandContext inlinestatsCommand() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(597); + setState(596); match(DEV_INLINESTATS); - setState(598); + setState(597); ((InlinestatsCommandContext)_localctx).stats = aggFields(); - setState(601); + setState(600); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,58,_ctx) ) { case 1: { - setState(599); + setState(598); match(BY); - setState(600); + setState(599); ((InlinestatsCommandContext)_localctx).grouping = fields(); } break; @@ -5426,8 +5424,6 @@ public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { return operatorExpression_sempred((OperatorExpressionContext)_localctx, predIndex); case 10: return primaryExpression_sempred((PrimaryExpressionContext)_localctx, predIndex); - case 28: - return aggField_sempred((AggFieldContext)_localctx, predIndex); } return true; } @@ -5481,16 +5477,9 @@ private boolean primaryExpression_sempred(PrimaryExpressionContext _localctx, in } return true; } - private boolean aggField_sempred(AggFieldContext _localctx, int predIndex) { - switch (predIndex) { - case 10: - return this.isDevVersion(); - } - return true; - } public static final String _serializedATN = - "\u0004\u0001x\u025c\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u0001x\u025b\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ @@ -5547,331 +5536,330 @@ private boolean aggField_sempred(AggFieldContext _localctx, int predIndex) { "\u0019\u0001\u0019\u0001\u001a\u0001\u001a\u0003\u001a\u0175\b\u001a\u0001"+ "\u001a\u0001\u001a\u0003\u001a\u0179\b\u001a\u0001\u001b\u0001\u001b\u0001"+ "\u001b\u0005\u001b\u017e\b\u001b\n\u001b\f\u001b\u0181\t\u001b\u0001\u001c"+ - "\u0001\u001c\u0001\u001c\u0001\u001c\u0003\u001c\u0187\b\u001c\u0001\u001d"+ - "\u0001\u001d\u0001\u001d\u0005\u001d\u018c\b\u001d\n\u001d\f\u001d\u018f"+ - "\t\u001d\u0001\u001e\u0001\u001e\u0001\u001e\u0005\u001e\u0194\b\u001e"+ - "\n\u001e\f\u001e\u0197\t\u001e\u0001\u001f\u0001\u001f\u0001\u001f\u0005"+ - "\u001f\u019c\b\u001f\n\u001f\f\u001f\u019f\t\u001f\u0001 \u0001 \u0001"+ - "!\u0001!\u0003!\u01a5\b!\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001"+ - "\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0005\"\u01b4"+ - "\b\"\n\"\f\"\u01b7\t\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\""+ - "\u0005\"\u01bf\b\"\n\"\f\"\u01c2\t\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001"+ - "\"\u0001\"\u0005\"\u01ca\b\"\n\"\f\"\u01cd\t\"\u0001\"\u0001\"\u0003\""+ - "\u01d1\b\"\u0001#\u0001#\u0003#\u01d5\b#\u0001$\u0001$\u0003$\u01d9\b"+ - "$\u0001%\u0001%\u0001%\u0001&\u0001&\u0001&\u0001&\u0005&\u01e2\b&\n&"+ - "\f&\u01e5\t&\u0001\'\u0001\'\u0003\'\u01e9\b\'\u0001\'\u0001\'\u0003\'"+ - "\u01ed\b\'\u0001(\u0001(\u0001(\u0001)\u0001)\u0001)\u0001*\u0001*\u0001"+ - "*\u0001*\u0005*\u01f9\b*\n*\f*\u01fc\t*\u0001+\u0001+\u0001+\u0001+\u0001"+ - ",\u0001,\u0001,\u0001,\u0003,\u0206\b,\u0001-\u0001-\u0001-\u0001-\u0001"+ - ".\u0001.\u0001.\u0001/\u0001/\u0001/\u0005/\u0212\b/\n/\f/\u0215\t/\u0001"+ - "0\u00010\u00010\u00010\u00011\u00011\u00012\u00012\u00032\u021f\b2\u0001"+ - "3\u00033\u0222\b3\u00013\u00013\u00014\u00034\u0227\b4\u00014\u00014\u0001"+ - "5\u00015\u00016\u00016\u00017\u00017\u00017\u00018\u00018\u00018\u0001"+ - "8\u00019\u00019\u00019\u0001:\u0001:\u0001:\u0001:\u0003:\u023d\b:\u0001"+ - ":\u0001:\u0001:\u0001:\u0005:\u0243\b:\n:\f:\u0246\t:\u0003:\u0248\b:"+ - "\u0001;\u0001;\u0001;\u0003;\u024d\b;\u0001;\u0001;\u0001<\u0001<\u0001"+ - "<\u0001<\u0001<\u0001=\u0001=\u0001=\u0001=\u0003=\u025a\b=\u0001=\u0000"+ - "\u0004\u0002\n\u0012\u0014>\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010"+ - "\u0012\u0014\u0016\u0018\u001a\u001c\u001e \"$&(*,.02468:<>@BDFHJLNPR"+ - "TVXZ\\^`bdfhjlnprtvxz\u0000\b\u0001\u0000:;\u0001\u0000<>\u0002\u0000"+ - "\u0019\u0019LL\u0001\u0000CD\u0002\u0000\u001e\u001e\"\"\u0002\u0000%"+ - "%((\u0002\u0000$$22\u0002\u00003359\u0276\u0000|\u0001\u0000\u0000\u0000"+ - "\u0002\u007f\u0001\u0000\u0000\u0000\u0004\u0090\u0001\u0000\u0000\u0000"+ - "\u0006\u00a2\u0001\u0000\u0000\u0000\b\u00a4\u0001\u0000\u0000\u0000\n"+ - "\u00c5\u0001\u0000\u0000\u0000\f\u00e0\u0001\u0000\u0000\u0000\u000e\u00e2"+ - "\u0001\u0000\u0000\u0000\u0010\u00eb\u0001\u0000\u0000\u0000\u0012\u00f1"+ - "\u0001\u0000\u0000\u0000\u0014\u0106\u0001\u0000\u0000\u0000\u0016\u0110"+ - "\u0001\u0000\u0000\u0000\u0018\u0121\u0001\u0000\u0000\u0000\u001a\u0123"+ - "\u0001\u0000\u0000\u0000\u001c\u0125\u0001\u0000\u0000\u0000\u001e\u0128"+ - "\u0001\u0000\u0000\u0000 \u0133\u0001\u0000\u0000\u0000\"\u0137\u0001"+ - "\u0000\u0000\u0000$\u0146\u0001\u0000\u0000\u0000&\u014a\u0001\u0000\u0000"+ - "\u0000(\u014c\u0001\u0000\u0000\u0000*\u0150\u0001\u0000\u0000\u0000,"+ - "\u0152\u0001\u0000\u0000\u0000.\u015b\u0001\u0000\u0000\u00000\u015f\u0001"+ - "\u0000\u0000\u00002\u016f\u0001\u0000\u0000\u00004\u0172\u0001\u0000\u0000"+ - "\u00006\u017a\u0001\u0000\u0000\u00008\u0182\u0001\u0000\u0000\u0000:"+ - "\u0188\u0001\u0000\u0000\u0000<\u0190\u0001\u0000\u0000\u0000>\u0198\u0001"+ - "\u0000\u0000\u0000@\u01a0\u0001\u0000\u0000\u0000B\u01a4\u0001\u0000\u0000"+ - "\u0000D\u01d0\u0001\u0000\u0000\u0000F\u01d4\u0001\u0000\u0000\u0000H"+ - "\u01d8\u0001\u0000\u0000\u0000J\u01da\u0001\u0000\u0000\u0000L\u01dd\u0001"+ - "\u0000\u0000\u0000N\u01e6\u0001\u0000\u0000\u0000P\u01ee\u0001\u0000\u0000"+ - "\u0000R\u01f1\u0001\u0000\u0000\u0000T\u01f4\u0001\u0000\u0000\u0000V"+ - "\u01fd\u0001\u0000\u0000\u0000X\u0201\u0001\u0000\u0000\u0000Z\u0207\u0001"+ - "\u0000\u0000\u0000\\\u020b\u0001\u0000\u0000\u0000^\u020e\u0001\u0000"+ - "\u0000\u0000`\u0216\u0001\u0000\u0000\u0000b\u021a\u0001\u0000\u0000\u0000"+ - "d\u021e\u0001\u0000\u0000\u0000f\u0221\u0001\u0000\u0000\u0000h\u0226"+ - "\u0001\u0000\u0000\u0000j\u022a\u0001\u0000\u0000\u0000l\u022c\u0001\u0000"+ - "\u0000\u0000n\u022e\u0001\u0000\u0000\u0000p\u0231\u0001\u0000\u0000\u0000"+ - "r\u0235\u0001\u0000\u0000\u0000t\u0238\u0001\u0000\u0000\u0000v\u024c"+ - "\u0001\u0000\u0000\u0000x\u0250\u0001\u0000\u0000\u0000z\u0255\u0001\u0000"+ - "\u0000\u0000|}\u0003\u0002\u0001\u0000}~\u0005\u0000\u0000\u0001~\u0001"+ - "\u0001\u0000\u0000\u0000\u007f\u0080\u0006\u0001\uffff\uffff\u0000\u0080"+ - "\u0081\u0003\u0004\u0002\u0000\u0081\u0087\u0001\u0000\u0000\u0000\u0082"+ - "\u0083\n\u0001\u0000\u0000\u0083\u0084\u0005\u0018\u0000\u0000\u0084\u0086"+ - "\u0003\u0006\u0003\u0000\u0085\u0082\u0001\u0000\u0000\u0000\u0086\u0089"+ - "\u0001\u0000\u0000\u0000\u0087\u0085\u0001\u0000\u0000\u0000\u0087\u0088"+ - "\u0001\u0000\u0000\u0000\u0088\u0003\u0001\u0000\u0000\u0000\u0089\u0087"+ - "\u0001\u0000\u0000\u0000\u008a\u0091\u0003n7\u0000\u008b\u0091\u0003\""+ - "\u0011\u0000\u008c\u0091\u0003\u001c\u000e\u0000\u008d\u0091\u0003r9\u0000"+ - "\u008e\u008f\u0004\u0002\u0001\u0000\u008f\u0091\u00030\u0018\u0000\u0090"+ - "\u008a\u0001\u0000\u0000\u0000\u0090\u008b\u0001\u0000\u0000\u0000\u0090"+ - "\u008c\u0001\u0000\u0000\u0000\u0090\u008d\u0001\u0000\u0000\u0000\u0090"+ - "\u008e\u0001\u0000\u0000\u0000\u0091\u0005\u0001\u0000\u0000\u0000\u0092"+ - "\u00a3\u00032\u0019\u0000\u0093\u00a3\u0003\b\u0004\u0000\u0094\u00a3"+ - "\u0003P(\u0000\u0095\u00a3\u0003J%\u0000\u0096\u00a3\u00034\u001a\u0000"+ - "\u0097\u00a3\u0003L&\u0000\u0098\u00a3\u0003R)\u0000\u0099\u00a3\u0003"+ - "T*\u0000\u009a\u00a3\u0003X,\u0000\u009b\u00a3\u0003Z-\u0000\u009c\u00a3"+ - "\u0003t:\u0000\u009d\u00a3\u0003\\.\u0000\u009e\u009f\u0004\u0003\u0002"+ - "\u0000\u009f\u00a3\u0003z=\u0000\u00a0\u00a1\u0004\u0003\u0003\u0000\u00a1"+ - "\u00a3\u0003x<\u0000\u00a2\u0092\u0001\u0000\u0000\u0000\u00a2\u0093\u0001"+ - "\u0000\u0000\u0000\u00a2\u0094\u0001\u0000\u0000\u0000\u00a2\u0095\u0001"+ - "\u0000\u0000\u0000\u00a2\u0096\u0001\u0000\u0000\u0000\u00a2\u0097\u0001"+ - "\u0000\u0000\u0000\u00a2\u0098\u0001\u0000\u0000\u0000\u00a2\u0099\u0001"+ - "\u0000\u0000\u0000\u00a2\u009a\u0001\u0000\u0000\u0000\u00a2\u009b\u0001"+ - "\u0000\u0000\u0000\u00a2\u009c\u0001\u0000\u0000\u0000\u00a2\u009d\u0001"+ - "\u0000\u0000\u0000\u00a2\u009e\u0001\u0000\u0000\u0000\u00a2\u00a0\u0001"+ - "\u0000\u0000\u0000\u00a3\u0007\u0001\u0000\u0000\u0000\u00a4\u00a5\u0005"+ - "\u0010\u0000\u0000\u00a5\u00a6\u0003\n\u0005\u0000\u00a6\t\u0001\u0000"+ - "\u0000\u0000\u00a7\u00a8\u0006\u0005\uffff\uffff\u0000\u00a8\u00a9\u0005"+ - "+\u0000\u0000\u00a9\u00c6\u0003\n\u0005\b\u00aa\u00c6\u0003\u0010\b\u0000"+ - "\u00ab\u00c6\u0003\f\u0006\u0000\u00ac\u00ae\u0003\u0010\b\u0000\u00ad"+ - "\u00af\u0005+\u0000\u0000\u00ae\u00ad\u0001\u0000\u0000\u0000\u00ae\u00af"+ - "\u0001\u0000\u0000\u0000\u00af\u00b0\u0001\u0000\u0000\u0000\u00b0\u00b1"+ - "\u0005&\u0000\u0000\u00b1\u00b2\u0005*\u0000\u0000\u00b2\u00b7\u0003\u0010"+ - "\b\u0000\u00b3\u00b4\u0005!\u0000\u0000\u00b4\u00b6\u0003\u0010\b\u0000"+ - "\u00b5\u00b3\u0001\u0000\u0000\u0000\u00b6\u00b9\u0001\u0000\u0000\u0000"+ - "\u00b7\u00b5\u0001\u0000\u0000\u0000\u00b7\u00b8\u0001\u0000\u0000\u0000"+ - "\u00b8\u00ba\u0001\u0000\u0000\u0000\u00b9\u00b7\u0001\u0000\u0000\u0000"+ - "\u00ba\u00bb\u00051\u0000\u0000\u00bb\u00c6\u0001\u0000\u0000\u0000\u00bc"+ - "\u00bd\u0003\u0010\b\u0000\u00bd\u00bf\u0005\'\u0000\u0000\u00be\u00c0"+ - "\u0005+\u0000\u0000\u00bf\u00be\u0001\u0000\u0000\u0000\u00bf\u00c0\u0001"+ - "\u0000\u0000\u0000\u00c0\u00c1\u0001\u0000\u0000\u0000\u00c1\u00c2\u0005"+ - ",\u0000\u0000\u00c2\u00c6\u0001\u0000\u0000\u0000\u00c3\u00c4\u0004\u0005"+ - "\u0004\u0000\u00c4\u00c6\u0003\u000e\u0007\u0000\u00c5\u00a7\u0001\u0000"+ - "\u0000\u0000\u00c5\u00aa\u0001\u0000\u0000\u0000\u00c5\u00ab\u0001\u0000"+ - "\u0000\u0000\u00c5\u00ac\u0001\u0000\u0000\u0000\u00c5\u00bc\u0001\u0000"+ - "\u0000\u0000\u00c5\u00c3\u0001\u0000\u0000\u0000\u00c6\u00cf\u0001\u0000"+ - "\u0000\u0000\u00c7\u00c8\n\u0005\u0000\u0000\u00c8\u00c9\u0005\u001d\u0000"+ - "\u0000\u00c9\u00ce\u0003\n\u0005\u0006\u00ca\u00cb\n\u0004\u0000\u0000"+ - "\u00cb\u00cc\u0005.\u0000\u0000\u00cc\u00ce\u0003\n\u0005\u0005\u00cd"+ - "\u00c7\u0001\u0000\u0000\u0000\u00cd\u00ca\u0001\u0000\u0000\u0000\u00ce"+ - "\u00d1\u0001\u0000\u0000\u0000\u00cf\u00cd\u0001\u0000\u0000\u0000\u00cf"+ - "\u00d0\u0001\u0000\u0000\u0000\u00d0\u000b\u0001\u0000\u0000\u0000\u00d1"+ - "\u00cf\u0001\u0000\u0000\u0000\u00d2\u00d4\u0003\u0010\b\u0000\u00d3\u00d5"+ - "\u0005+\u0000\u0000\u00d4\u00d3\u0001\u0000\u0000\u0000\u00d4\u00d5\u0001"+ - "\u0000\u0000\u0000\u00d5\u00d6\u0001\u0000\u0000\u0000\u00d6\u00d7\u0005"+ - ")\u0000\u0000\u00d7\u00d8\u0003j5\u0000\u00d8\u00e1\u0001\u0000\u0000"+ - "\u0000\u00d9\u00db\u0003\u0010\b\u0000\u00da\u00dc\u0005+\u0000\u0000"+ - "\u00db\u00da\u0001\u0000\u0000\u0000\u00db\u00dc\u0001\u0000\u0000\u0000"+ - "\u00dc\u00dd\u0001\u0000\u0000\u0000\u00dd\u00de\u00050\u0000\u0000\u00de"+ - "\u00df\u0003j5\u0000\u00df\u00e1\u0001\u0000\u0000\u0000\u00e0\u00d2\u0001"+ - "\u0000\u0000\u0000\u00e0\u00d9\u0001\u0000\u0000\u0000\u00e1\r\u0001\u0000"+ - "\u0000\u0000\u00e2\u00e3\u0003\u0010\b\u0000\u00e3\u00e4\u0005?\u0000"+ - "\u0000\u00e4\u00e5\u0003j5\u0000\u00e5\u000f\u0001\u0000\u0000\u0000\u00e6"+ - "\u00ec\u0003\u0012\t\u0000\u00e7\u00e8\u0003\u0012\t\u0000\u00e8\u00e9"+ - "\u0003l6\u0000\u00e9\u00ea\u0003\u0012\t\u0000\u00ea\u00ec\u0001\u0000"+ - "\u0000\u0000\u00eb\u00e6\u0001\u0000\u0000\u0000\u00eb\u00e7\u0001\u0000"+ - "\u0000\u0000\u00ec\u0011\u0001\u0000\u0000\u0000\u00ed\u00ee\u0006\t\uffff"+ - "\uffff\u0000\u00ee\u00f2\u0003\u0014\n\u0000\u00ef\u00f0\u0007\u0000\u0000"+ - "\u0000\u00f0\u00f2\u0003\u0012\t\u0003\u00f1\u00ed\u0001\u0000\u0000\u0000"+ - "\u00f1\u00ef\u0001\u0000\u0000\u0000\u00f2\u00fb\u0001\u0000\u0000\u0000"+ - "\u00f3\u00f4\n\u0002\u0000\u0000\u00f4\u00f5\u0007\u0001\u0000\u0000\u00f5"+ - "\u00fa\u0003\u0012\t\u0003\u00f6\u00f7\n\u0001\u0000\u0000\u00f7\u00f8"+ - "\u0007\u0000\u0000\u0000\u00f8\u00fa\u0003\u0012\t\u0002\u00f9\u00f3\u0001"+ - "\u0000\u0000\u0000\u00f9\u00f6\u0001\u0000\u0000\u0000\u00fa\u00fd\u0001"+ - "\u0000\u0000\u0000\u00fb\u00f9\u0001\u0000\u0000\u0000\u00fb\u00fc\u0001"+ - "\u0000\u0000\u0000\u00fc\u0013\u0001\u0000\u0000\u0000\u00fd\u00fb\u0001"+ - "\u0000\u0000\u0000\u00fe\u00ff\u0006\n\uffff\uffff\u0000\u00ff\u0107\u0003"+ - "D\"\u0000\u0100\u0107\u0003:\u001d\u0000\u0101\u0107\u0003\u0016\u000b"+ - "\u0000\u0102\u0103\u0005*\u0000\u0000\u0103\u0104\u0003\n\u0005\u0000"+ - "\u0104\u0105\u00051\u0000\u0000\u0105\u0107\u0001\u0000\u0000\u0000\u0106"+ - "\u00fe\u0001\u0000\u0000\u0000\u0106\u0100\u0001\u0000\u0000\u0000\u0106"+ - "\u0101\u0001\u0000\u0000\u0000\u0106\u0102\u0001\u0000\u0000\u0000\u0107"+ - "\u010d\u0001\u0000\u0000\u0000\u0108\u0109\n\u0001\u0000\u0000\u0109\u010a"+ - "\u0005 \u0000\u0000\u010a\u010c\u0003\u001a\r\u0000\u010b\u0108\u0001"+ - "\u0000\u0000\u0000\u010c\u010f\u0001\u0000\u0000\u0000\u010d\u010b\u0001"+ - "\u0000\u0000\u0000\u010d\u010e\u0001\u0000\u0000\u0000\u010e\u0015\u0001"+ - "\u0000\u0000\u0000\u010f\u010d\u0001\u0000\u0000\u0000\u0110\u0111\u0003"+ - "\u0018\f\u0000\u0111\u011b\u0005*\u0000\u0000\u0112\u011c\u0005<\u0000"+ - "\u0000\u0113\u0118\u0003\n\u0005\u0000\u0114\u0115\u0005!\u0000\u0000"+ - "\u0115\u0117\u0003\n\u0005\u0000\u0116\u0114\u0001\u0000\u0000\u0000\u0117"+ - "\u011a\u0001\u0000\u0000\u0000\u0118\u0116\u0001\u0000\u0000\u0000\u0118"+ - "\u0119\u0001\u0000\u0000\u0000\u0119\u011c\u0001\u0000\u0000\u0000\u011a"+ - "\u0118\u0001\u0000\u0000\u0000\u011b\u0112\u0001\u0000\u0000\u0000\u011b"+ - "\u0113\u0001\u0000\u0000\u0000\u011b\u011c\u0001\u0000\u0000\u0000\u011c"+ - "\u011d\u0001\u0000\u0000\u0000\u011d\u011e\u00051\u0000\u0000\u011e\u0017"+ - "\u0001\u0000\u0000\u0000\u011f\u0122\u0005?\u0000\u0000\u0120\u0122\u0003"+ - "H$\u0000\u0121\u011f\u0001\u0000\u0000\u0000\u0121\u0120\u0001\u0000\u0000"+ - "\u0000\u0122\u0019\u0001\u0000\u0000\u0000\u0123\u0124\u0003@ \u0000\u0124"+ - "\u001b\u0001\u0000\u0000\u0000\u0125\u0126\u0005\f\u0000\u0000\u0126\u0127"+ - "\u0003\u001e\u000f\u0000\u0127\u001d\u0001\u0000\u0000\u0000\u0128\u012d"+ - "\u0003 \u0010\u0000\u0129\u012a\u0005!\u0000\u0000\u012a\u012c\u0003 "+ - "\u0010\u0000\u012b\u0129\u0001\u0000\u0000\u0000\u012c\u012f\u0001\u0000"+ - "\u0000\u0000\u012d\u012b\u0001\u0000\u0000\u0000\u012d\u012e\u0001\u0000"+ - "\u0000\u0000\u012e\u001f\u0001\u0000\u0000\u0000\u012f\u012d\u0001\u0000"+ - "\u0000\u0000\u0130\u0131\u0003:\u001d\u0000\u0131\u0132\u0005\u001f\u0000"+ - "\u0000\u0132\u0134\u0001\u0000\u0000\u0000\u0133\u0130\u0001\u0000\u0000"+ - "\u0000\u0133\u0134\u0001\u0000\u0000\u0000\u0134\u0135\u0001\u0000\u0000"+ - "\u0000\u0135\u0136\u0003\n\u0005\u0000\u0136!\u0001\u0000\u0000\u0000"+ - "\u0137\u0138\u0005\u0006\u0000\u0000\u0138\u013d\u0003$\u0012\u0000\u0139"+ - "\u013a\u0005!\u0000\u0000\u013a\u013c\u0003$\u0012\u0000\u013b\u0139\u0001"+ - "\u0000\u0000\u0000\u013c\u013f\u0001\u0000\u0000\u0000\u013d\u013b\u0001"+ - "\u0000\u0000\u0000\u013d\u013e\u0001\u0000\u0000\u0000\u013e\u0141\u0001"+ - "\u0000\u0000\u0000\u013f\u013d\u0001\u0000\u0000\u0000\u0140\u0142\u0003"+ - "*\u0015\u0000\u0141\u0140\u0001\u0000\u0000\u0000\u0141\u0142\u0001\u0000"+ - "\u0000\u0000\u0142#\u0001\u0000\u0000\u0000\u0143\u0144\u0003&\u0013\u0000"+ - "\u0144\u0145\u0005h\u0000\u0000\u0145\u0147\u0001\u0000\u0000\u0000\u0146"+ - "\u0143\u0001\u0000\u0000\u0000\u0146\u0147\u0001\u0000\u0000\u0000\u0147"+ - "\u0148\u0001\u0000\u0000\u0000\u0148\u0149\u0003(\u0014\u0000\u0149%\u0001"+ - "\u0000\u0000\u0000\u014a\u014b\u0005L\u0000\u0000\u014b\'\u0001\u0000"+ - "\u0000\u0000\u014c\u014d\u0007\u0002\u0000\u0000\u014d)\u0001\u0000\u0000"+ - "\u0000\u014e\u0151\u0003,\u0016\u0000\u014f\u0151\u0003.\u0017\u0000\u0150"+ - "\u014e\u0001\u0000\u0000\u0000\u0150\u014f\u0001\u0000\u0000\u0000\u0151"+ - "+\u0001\u0000\u0000\u0000\u0152\u0153\u0005K\u0000\u0000\u0153\u0158\u0005"+ - "L\u0000\u0000\u0154\u0155\u0005!\u0000\u0000\u0155\u0157\u0005L\u0000"+ - "\u0000\u0156\u0154\u0001\u0000\u0000\u0000\u0157\u015a\u0001\u0000\u0000"+ - "\u0000\u0158\u0156\u0001\u0000\u0000\u0000\u0158\u0159\u0001\u0000\u0000"+ - "\u0000\u0159-\u0001\u0000\u0000\u0000\u015a\u0158\u0001\u0000\u0000\u0000"+ - "\u015b\u015c\u0005A\u0000\u0000\u015c\u015d\u0003,\u0016\u0000\u015d\u015e"+ - "\u0005B\u0000\u0000\u015e/\u0001\u0000\u0000\u0000\u015f\u0160\u0005\u0013"+ - "\u0000\u0000\u0160\u0165\u0003$\u0012\u0000\u0161\u0162\u0005!\u0000\u0000"+ - "\u0162\u0164\u0003$\u0012\u0000\u0163\u0161\u0001\u0000\u0000\u0000\u0164"+ - "\u0167\u0001\u0000\u0000\u0000\u0165\u0163\u0001\u0000\u0000\u0000\u0165"+ - "\u0166\u0001\u0000\u0000\u0000\u0166\u0169\u0001\u0000\u0000\u0000\u0167"+ - "\u0165\u0001\u0000\u0000\u0000\u0168\u016a\u00036\u001b\u0000\u0169\u0168"+ - "\u0001\u0000\u0000\u0000\u0169\u016a\u0001\u0000\u0000\u0000\u016a\u016d"+ - "\u0001\u0000\u0000\u0000\u016b\u016c\u0005\u001c\u0000\u0000\u016c\u016e"+ - "\u0003\u001e\u000f\u0000\u016d\u016b\u0001\u0000\u0000\u0000\u016d\u016e"+ - "\u0001\u0000\u0000\u0000\u016e1\u0001\u0000\u0000\u0000\u016f\u0170\u0005"+ - "\u0004\u0000\u0000\u0170\u0171\u0003\u001e\u000f\u0000\u01713\u0001\u0000"+ - "\u0000\u0000\u0172\u0174\u0005\u000f\u0000\u0000\u0173\u0175\u00036\u001b"+ - "\u0000\u0174\u0173\u0001\u0000\u0000\u0000\u0174\u0175\u0001\u0000\u0000"+ - "\u0000\u0175\u0178\u0001\u0000\u0000\u0000\u0176\u0177\u0005\u001c\u0000"+ - "\u0000\u0177\u0179\u0003\u001e\u000f\u0000\u0178\u0176\u0001\u0000\u0000"+ - "\u0000\u0178\u0179\u0001\u0000\u0000\u0000\u01795\u0001\u0000\u0000\u0000"+ - "\u017a\u017f\u00038\u001c\u0000\u017b\u017c\u0005!\u0000\u0000\u017c\u017e"+ - "\u00038\u001c\u0000\u017d\u017b\u0001\u0000\u0000\u0000\u017e\u0181\u0001"+ - "\u0000\u0000\u0000\u017f\u017d\u0001\u0000\u0000\u0000\u017f\u0180\u0001"+ - "\u0000\u0000\u0000\u01807\u0001\u0000\u0000\u0000\u0181\u017f\u0001\u0000"+ - "\u0000\u0000\u0182\u0183\u0003 \u0010\u0000\u0183\u0186\u0004\u001c\n"+ - "\u0000\u0184\u0185\u0005\u0010\u0000\u0000\u0185\u0187\u0003\n\u0005\u0000"+ - "\u0186\u0184\u0001\u0000\u0000\u0000\u0186\u0187\u0001\u0000\u0000\u0000"+ - "\u01879\u0001\u0000\u0000\u0000\u0188\u018d\u0003H$\u0000\u0189\u018a"+ - "\u0005#\u0000\u0000\u018a\u018c\u0003H$\u0000\u018b\u0189\u0001\u0000"+ - "\u0000\u0000\u018c\u018f\u0001\u0000\u0000\u0000\u018d\u018b\u0001\u0000"+ - "\u0000\u0000\u018d\u018e\u0001\u0000\u0000\u0000\u018e;\u0001\u0000\u0000"+ - "\u0000\u018f\u018d\u0001\u0000\u0000\u0000\u0190\u0195\u0003B!\u0000\u0191"+ - "\u0192\u0005#\u0000\u0000\u0192\u0194\u0003B!\u0000\u0193\u0191\u0001"+ - "\u0000\u0000\u0000\u0194\u0197\u0001\u0000\u0000\u0000\u0195\u0193\u0001"+ - "\u0000\u0000\u0000\u0195\u0196\u0001\u0000\u0000\u0000\u0196=\u0001\u0000"+ - "\u0000\u0000\u0197\u0195\u0001\u0000\u0000\u0000\u0198\u019d\u0003<\u001e"+ - "\u0000\u0199\u019a\u0005!\u0000\u0000\u019a\u019c\u0003<\u001e\u0000\u019b"+ - "\u0199\u0001\u0000\u0000\u0000\u019c\u019f\u0001\u0000\u0000\u0000\u019d"+ - "\u019b\u0001\u0000\u0000\u0000\u019d\u019e\u0001\u0000\u0000\u0000\u019e"+ - "?\u0001\u0000\u0000\u0000\u019f\u019d\u0001\u0000\u0000\u0000\u01a0\u01a1"+ - "\u0007\u0003\u0000\u0000\u01a1A\u0001\u0000\u0000\u0000\u01a2\u01a5\u0005"+ - "P\u0000\u0000\u01a3\u01a5\u0003F#\u0000\u01a4\u01a2\u0001\u0000\u0000"+ - "\u0000\u01a4\u01a3\u0001\u0000\u0000\u0000\u01a5C\u0001\u0000\u0000\u0000"+ - "\u01a6\u01d1\u0005,\u0000\u0000\u01a7\u01a8\u0003h4\u0000\u01a8\u01a9"+ - "\u0005C\u0000\u0000\u01a9\u01d1\u0001\u0000\u0000\u0000\u01aa\u01d1\u0003"+ - "f3\u0000\u01ab\u01d1\u0003h4\u0000\u01ac\u01d1\u0003b1\u0000\u01ad\u01d1"+ - "\u0003F#\u0000\u01ae\u01d1\u0003j5\u0000\u01af\u01b0\u0005A\u0000\u0000"+ - "\u01b0\u01b5\u0003d2\u0000\u01b1\u01b2\u0005!\u0000\u0000\u01b2\u01b4"+ - "\u0003d2\u0000\u01b3\u01b1\u0001\u0000\u0000\u0000\u01b4\u01b7\u0001\u0000"+ - "\u0000\u0000\u01b5\u01b3\u0001\u0000\u0000\u0000\u01b5\u01b6\u0001\u0000"+ - "\u0000\u0000\u01b6\u01b8\u0001\u0000\u0000\u0000\u01b7\u01b5\u0001\u0000"+ - "\u0000\u0000\u01b8\u01b9\u0005B\u0000\u0000\u01b9\u01d1\u0001\u0000\u0000"+ - "\u0000\u01ba\u01bb\u0005A\u0000\u0000\u01bb\u01c0\u0003b1\u0000\u01bc"+ - "\u01bd\u0005!\u0000\u0000\u01bd\u01bf\u0003b1\u0000\u01be\u01bc\u0001"+ - "\u0000\u0000\u0000\u01bf\u01c2\u0001\u0000\u0000\u0000\u01c0\u01be\u0001"+ - "\u0000\u0000\u0000\u01c0\u01c1\u0001\u0000\u0000\u0000\u01c1\u01c3\u0001"+ - "\u0000\u0000\u0000\u01c2\u01c0\u0001\u0000\u0000\u0000\u01c3\u01c4\u0005"+ - "B\u0000\u0000\u01c4\u01d1\u0001\u0000\u0000\u0000\u01c5\u01c6\u0005A\u0000"+ - "\u0000\u01c6\u01cb\u0003j5\u0000\u01c7\u01c8\u0005!\u0000\u0000\u01c8"+ - "\u01ca\u0003j5\u0000\u01c9\u01c7\u0001\u0000\u0000\u0000\u01ca\u01cd\u0001"+ - "\u0000\u0000\u0000\u01cb\u01c9\u0001\u0000\u0000\u0000\u01cb\u01cc\u0001"+ - "\u0000\u0000\u0000\u01cc\u01ce\u0001\u0000\u0000\u0000\u01cd\u01cb\u0001"+ - "\u0000\u0000\u0000\u01ce\u01cf\u0005B\u0000\u0000\u01cf\u01d1\u0001\u0000"+ - "\u0000\u0000\u01d0\u01a6\u0001\u0000\u0000\u0000\u01d0\u01a7\u0001\u0000"+ - "\u0000\u0000\u01d0\u01aa\u0001\u0000\u0000\u0000\u01d0\u01ab\u0001\u0000"+ - "\u0000\u0000\u01d0\u01ac\u0001\u0000\u0000\u0000\u01d0\u01ad\u0001\u0000"+ - "\u0000\u0000\u01d0\u01ae\u0001\u0000\u0000\u0000\u01d0\u01af\u0001\u0000"+ - "\u0000\u0000\u01d0\u01ba\u0001\u0000\u0000\u0000\u01d0\u01c5\u0001\u0000"+ - "\u0000\u0000\u01d1E\u0001\u0000\u0000\u0000\u01d2\u01d5\u0005/\u0000\u0000"+ - "\u01d3\u01d5\u0005@\u0000\u0000\u01d4\u01d2\u0001\u0000\u0000\u0000\u01d4"+ - "\u01d3\u0001\u0000\u0000\u0000\u01d5G\u0001\u0000\u0000\u0000\u01d6\u01d9"+ - "\u0003@ \u0000\u01d7\u01d9\u0003F#\u0000\u01d8\u01d6\u0001\u0000\u0000"+ - "\u0000\u01d8\u01d7\u0001\u0000\u0000\u0000\u01d9I\u0001\u0000\u0000\u0000"+ - "\u01da\u01db\u0005\t\u0000\u0000\u01db\u01dc\u0005\u001a\u0000\u0000\u01dc"+ - "K\u0001\u0000\u0000\u0000\u01dd\u01de\u0005\u000e\u0000\u0000\u01de\u01e3"+ - "\u0003N\'\u0000\u01df\u01e0\u0005!\u0000\u0000\u01e0\u01e2\u0003N\'\u0000"+ - "\u01e1\u01df\u0001\u0000\u0000\u0000\u01e2\u01e5\u0001\u0000\u0000\u0000"+ - "\u01e3\u01e1\u0001\u0000\u0000\u0000\u01e3\u01e4\u0001\u0000\u0000\u0000"+ - "\u01e4M\u0001\u0000\u0000\u0000\u01e5\u01e3\u0001\u0000\u0000\u0000\u01e6"+ - "\u01e8\u0003\n\u0005\u0000\u01e7\u01e9\u0007\u0004\u0000\u0000\u01e8\u01e7"+ - "\u0001\u0000\u0000\u0000\u01e8\u01e9\u0001\u0000\u0000\u0000\u01e9\u01ec"+ - "\u0001\u0000\u0000\u0000\u01ea\u01eb\u0005-\u0000\u0000\u01eb\u01ed\u0007"+ - "\u0005\u0000\u0000\u01ec\u01ea\u0001\u0000\u0000\u0000\u01ec\u01ed\u0001"+ - "\u0000\u0000\u0000\u01edO\u0001\u0000\u0000\u0000\u01ee\u01ef\u0005\b"+ - "\u0000\u0000\u01ef\u01f0\u0003>\u001f\u0000\u01f0Q\u0001\u0000\u0000\u0000"+ - "\u01f1\u01f2\u0005\u0002\u0000\u0000\u01f2\u01f3\u0003>\u001f\u0000\u01f3"+ - "S\u0001\u0000\u0000\u0000\u01f4\u01f5\u0005\u000b\u0000\u0000\u01f5\u01fa"+ - "\u0003V+\u0000\u01f6\u01f7\u0005!\u0000\u0000\u01f7\u01f9\u0003V+\u0000"+ - "\u01f8\u01f6\u0001\u0000\u0000\u0000\u01f9\u01fc\u0001\u0000\u0000\u0000"+ - "\u01fa\u01f8\u0001\u0000\u0000\u0000\u01fa\u01fb\u0001\u0000\u0000\u0000"+ - "\u01fbU\u0001\u0000\u0000\u0000\u01fc\u01fa\u0001\u0000\u0000\u0000\u01fd"+ - "\u01fe\u0003<\u001e\u0000\u01fe\u01ff\u0005T\u0000\u0000\u01ff\u0200\u0003"+ - "<\u001e\u0000\u0200W\u0001\u0000\u0000\u0000\u0201\u0202\u0005\u0001\u0000"+ - "\u0000\u0202\u0203\u0003\u0014\n\u0000\u0203\u0205\u0003j5\u0000\u0204"+ - "\u0206\u0003^/\u0000\u0205\u0204\u0001\u0000\u0000\u0000\u0205\u0206\u0001"+ - "\u0000\u0000\u0000\u0206Y\u0001\u0000\u0000\u0000\u0207\u0208\u0005\u0007"+ - "\u0000\u0000\u0208\u0209\u0003\u0014\n\u0000\u0209\u020a\u0003j5\u0000"+ - "\u020a[\u0001\u0000\u0000\u0000\u020b\u020c\u0005\n\u0000\u0000\u020c"+ - "\u020d\u0003:\u001d\u0000\u020d]\u0001\u0000\u0000\u0000\u020e\u0213\u0003"+ - "`0\u0000\u020f\u0210\u0005!\u0000\u0000\u0210\u0212\u0003`0\u0000\u0211"+ - "\u020f\u0001\u0000\u0000\u0000\u0212\u0215\u0001\u0000\u0000\u0000\u0213"+ - "\u0211\u0001\u0000\u0000\u0000\u0213\u0214\u0001\u0000\u0000\u0000\u0214"+ - "_\u0001\u0000\u0000\u0000\u0215\u0213\u0001\u0000\u0000\u0000\u0216\u0217"+ - "\u0003@ \u0000\u0217\u0218\u0005\u001f\u0000\u0000\u0218\u0219\u0003D"+ - "\"\u0000\u0219a\u0001\u0000\u0000\u0000\u021a\u021b\u0007\u0006\u0000"+ - "\u0000\u021bc\u0001\u0000\u0000\u0000\u021c\u021f\u0003f3\u0000\u021d"+ - "\u021f\u0003h4\u0000\u021e\u021c\u0001\u0000\u0000\u0000\u021e\u021d\u0001"+ - "\u0000\u0000\u0000\u021fe\u0001\u0000\u0000\u0000\u0220\u0222\u0007\u0000"+ - "\u0000\u0000\u0221\u0220\u0001\u0000\u0000\u0000\u0221\u0222\u0001\u0000"+ - "\u0000\u0000\u0222\u0223\u0001\u0000\u0000\u0000\u0223\u0224\u0005\u001b"+ - "\u0000\u0000\u0224g\u0001\u0000\u0000\u0000\u0225\u0227\u0007\u0000\u0000"+ - "\u0000\u0226\u0225\u0001\u0000\u0000\u0000\u0226\u0227\u0001\u0000\u0000"+ - "\u0000\u0227\u0228\u0001\u0000\u0000\u0000\u0228\u0229\u0005\u001a\u0000"+ - "\u0000\u0229i\u0001\u0000\u0000\u0000\u022a\u022b\u0005\u0019\u0000\u0000"+ - "\u022bk\u0001\u0000\u0000\u0000\u022c\u022d\u0007\u0007\u0000\u0000\u022d"+ - "m\u0001\u0000\u0000\u0000\u022e\u022f\u0005\u0005\u0000\u0000\u022f\u0230"+ - "\u0003p8\u0000\u0230o\u0001\u0000\u0000\u0000\u0231\u0232\u0005A\u0000"+ - "\u0000\u0232\u0233\u0003\u0002\u0001\u0000\u0233\u0234\u0005B\u0000\u0000"+ - "\u0234q\u0001\u0000\u0000\u0000\u0235\u0236\u0005\r\u0000\u0000\u0236"+ - "\u0237\u0005d\u0000\u0000\u0237s\u0001\u0000\u0000\u0000\u0238\u0239\u0005"+ - "\u0003\u0000\u0000\u0239\u023c\u0005Z\u0000\u0000\u023a\u023b\u0005X\u0000"+ - "\u0000\u023b\u023d\u0003<\u001e\u0000\u023c\u023a\u0001\u0000\u0000\u0000"+ - "\u023c\u023d\u0001\u0000\u0000\u0000\u023d\u0247\u0001\u0000\u0000\u0000"+ - "\u023e\u023f\u0005Y\u0000\u0000\u023f\u0244\u0003v;\u0000\u0240\u0241"+ - "\u0005!\u0000\u0000\u0241\u0243\u0003v;\u0000\u0242\u0240\u0001\u0000"+ - "\u0000\u0000\u0243\u0246\u0001\u0000\u0000\u0000\u0244\u0242\u0001\u0000"+ - "\u0000\u0000\u0244\u0245\u0001\u0000\u0000\u0000\u0245\u0248\u0001\u0000"+ - "\u0000\u0000\u0246\u0244\u0001\u0000\u0000\u0000\u0247\u023e\u0001\u0000"+ - "\u0000\u0000\u0247\u0248\u0001\u0000\u0000\u0000\u0248u\u0001\u0000\u0000"+ - "\u0000\u0249\u024a\u0003<\u001e\u0000\u024a\u024b\u0005\u001f\u0000\u0000"+ - "\u024b\u024d\u0001\u0000\u0000\u0000\u024c\u0249\u0001\u0000\u0000\u0000"+ - "\u024c\u024d\u0001\u0000\u0000\u0000\u024d\u024e\u0001\u0000\u0000\u0000"+ - "\u024e\u024f\u0003<\u001e\u0000\u024fw\u0001\u0000\u0000\u0000\u0250\u0251"+ - "\u0005\u0012\u0000\u0000\u0251\u0252\u0003$\u0012\u0000\u0252\u0253\u0005"+ - "X\u0000\u0000\u0253\u0254\u0003>\u001f\u0000\u0254y\u0001\u0000\u0000"+ - "\u0000\u0255\u0256\u0005\u0011\u0000\u0000\u0256\u0259\u00036\u001b\u0000"+ - "\u0257\u0258\u0005\u001c\u0000\u0000\u0258\u025a\u0003\u001e\u000f\u0000"+ - "\u0259\u0257\u0001\u0000\u0000\u0000\u0259\u025a\u0001\u0000\u0000\u0000"+ - "\u025a{\u0001\u0000\u0000\u0000;\u0087\u0090\u00a2\u00ae\u00b7\u00bf\u00c5"+ + "\u0001\u001c\u0001\u001c\u0003\u001c\u0186\b\u001c\u0001\u001d\u0001\u001d"+ + "\u0001\u001d\u0005\u001d\u018b\b\u001d\n\u001d\f\u001d\u018e\t\u001d\u0001"+ + "\u001e\u0001\u001e\u0001\u001e\u0005\u001e\u0193\b\u001e\n\u001e\f\u001e"+ + "\u0196\t\u001e\u0001\u001f\u0001\u001f\u0001\u001f\u0005\u001f\u019b\b"+ + "\u001f\n\u001f\f\u001f\u019e\t\u001f\u0001 \u0001 \u0001!\u0001!\u0003"+ + "!\u01a4\b!\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001"+ + "\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0005\"\u01b3\b\"\n\"\f\"\u01b6"+ + "\t\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0005\"\u01be\b\""+ + "\n\"\f\"\u01c1\t\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0005"+ + "\"\u01c9\b\"\n\"\f\"\u01cc\t\"\u0001\"\u0001\"\u0003\"\u01d0\b\"\u0001"+ + "#\u0001#\u0003#\u01d4\b#\u0001$\u0001$\u0003$\u01d8\b$\u0001%\u0001%\u0001"+ + "%\u0001&\u0001&\u0001&\u0001&\u0005&\u01e1\b&\n&\f&\u01e4\t&\u0001\'\u0001"+ + "\'\u0003\'\u01e8\b\'\u0001\'\u0001\'\u0003\'\u01ec\b\'\u0001(\u0001(\u0001"+ + "(\u0001)\u0001)\u0001)\u0001*\u0001*\u0001*\u0001*\u0005*\u01f8\b*\n*"+ + "\f*\u01fb\t*\u0001+\u0001+\u0001+\u0001+\u0001,\u0001,\u0001,\u0001,\u0003"+ + ",\u0205\b,\u0001-\u0001-\u0001-\u0001-\u0001.\u0001.\u0001.\u0001/\u0001"+ + "/\u0001/\u0005/\u0211\b/\n/\f/\u0214\t/\u00010\u00010\u00010\u00010\u0001"+ + "1\u00011\u00012\u00012\u00032\u021e\b2\u00013\u00033\u0221\b3\u00013\u0001"+ + "3\u00014\u00034\u0226\b4\u00014\u00014\u00015\u00015\u00016\u00016\u0001"+ + "7\u00017\u00017\u00018\u00018\u00018\u00018\u00019\u00019\u00019\u0001"+ + ":\u0001:\u0001:\u0001:\u0003:\u023c\b:\u0001:\u0001:\u0001:\u0001:\u0005"+ + ":\u0242\b:\n:\f:\u0245\t:\u0003:\u0247\b:\u0001;\u0001;\u0001;\u0003;"+ + "\u024c\b;\u0001;\u0001;\u0001<\u0001<\u0001<\u0001<\u0001<\u0001=\u0001"+ + "=\u0001=\u0001=\u0003=\u0259\b=\u0001=\u0000\u0004\u0002\n\u0012\u0014"+ + ">\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a"+ + "\u001c\u001e \"$&(*,.02468:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz\u0000\b\u0001"+ + "\u0000:;\u0001\u0000<>\u0002\u0000\u0019\u0019LL\u0001\u0000CD\u0002\u0000"+ + "\u001e\u001e\"\"\u0002\u0000%%((\u0002\u0000$$22\u0002\u00003359\u0275"+ + "\u0000|\u0001\u0000\u0000\u0000\u0002\u007f\u0001\u0000\u0000\u0000\u0004"+ + "\u0090\u0001\u0000\u0000\u0000\u0006\u00a2\u0001\u0000\u0000\u0000\b\u00a4"+ + "\u0001\u0000\u0000\u0000\n\u00c5\u0001\u0000\u0000\u0000\f\u00e0\u0001"+ + "\u0000\u0000\u0000\u000e\u00e2\u0001\u0000\u0000\u0000\u0010\u00eb\u0001"+ + "\u0000\u0000\u0000\u0012\u00f1\u0001\u0000\u0000\u0000\u0014\u0106\u0001"+ + "\u0000\u0000\u0000\u0016\u0110\u0001\u0000\u0000\u0000\u0018\u0121\u0001"+ + "\u0000\u0000\u0000\u001a\u0123\u0001\u0000\u0000\u0000\u001c\u0125\u0001"+ + "\u0000\u0000\u0000\u001e\u0128\u0001\u0000\u0000\u0000 \u0133\u0001\u0000"+ + "\u0000\u0000\"\u0137\u0001\u0000\u0000\u0000$\u0146\u0001\u0000\u0000"+ + "\u0000&\u014a\u0001\u0000\u0000\u0000(\u014c\u0001\u0000\u0000\u0000*"+ + "\u0150\u0001\u0000\u0000\u0000,\u0152\u0001\u0000\u0000\u0000.\u015b\u0001"+ + "\u0000\u0000\u00000\u015f\u0001\u0000\u0000\u00002\u016f\u0001\u0000\u0000"+ + "\u00004\u0172\u0001\u0000\u0000\u00006\u017a\u0001\u0000\u0000\u00008"+ + "\u0182\u0001\u0000\u0000\u0000:\u0187\u0001\u0000\u0000\u0000<\u018f\u0001"+ + "\u0000\u0000\u0000>\u0197\u0001\u0000\u0000\u0000@\u019f\u0001\u0000\u0000"+ + "\u0000B\u01a3\u0001\u0000\u0000\u0000D\u01cf\u0001\u0000\u0000\u0000F"+ + "\u01d3\u0001\u0000\u0000\u0000H\u01d7\u0001\u0000\u0000\u0000J\u01d9\u0001"+ + "\u0000\u0000\u0000L\u01dc\u0001\u0000\u0000\u0000N\u01e5\u0001\u0000\u0000"+ + "\u0000P\u01ed\u0001\u0000\u0000\u0000R\u01f0\u0001\u0000\u0000\u0000T"+ + "\u01f3\u0001\u0000\u0000\u0000V\u01fc\u0001\u0000\u0000\u0000X\u0200\u0001"+ + "\u0000\u0000\u0000Z\u0206\u0001\u0000\u0000\u0000\\\u020a\u0001\u0000"+ + "\u0000\u0000^\u020d\u0001\u0000\u0000\u0000`\u0215\u0001\u0000\u0000\u0000"+ + "b\u0219\u0001\u0000\u0000\u0000d\u021d\u0001\u0000\u0000\u0000f\u0220"+ + "\u0001\u0000\u0000\u0000h\u0225\u0001\u0000\u0000\u0000j\u0229\u0001\u0000"+ + "\u0000\u0000l\u022b\u0001\u0000\u0000\u0000n\u022d\u0001\u0000\u0000\u0000"+ + "p\u0230\u0001\u0000\u0000\u0000r\u0234\u0001\u0000\u0000\u0000t\u0237"+ + "\u0001\u0000\u0000\u0000v\u024b\u0001\u0000\u0000\u0000x\u024f\u0001\u0000"+ + "\u0000\u0000z\u0254\u0001\u0000\u0000\u0000|}\u0003\u0002\u0001\u0000"+ + "}~\u0005\u0000\u0000\u0001~\u0001\u0001\u0000\u0000\u0000\u007f\u0080"+ + "\u0006\u0001\uffff\uffff\u0000\u0080\u0081\u0003\u0004\u0002\u0000\u0081"+ + "\u0087\u0001\u0000\u0000\u0000\u0082\u0083\n\u0001\u0000\u0000\u0083\u0084"+ + "\u0005\u0018\u0000\u0000\u0084\u0086\u0003\u0006\u0003\u0000\u0085\u0082"+ + "\u0001\u0000\u0000\u0000\u0086\u0089\u0001\u0000\u0000\u0000\u0087\u0085"+ + "\u0001\u0000\u0000\u0000\u0087\u0088\u0001\u0000\u0000\u0000\u0088\u0003"+ + "\u0001\u0000\u0000\u0000\u0089\u0087\u0001\u0000\u0000\u0000\u008a\u0091"+ + "\u0003n7\u0000\u008b\u0091\u0003\"\u0011\u0000\u008c\u0091\u0003\u001c"+ + "\u000e\u0000\u008d\u0091\u0003r9\u0000\u008e\u008f\u0004\u0002\u0001\u0000"+ + "\u008f\u0091\u00030\u0018\u0000\u0090\u008a\u0001\u0000\u0000\u0000\u0090"+ + "\u008b\u0001\u0000\u0000\u0000\u0090\u008c\u0001\u0000\u0000\u0000\u0090"+ + "\u008d\u0001\u0000\u0000\u0000\u0090\u008e\u0001\u0000\u0000\u0000\u0091"+ + "\u0005\u0001\u0000\u0000\u0000\u0092\u00a3\u00032\u0019\u0000\u0093\u00a3"+ + "\u0003\b\u0004\u0000\u0094\u00a3\u0003P(\u0000\u0095\u00a3\u0003J%\u0000"+ + "\u0096\u00a3\u00034\u001a\u0000\u0097\u00a3\u0003L&\u0000\u0098\u00a3"+ + "\u0003R)\u0000\u0099\u00a3\u0003T*\u0000\u009a\u00a3\u0003X,\u0000\u009b"+ + "\u00a3\u0003Z-\u0000\u009c\u00a3\u0003t:\u0000\u009d\u00a3\u0003\\.\u0000"+ + "\u009e\u009f\u0004\u0003\u0002\u0000\u009f\u00a3\u0003z=\u0000\u00a0\u00a1"+ + "\u0004\u0003\u0003\u0000\u00a1\u00a3\u0003x<\u0000\u00a2\u0092\u0001\u0000"+ + "\u0000\u0000\u00a2\u0093\u0001\u0000\u0000\u0000\u00a2\u0094\u0001\u0000"+ + "\u0000\u0000\u00a2\u0095\u0001\u0000\u0000\u0000\u00a2\u0096\u0001\u0000"+ + "\u0000\u0000\u00a2\u0097\u0001\u0000\u0000\u0000\u00a2\u0098\u0001\u0000"+ + "\u0000\u0000\u00a2\u0099\u0001\u0000\u0000\u0000\u00a2\u009a\u0001\u0000"+ + "\u0000\u0000\u00a2\u009b\u0001\u0000\u0000\u0000\u00a2\u009c\u0001\u0000"+ + "\u0000\u0000\u00a2\u009d\u0001\u0000\u0000\u0000\u00a2\u009e\u0001\u0000"+ + "\u0000\u0000\u00a2\u00a0\u0001\u0000\u0000\u0000\u00a3\u0007\u0001\u0000"+ + "\u0000\u0000\u00a4\u00a5\u0005\u0010\u0000\u0000\u00a5\u00a6\u0003\n\u0005"+ + "\u0000\u00a6\t\u0001\u0000\u0000\u0000\u00a7\u00a8\u0006\u0005\uffff\uffff"+ + "\u0000\u00a8\u00a9\u0005+\u0000\u0000\u00a9\u00c6\u0003\n\u0005\b\u00aa"+ + "\u00c6\u0003\u0010\b\u0000\u00ab\u00c6\u0003\f\u0006\u0000\u00ac\u00ae"+ + "\u0003\u0010\b\u0000\u00ad\u00af\u0005+\u0000\u0000\u00ae\u00ad\u0001"+ + "\u0000\u0000\u0000\u00ae\u00af\u0001\u0000\u0000\u0000\u00af\u00b0\u0001"+ + "\u0000\u0000\u0000\u00b0\u00b1\u0005&\u0000\u0000\u00b1\u00b2\u0005*\u0000"+ + "\u0000\u00b2\u00b7\u0003\u0010\b\u0000\u00b3\u00b4\u0005!\u0000\u0000"+ + "\u00b4\u00b6\u0003\u0010\b\u0000\u00b5\u00b3\u0001\u0000\u0000\u0000\u00b6"+ + "\u00b9\u0001\u0000\u0000\u0000\u00b7\u00b5\u0001\u0000\u0000\u0000\u00b7"+ + "\u00b8\u0001\u0000\u0000\u0000\u00b8\u00ba\u0001\u0000\u0000\u0000\u00b9"+ + "\u00b7\u0001\u0000\u0000\u0000\u00ba\u00bb\u00051\u0000\u0000\u00bb\u00c6"+ + "\u0001\u0000\u0000\u0000\u00bc\u00bd\u0003\u0010\b\u0000\u00bd\u00bf\u0005"+ + "\'\u0000\u0000\u00be\u00c0\u0005+\u0000\u0000\u00bf\u00be\u0001\u0000"+ + "\u0000\u0000\u00bf\u00c0\u0001\u0000\u0000\u0000\u00c0\u00c1\u0001\u0000"+ + "\u0000\u0000\u00c1\u00c2\u0005,\u0000\u0000\u00c2\u00c6\u0001\u0000\u0000"+ + "\u0000\u00c3\u00c4\u0004\u0005\u0004\u0000\u00c4\u00c6\u0003\u000e\u0007"+ + "\u0000\u00c5\u00a7\u0001\u0000\u0000\u0000\u00c5\u00aa\u0001\u0000\u0000"+ + "\u0000\u00c5\u00ab\u0001\u0000\u0000\u0000\u00c5\u00ac\u0001\u0000\u0000"+ + "\u0000\u00c5\u00bc\u0001\u0000\u0000\u0000\u00c5\u00c3\u0001\u0000\u0000"+ + "\u0000\u00c6\u00cf\u0001\u0000\u0000\u0000\u00c7\u00c8\n\u0005\u0000\u0000"+ + "\u00c8\u00c9\u0005\u001d\u0000\u0000\u00c9\u00ce\u0003\n\u0005\u0006\u00ca"+ + "\u00cb\n\u0004\u0000\u0000\u00cb\u00cc\u0005.\u0000\u0000\u00cc\u00ce"+ + "\u0003\n\u0005\u0005\u00cd\u00c7\u0001\u0000\u0000\u0000\u00cd\u00ca\u0001"+ + "\u0000\u0000\u0000\u00ce\u00d1\u0001\u0000\u0000\u0000\u00cf\u00cd\u0001"+ + "\u0000\u0000\u0000\u00cf\u00d0\u0001\u0000\u0000\u0000\u00d0\u000b\u0001"+ + "\u0000\u0000\u0000\u00d1\u00cf\u0001\u0000\u0000\u0000\u00d2\u00d4\u0003"+ + "\u0010\b\u0000\u00d3\u00d5\u0005+\u0000\u0000\u00d4\u00d3\u0001\u0000"+ + "\u0000\u0000\u00d4\u00d5\u0001\u0000\u0000\u0000\u00d5\u00d6\u0001\u0000"+ + "\u0000\u0000\u00d6\u00d7\u0005)\u0000\u0000\u00d7\u00d8\u0003j5\u0000"+ + "\u00d8\u00e1\u0001\u0000\u0000\u0000\u00d9\u00db\u0003\u0010\b\u0000\u00da"+ + "\u00dc\u0005+\u0000\u0000\u00db\u00da\u0001\u0000\u0000\u0000\u00db\u00dc"+ + "\u0001\u0000\u0000\u0000\u00dc\u00dd\u0001\u0000\u0000\u0000\u00dd\u00de"+ + "\u00050\u0000\u0000\u00de\u00df\u0003j5\u0000\u00df\u00e1\u0001\u0000"+ + "\u0000\u0000\u00e0\u00d2\u0001\u0000\u0000\u0000\u00e0\u00d9\u0001\u0000"+ + "\u0000\u0000\u00e1\r\u0001\u0000\u0000\u0000\u00e2\u00e3\u0003\u0010\b"+ + "\u0000\u00e3\u00e4\u0005?\u0000\u0000\u00e4\u00e5\u0003j5\u0000\u00e5"+ + "\u000f\u0001\u0000\u0000\u0000\u00e6\u00ec\u0003\u0012\t\u0000\u00e7\u00e8"+ + "\u0003\u0012\t\u0000\u00e8\u00e9\u0003l6\u0000\u00e9\u00ea\u0003\u0012"+ + "\t\u0000\u00ea\u00ec\u0001\u0000\u0000\u0000\u00eb\u00e6\u0001\u0000\u0000"+ + "\u0000\u00eb\u00e7\u0001\u0000\u0000\u0000\u00ec\u0011\u0001\u0000\u0000"+ + "\u0000\u00ed\u00ee\u0006\t\uffff\uffff\u0000\u00ee\u00f2\u0003\u0014\n"+ + "\u0000\u00ef\u00f0\u0007\u0000\u0000\u0000\u00f0\u00f2\u0003\u0012\t\u0003"+ + "\u00f1\u00ed\u0001\u0000\u0000\u0000\u00f1\u00ef\u0001\u0000\u0000\u0000"+ + "\u00f2\u00fb\u0001\u0000\u0000\u0000\u00f3\u00f4\n\u0002\u0000\u0000\u00f4"+ + "\u00f5\u0007\u0001\u0000\u0000\u00f5\u00fa\u0003\u0012\t\u0003\u00f6\u00f7"+ + "\n\u0001\u0000\u0000\u00f7\u00f8\u0007\u0000\u0000\u0000\u00f8\u00fa\u0003"+ + "\u0012\t\u0002\u00f9\u00f3\u0001\u0000\u0000\u0000\u00f9\u00f6\u0001\u0000"+ + "\u0000\u0000\u00fa\u00fd\u0001\u0000\u0000\u0000\u00fb\u00f9\u0001\u0000"+ + "\u0000\u0000\u00fb\u00fc\u0001\u0000\u0000\u0000\u00fc\u0013\u0001\u0000"+ + "\u0000\u0000\u00fd\u00fb\u0001\u0000\u0000\u0000\u00fe\u00ff\u0006\n\uffff"+ + "\uffff\u0000\u00ff\u0107\u0003D\"\u0000\u0100\u0107\u0003:\u001d\u0000"+ + "\u0101\u0107\u0003\u0016\u000b\u0000\u0102\u0103\u0005*\u0000\u0000\u0103"+ + "\u0104\u0003\n\u0005\u0000\u0104\u0105\u00051\u0000\u0000\u0105\u0107"+ + "\u0001\u0000\u0000\u0000\u0106\u00fe\u0001\u0000\u0000\u0000\u0106\u0100"+ + "\u0001\u0000\u0000\u0000\u0106\u0101\u0001\u0000\u0000\u0000\u0106\u0102"+ + "\u0001\u0000\u0000\u0000\u0107\u010d\u0001\u0000\u0000\u0000\u0108\u0109"+ + "\n\u0001\u0000\u0000\u0109\u010a\u0005 \u0000\u0000\u010a\u010c\u0003"+ + "\u001a\r\u0000\u010b\u0108\u0001\u0000\u0000\u0000\u010c\u010f\u0001\u0000"+ + "\u0000\u0000\u010d\u010b\u0001\u0000\u0000\u0000\u010d\u010e\u0001\u0000"+ + "\u0000\u0000\u010e\u0015\u0001\u0000\u0000\u0000\u010f\u010d\u0001\u0000"+ + "\u0000\u0000\u0110\u0111\u0003\u0018\f\u0000\u0111\u011b\u0005*\u0000"+ + "\u0000\u0112\u011c\u0005<\u0000\u0000\u0113\u0118\u0003\n\u0005\u0000"+ + "\u0114\u0115\u0005!\u0000\u0000\u0115\u0117\u0003\n\u0005\u0000\u0116"+ + "\u0114\u0001\u0000\u0000\u0000\u0117\u011a\u0001\u0000\u0000\u0000\u0118"+ + "\u0116\u0001\u0000\u0000\u0000\u0118\u0119\u0001\u0000\u0000\u0000\u0119"+ + "\u011c\u0001\u0000\u0000\u0000\u011a\u0118\u0001\u0000\u0000\u0000\u011b"+ + "\u0112\u0001\u0000\u0000\u0000\u011b\u0113\u0001\u0000\u0000\u0000\u011b"+ + "\u011c\u0001\u0000\u0000\u0000\u011c\u011d\u0001\u0000\u0000\u0000\u011d"+ + "\u011e\u00051\u0000\u0000\u011e\u0017\u0001\u0000\u0000\u0000\u011f\u0122"+ + "\u0005?\u0000\u0000\u0120\u0122\u0003H$\u0000\u0121\u011f\u0001\u0000"+ + "\u0000\u0000\u0121\u0120\u0001\u0000\u0000\u0000\u0122\u0019\u0001\u0000"+ + "\u0000\u0000\u0123\u0124\u0003@ \u0000\u0124\u001b\u0001\u0000\u0000\u0000"+ + "\u0125\u0126\u0005\f\u0000\u0000\u0126\u0127\u0003\u001e\u000f\u0000\u0127"+ + "\u001d\u0001\u0000\u0000\u0000\u0128\u012d\u0003 \u0010\u0000\u0129\u012a"+ + "\u0005!\u0000\u0000\u012a\u012c\u0003 \u0010\u0000\u012b\u0129\u0001\u0000"+ + "\u0000\u0000\u012c\u012f\u0001\u0000\u0000\u0000\u012d\u012b\u0001\u0000"+ + "\u0000\u0000\u012d\u012e\u0001\u0000\u0000\u0000\u012e\u001f\u0001\u0000"+ + "\u0000\u0000\u012f\u012d\u0001\u0000\u0000\u0000\u0130\u0131\u0003:\u001d"+ + "\u0000\u0131\u0132\u0005\u001f\u0000\u0000\u0132\u0134\u0001\u0000\u0000"+ + "\u0000\u0133\u0130\u0001\u0000\u0000\u0000\u0133\u0134\u0001\u0000\u0000"+ + "\u0000\u0134\u0135\u0001\u0000\u0000\u0000\u0135\u0136\u0003\n\u0005\u0000"+ + "\u0136!\u0001\u0000\u0000\u0000\u0137\u0138\u0005\u0006\u0000\u0000\u0138"+ + "\u013d\u0003$\u0012\u0000\u0139\u013a\u0005!\u0000\u0000\u013a\u013c\u0003"+ + "$\u0012\u0000\u013b\u0139\u0001\u0000\u0000\u0000\u013c\u013f\u0001\u0000"+ + "\u0000\u0000\u013d\u013b\u0001\u0000\u0000\u0000\u013d\u013e\u0001\u0000"+ + "\u0000\u0000\u013e\u0141\u0001\u0000\u0000\u0000\u013f\u013d\u0001\u0000"+ + "\u0000\u0000\u0140\u0142\u0003*\u0015\u0000\u0141\u0140\u0001\u0000\u0000"+ + "\u0000\u0141\u0142\u0001\u0000\u0000\u0000\u0142#\u0001\u0000\u0000\u0000"+ + "\u0143\u0144\u0003&\u0013\u0000\u0144\u0145\u0005h\u0000\u0000\u0145\u0147"+ + "\u0001\u0000\u0000\u0000\u0146\u0143\u0001\u0000\u0000\u0000\u0146\u0147"+ + "\u0001\u0000\u0000\u0000\u0147\u0148\u0001\u0000\u0000\u0000\u0148\u0149"+ + "\u0003(\u0014\u0000\u0149%\u0001\u0000\u0000\u0000\u014a\u014b\u0005L"+ + "\u0000\u0000\u014b\'\u0001\u0000\u0000\u0000\u014c\u014d\u0007\u0002\u0000"+ + "\u0000\u014d)\u0001\u0000\u0000\u0000\u014e\u0151\u0003,\u0016\u0000\u014f"+ + "\u0151\u0003.\u0017\u0000\u0150\u014e\u0001\u0000\u0000\u0000\u0150\u014f"+ + "\u0001\u0000\u0000\u0000\u0151+\u0001\u0000\u0000\u0000\u0152\u0153\u0005"+ + "K\u0000\u0000\u0153\u0158\u0005L\u0000\u0000\u0154\u0155\u0005!\u0000"+ + "\u0000\u0155\u0157\u0005L\u0000\u0000\u0156\u0154\u0001\u0000\u0000\u0000"+ + "\u0157\u015a\u0001\u0000\u0000\u0000\u0158\u0156\u0001\u0000\u0000\u0000"+ + "\u0158\u0159\u0001\u0000\u0000\u0000\u0159-\u0001\u0000\u0000\u0000\u015a"+ + "\u0158\u0001\u0000\u0000\u0000\u015b\u015c\u0005A\u0000\u0000\u015c\u015d"+ + "\u0003,\u0016\u0000\u015d\u015e\u0005B\u0000\u0000\u015e/\u0001\u0000"+ + "\u0000\u0000\u015f\u0160\u0005\u0013\u0000\u0000\u0160\u0165\u0003$\u0012"+ + "\u0000\u0161\u0162\u0005!\u0000\u0000\u0162\u0164\u0003$\u0012\u0000\u0163"+ + "\u0161\u0001\u0000\u0000\u0000\u0164\u0167\u0001\u0000\u0000\u0000\u0165"+ + "\u0163\u0001\u0000\u0000\u0000\u0165\u0166\u0001\u0000\u0000\u0000\u0166"+ + "\u0169\u0001\u0000\u0000\u0000\u0167\u0165\u0001\u0000\u0000\u0000\u0168"+ + "\u016a\u00036\u001b\u0000\u0169\u0168\u0001\u0000\u0000\u0000\u0169\u016a"+ + "\u0001\u0000\u0000\u0000\u016a\u016d\u0001\u0000\u0000\u0000\u016b\u016c"+ + "\u0005\u001c\u0000\u0000\u016c\u016e\u0003\u001e\u000f\u0000\u016d\u016b"+ + "\u0001\u0000\u0000\u0000\u016d\u016e\u0001\u0000\u0000\u0000\u016e1\u0001"+ + "\u0000\u0000\u0000\u016f\u0170\u0005\u0004\u0000\u0000\u0170\u0171\u0003"+ + "\u001e\u000f\u0000\u01713\u0001\u0000\u0000\u0000\u0172\u0174\u0005\u000f"+ + "\u0000\u0000\u0173\u0175\u00036\u001b\u0000\u0174\u0173\u0001\u0000\u0000"+ + "\u0000\u0174\u0175\u0001\u0000\u0000\u0000\u0175\u0178\u0001\u0000\u0000"+ + "\u0000\u0176\u0177\u0005\u001c\u0000\u0000\u0177\u0179\u0003\u001e\u000f"+ + "\u0000\u0178\u0176\u0001\u0000\u0000\u0000\u0178\u0179\u0001\u0000\u0000"+ + "\u0000\u01795\u0001\u0000\u0000\u0000\u017a\u017f\u00038\u001c\u0000\u017b"+ + "\u017c\u0005!\u0000\u0000\u017c\u017e\u00038\u001c\u0000\u017d\u017b\u0001"+ + "\u0000\u0000\u0000\u017e\u0181\u0001\u0000\u0000\u0000\u017f\u017d\u0001"+ + "\u0000\u0000\u0000\u017f\u0180\u0001\u0000\u0000\u0000\u01807\u0001\u0000"+ + "\u0000\u0000\u0181\u017f\u0001\u0000\u0000\u0000\u0182\u0185\u0003 \u0010"+ + "\u0000\u0183\u0184\u0005\u0010\u0000\u0000\u0184\u0186\u0003\n\u0005\u0000"+ + "\u0185\u0183\u0001\u0000\u0000\u0000\u0185\u0186\u0001\u0000\u0000\u0000"+ + "\u01869\u0001\u0000\u0000\u0000\u0187\u018c\u0003H$\u0000\u0188\u0189"+ + "\u0005#\u0000\u0000\u0189\u018b\u0003H$\u0000\u018a\u0188\u0001\u0000"+ + "\u0000\u0000\u018b\u018e\u0001\u0000\u0000\u0000\u018c\u018a\u0001\u0000"+ + "\u0000\u0000\u018c\u018d\u0001\u0000\u0000\u0000\u018d;\u0001\u0000\u0000"+ + "\u0000\u018e\u018c\u0001\u0000\u0000\u0000\u018f\u0194\u0003B!\u0000\u0190"+ + "\u0191\u0005#\u0000\u0000\u0191\u0193\u0003B!\u0000\u0192\u0190\u0001"+ + "\u0000\u0000\u0000\u0193\u0196\u0001\u0000\u0000\u0000\u0194\u0192\u0001"+ + "\u0000\u0000\u0000\u0194\u0195\u0001\u0000\u0000\u0000\u0195=\u0001\u0000"+ + "\u0000\u0000\u0196\u0194\u0001\u0000\u0000\u0000\u0197\u019c\u0003<\u001e"+ + "\u0000\u0198\u0199\u0005!\u0000\u0000\u0199\u019b\u0003<\u001e\u0000\u019a"+ + "\u0198\u0001\u0000\u0000\u0000\u019b\u019e\u0001\u0000\u0000\u0000\u019c"+ + "\u019a\u0001\u0000\u0000\u0000\u019c\u019d\u0001\u0000\u0000\u0000\u019d"+ + "?\u0001\u0000\u0000\u0000\u019e\u019c\u0001\u0000\u0000\u0000\u019f\u01a0"+ + "\u0007\u0003\u0000\u0000\u01a0A\u0001\u0000\u0000\u0000\u01a1\u01a4\u0005"+ + "P\u0000\u0000\u01a2\u01a4\u0003F#\u0000\u01a3\u01a1\u0001\u0000\u0000"+ + "\u0000\u01a3\u01a2\u0001\u0000\u0000\u0000\u01a4C\u0001\u0000\u0000\u0000"+ + "\u01a5\u01d0\u0005,\u0000\u0000\u01a6\u01a7\u0003h4\u0000\u01a7\u01a8"+ + "\u0005C\u0000\u0000\u01a8\u01d0\u0001\u0000\u0000\u0000\u01a9\u01d0\u0003"+ + "f3\u0000\u01aa\u01d0\u0003h4\u0000\u01ab\u01d0\u0003b1\u0000\u01ac\u01d0"+ + "\u0003F#\u0000\u01ad\u01d0\u0003j5\u0000\u01ae\u01af\u0005A\u0000\u0000"+ + "\u01af\u01b4\u0003d2\u0000\u01b0\u01b1\u0005!\u0000\u0000\u01b1\u01b3"+ + "\u0003d2\u0000\u01b2\u01b0\u0001\u0000\u0000\u0000\u01b3\u01b6\u0001\u0000"+ + "\u0000\u0000\u01b4\u01b2\u0001\u0000\u0000\u0000\u01b4\u01b5\u0001\u0000"+ + "\u0000\u0000\u01b5\u01b7\u0001\u0000\u0000\u0000\u01b6\u01b4\u0001\u0000"+ + "\u0000\u0000\u01b7\u01b8\u0005B\u0000\u0000\u01b8\u01d0\u0001\u0000\u0000"+ + "\u0000\u01b9\u01ba\u0005A\u0000\u0000\u01ba\u01bf\u0003b1\u0000\u01bb"+ + "\u01bc\u0005!\u0000\u0000\u01bc\u01be\u0003b1\u0000\u01bd\u01bb\u0001"+ + "\u0000\u0000\u0000\u01be\u01c1\u0001\u0000\u0000\u0000\u01bf\u01bd\u0001"+ + "\u0000\u0000\u0000\u01bf\u01c0\u0001\u0000\u0000\u0000\u01c0\u01c2\u0001"+ + "\u0000\u0000\u0000\u01c1\u01bf\u0001\u0000\u0000\u0000\u01c2\u01c3\u0005"+ + "B\u0000\u0000\u01c3\u01d0\u0001\u0000\u0000\u0000\u01c4\u01c5\u0005A\u0000"+ + "\u0000\u01c5\u01ca\u0003j5\u0000\u01c6\u01c7\u0005!\u0000\u0000\u01c7"+ + "\u01c9\u0003j5\u0000\u01c8\u01c6\u0001\u0000\u0000\u0000\u01c9\u01cc\u0001"+ + "\u0000\u0000\u0000\u01ca\u01c8\u0001\u0000\u0000\u0000\u01ca\u01cb\u0001"+ + "\u0000\u0000\u0000\u01cb\u01cd\u0001\u0000\u0000\u0000\u01cc\u01ca\u0001"+ + "\u0000\u0000\u0000\u01cd\u01ce\u0005B\u0000\u0000\u01ce\u01d0\u0001\u0000"+ + "\u0000\u0000\u01cf\u01a5\u0001\u0000\u0000\u0000\u01cf\u01a6\u0001\u0000"+ + "\u0000\u0000\u01cf\u01a9\u0001\u0000\u0000\u0000\u01cf\u01aa\u0001\u0000"+ + "\u0000\u0000\u01cf\u01ab\u0001\u0000\u0000\u0000\u01cf\u01ac\u0001\u0000"+ + "\u0000\u0000\u01cf\u01ad\u0001\u0000\u0000\u0000\u01cf\u01ae\u0001\u0000"+ + "\u0000\u0000\u01cf\u01b9\u0001\u0000\u0000\u0000\u01cf\u01c4\u0001\u0000"+ + "\u0000\u0000\u01d0E\u0001\u0000\u0000\u0000\u01d1\u01d4\u0005/\u0000\u0000"+ + "\u01d2\u01d4\u0005@\u0000\u0000\u01d3\u01d1\u0001\u0000\u0000\u0000\u01d3"+ + "\u01d2\u0001\u0000\u0000\u0000\u01d4G\u0001\u0000\u0000\u0000\u01d5\u01d8"+ + "\u0003@ \u0000\u01d6\u01d8\u0003F#\u0000\u01d7\u01d5\u0001\u0000\u0000"+ + "\u0000\u01d7\u01d6\u0001\u0000\u0000\u0000\u01d8I\u0001\u0000\u0000\u0000"+ + "\u01d9\u01da\u0005\t\u0000\u0000\u01da\u01db\u0005\u001a\u0000\u0000\u01db"+ + "K\u0001\u0000\u0000\u0000\u01dc\u01dd\u0005\u000e\u0000\u0000\u01dd\u01e2"+ + "\u0003N\'\u0000\u01de\u01df\u0005!\u0000\u0000\u01df\u01e1\u0003N\'\u0000"+ + "\u01e0\u01de\u0001\u0000\u0000\u0000\u01e1\u01e4\u0001\u0000\u0000\u0000"+ + "\u01e2\u01e0\u0001\u0000\u0000\u0000\u01e2\u01e3\u0001\u0000\u0000\u0000"+ + "\u01e3M\u0001\u0000\u0000\u0000\u01e4\u01e2\u0001\u0000\u0000\u0000\u01e5"+ + "\u01e7\u0003\n\u0005\u0000\u01e6\u01e8\u0007\u0004\u0000\u0000\u01e7\u01e6"+ + "\u0001\u0000\u0000\u0000\u01e7\u01e8\u0001\u0000\u0000\u0000\u01e8\u01eb"+ + "\u0001\u0000\u0000\u0000\u01e9\u01ea\u0005-\u0000\u0000\u01ea\u01ec\u0007"+ + "\u0005\u0000\u0000\u01eb\u01e9\u0001\u0000\u0000\u0000\u01eb\u01ec\u0001"+ + "\u0000\u0000\u0000\u01ecO\u0001\u0000\u0000\u0000\u01ed\u01ee\u0005\b"+ + "\u0000\u0000\u01ee\u01ef\u0003>\u001f\u0000\u01efQ\u0001\u0000\u0000\u0000"+ + "\u01f0\u01f1\u0005\u0002\u0000\u0000\u01f1\u01f2\u0003>\u001f\u0000\u01f2"+ + "S\u0001\u0000\u0000\u0000\u01f3\u01f4\u0005\u000b\u0000\u0000\u01f4\u01f9"+ + "\u0003V+\u0000\u01f5\u01f6\u0005!\u0000\u0000\u01f6\u01f8\u0003V+\u0000"+ + "\u01f7\u01f5\u0001\u0000\u0000\u0000\u01f8\u01fb\u0001\u0000\u0000\u0000"+ + "\u01f9\u01f7\u0001\u0000\u0000\u0000\u01f9\u01fa\u0001\u0000\u0000\u0000"+ + "\u01faU\u0001\u0000\u0000\u0000\u01fb\u01f9\u0001\u0000\u0000\u0000\u01fc"+ + "\u01fd\u0003<\u001e\u0000\u01fd\u01fe\u0005T\u0000\u0000\u01fe\u01ff\u0003"+ + "<\u001e\u0000\u01ffW\u0001\u0000\u0000\u0000\u0200\u0201\u0005\u0001\u0000"+ + "\u0000\u0201\u0202\u0003\u0014\n\u0000\u0202\u0204\u0003j5\u0000\u0203"+ + "\u0205\u0003^/\u0000\u0204\u0203\u0001\u0000\u0000\u0000\u0204\u0205\u0001"+ + "\u0000\u0000\u0000\u0205Y\u0001\u0000\u0000\u0000\u0206\u0207\u0005\u0007"+ + "\u0000\u0000\u0207\u0208\u0003\u0014\n\u0000\u0208\u0209\u0003j5\u0000"+ + "\u0209[\u0001\u0000\u0000\u0000\u020a\u020b\u0005\n\u0000\u0000\u020b"+ + "\u020c\u0003:\u001d\u0000\u020c]\u0001\u0000\u0000\u0000\u020d\u0212\u0003"+ + "`0\u0000\u020e\u020f\u0005!\u0000\u0000\u020f\u0211\u0003`0\u0000\u0210"+ + "\u020e\u0001\u0000\u0000\u0000\u0211\u0214\u0001\u0000\u0000\u0000\u0212"+ + "\u0210\u0001\u0000\u0000\u0000\u0212\u0213\u0001\u0000\u0000\u0000\u0213"+ + "_\u0001\u0000\u0000\u0000\u0214\u0212\u0001\u0000\u0000\u0000\u0215\u0216"+ + "\u0003@ \u0000\u0216\u0217\u0005\u001f\u0000\u0000\u0217\u0218\u0003D"+ + "\"\u0000\u0218a\u0001\u0000\u0000\u0000\u0219\u021a\u0007\u0006\u0000"+ + "\u0000\u021ac\u0001\u0000\u0000\u0000\u021b\u021e\u0003f3\u0000\u021c"+ + "\u021e\u0003h4\u0000\u021d\u021b\u0001\u0000\u0000\u0000\u021d\u021c\u0001"+ + "\u0000\u0000\u0000\u021ee\u0001\u0000\u0000\u0000\u021f\u0221\u0007\u0000"+ + "\u0000\u0000\u0220\u021f\u0001\u0000\u0000\u0000\u0220\u0221\u0001\u0000"+ + "\u0000\u0000\u0221\u0222\u0001\u0000\u0000\u0000\u0222\u0223\u0005\u001b"+ + "\u0000\u0000\u0223g\u0001\u0000\u0000\u0000\u0224\u0226\u0007\u0000\u0000"+ + "\u0000\u0225\u0224\u0001\u0000\u0000\u0000\u0225\u0226\u0001\u0000\u0000"+ + "\u0000\u0226\u0227\u0001\u0000\u0000\u0000\u0227\u0228\u0005\u001a\u0000"+ + "\u0000\u0228i\u0001\u0000\u0000\u0000\u0229\u022a\u0005\u0019\u0000\u0000"+ + "\u022ak\u0001\u0000\u0000\u0000\u022b\u022c\u0007\u0007\u0000\u0000\u022c"+ + "m\u0001\u0000\u0000\u0000\u022d\u022e\u0005\u0005\u0000\u0000\u022e\u022f"+ + "\u0003p8\u0000\u022fo\u0001\u0000\u0000\u0000\u0230\u0231\u0005A\u0000"+ + "\u0000\u0231\u0232\u0003\u0002\u0001\u0000\u0232\u0233\u0005B\u0000\u0000"+ + "\u0233q\u0001\u0000\u0000\u0000\u0234\u0235\u0005\r\u0000\u0000\u0235"+ + "\u0236\u0005d\u0000\u0000\u0236s\u0001\u0000\u0000\u0000\u0237\u0238\u0005"+ + "\u0003\u0000\u0000\u0238\u023b\u0005Z\u0000\u0000\u0239\u023a\u0005X\u0000"+ + "\u0000\u023a\u023c\u0003<\u001e\u0000\u023b\u0239\u0001\u0000\u0000\u0000"+ + "\u023b\u023c\u0001\u0000\u0000\u0000\u023c\u0246\u0001\u0000\u0000\u0000"+ + "\u023d\u023e\u0005Y\u0000\u0000\u023e\u0243\u0003v;\u0000\u023f\u0240"+ + "\u0005!\u0000\u0000\u0240\u0242\u0003v;\u0000\u0241\u023f\u0001\u0000"+ + "\u0000\u0000\u0242\u0245\u0001\u0000\u0000\u0000\u0243\u0241\u0001\u0000"+ + "\u0000\u0000\u0243\u0244\u0001\u0000\u0000\u0000\u0244\u0247\u0001\u0000"+ + "\u0000\u0000\u0245\u0243\u0001\u0000\u0000\u0000\u0246\u023d\u0001\u0000"+ + "\u0000\u0000\u0246\u0247\u0001\u0000\u0000\u0000\u0247u\u0001\u0000\u0000"+ + "\u0000\u0248\u0249\u0003<\u001e\u0000\u0249\u024a\u0005\u001f\u0000\u0000"+ + "\u024a\u024c\u0001\u0000\u0000\u0000\u024b\u0248\u0001\u0000\u0000\u0000"+ + "\u024b\u024c\u0001\u0000\u0000\u0000\u024c\u024d\u0001\u0000\u0000\u0000"+ + "\u024d\u024e\u0003<\u001e\u0000\u024ew\u0001\u0000\u0000\u0000\u024f\u0250"+ + "\u0005\u0012\u0000\u0000\u0250\u0251\u0003$\u0012\u0000\u0251\u0252\u0005"+ + "X\u0000\u0000\u0252\u0253\u0003>\u001f\u0000\u0253y\u0001\u0000\u0000"+ + "\u0000\u0254\u0255\u0005\u0011\u0000\u0000\u0255\u0258\u00036\u001b\u0000"+ + "\u0256\u0257\u0005\u001c\u0000\u0000\u0257\u0259\u0003\u001e\u000f\u0000"+ + "\u0258\u0256\u0001\u0000\u0000\u0000\u0258\u0259\u0001\u0000\u0000\u0000"+ + "\u0259{\u0001\u0000\u0000\u0000;\u0087\u0090\u00a2\u00ae\u00b7\u00bf\u00c5"+ "\u00cd\u00cf\u00d4\u00db\u00e0\u00eb\u00f1\u00f9\u00fb\u0106\u010d\u0118"+ "\u011b\u0121\u012d\u0133\u013d\u0141\u0146\u0150\u0158\u0165\u0169\u016d"+ - "\u0174\u0178\u017f\u0186\u018d\u0195\u019d\u01a4\u01b5\u01c0\u01cb\u01d0"+ - "\u01d4\u01d8\u01e3\u01e8\u01ec\u01fa\u0205\u0213\u021e\u0221\u0226\u023c"+ - "\u0244\u0247\u024c\u0259"; + "\u0174\u0178\u017f\u0185\u018c\u0194\u019c\u01a3\u01b4\u01bf\u01ca\u01cf"+ + "\u01d3\u01d7\u01e2\u01e7\u01eb\u01f9\u0204\u0212\u021d\u0220\u0225\u023b"+ + "\u0243\u0246\u024b\u0258"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/enrich/EnrichPolicyResolverTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/enrich/EnrichPolicyResolverTests.java index ebad8e6e13b8c..05a7486a18068 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/enrich/EnrichPolicyResolverTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/enrich/EnrichPolicyResolverTests.java @@ -448,7 +448,7 @@ EnrichResolution resolvePolicies(Collection clusters, Collection policies) { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java index ca9950a4bfe77..84a41ef040c8e 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java @@ -1283,13 +1283,6 @@ public void allMemoryReleased() { } } - /** - * All string types (keyword, text, match_only_text, etc). - */ - protected static DataType[] strings() { - return DataType.types().stream().filter(DataType::isString).toArray(DataType[]::new); - } - /** * Validate that we know the types for all the test cases already created * @param suppliers - list of suppliers before adding in the illegal type combinations @@ -1316,10 +1309,9 @@ private static boolean isAggregation() { */ private static boolean shouldHideSignature(List argTypes, DataType returnType) { for (DataType dt : DataType.UNDER_CONSTRUCTION.keySet()) { - if (returnType == dt) { + if (returnType == dt || argTypes.contains(dt)) { return true; } - return argTypes.contains(dt); } return false; } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java index b3942a71edadb..2ba175657b6c2 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java @@ -21,7 +21,6 @@ import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.core.util.NumericUtils; -import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction; import org.elasticsearch.xpack.versionfield.Version; import org.hamcrest.Matcher; @@ -91,7 +90,7 @@ public static List stringCases( List lhsSuppliers = new ArrayList<>(); List rhsSuppliers = new ArrayList<>(); List suppliers = new ArrayList<>(); - for (DataType type : AbstractConvertFunction.STRING_TYPES) { + for (DataType type : DataType.stringTypes()) { lhsSuppliers.addAll(stringCases(type)); rhsSuppliers.addAll(stringCases(type)); casesCrossProduct( @@ -760,7 +759,7 @@ public static void forUnaryStrings( Function expectedValue, Function> expectedWarnings ) { - for (DataType type : AbstractConvertFunction.STRING_TYPES) { + for (DataType type : DataType.stringTypes()) { unary( suppliers, expectedEvaluatorToString, diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/SpatialCentroidTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/SpatialCentroidTests.java index b79252c694084..15ea029a05554 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/SpatialCentroidTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/SpatialCentroidTests.java @@ -22,13 +22,15 @@ import org.elasticsearch.xpack.esql.expression.function.FunctionName; import org.elasticsearch.xpack.esql.expression.function.MultiRowTestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; -import java.nio.ByteOrder; import java.util.List; import java.util.function.Supplier; import java.util.stream.Stream; -import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.closeTo; @FunctionName("st_centroid_agg") public class SpatialCentroidTests extends AbstractAggregationTestCase { @@ -74,16 +76,58 @@ private static TestCaseSupplier makeSupplier(TestCaseSupplier.TypedDataSupplier count++; } - var expected = new BytesRef( - WellKnownBinary.toWKB(new Point(xSum.value() / count, ySum.value() / count), ByteOrder.LITTLE_ENDIAN) - ); + var expectedX = xSum.value() / count; + var expectedY = ySum.value() / count; return new TestCaseSupplier.TestCase( List.of(fieldTypedData), "SpatialCentroid[field=Attribute[channel=0]]", fieldTypedData.type(), - equalTo(expected) + centroidMatches(expectedX, expectedY, 1e-14) ); }); } + + @SuppressWarnings("SameParameterValue") + private static Matcher centroidMatches(double x, double y, double error) { + return new TestCentroidMatcher(x, y, error); + } + + private static class TestCentroidMatcher extends BaseMatcher { + private final double x; + private final double y; + private final Matcher mx; + private final Matcher my; + + private TestCentroidMatcher(double x, double y, double error) { + this.x = x; + this.y = y; + this.mx = closeTo(x, error); + this.my = closeTo(y, error); + } + + @Override + public boolean matches(Object item) { + if (item instanceof BytesRef wkb) { + var point = (Point) WellKnownBinary.fromWKB(GeometryValidator.NOOP, false, wkb.bytes, wkb.offset, wkb.length); + return mx.matches(point.getX()) && my.matches(point.getY()); + } + return false; + } + + @Override + public void describeMismatch(Object item, Description description) { + if (item instanceof BytesRef wkb) { + var point = (Point) WellKnownBinary.fromWKB(GeometryValidator.NOOP, false, wkb.bytes, wkb.offset, wkb.length); + description.appendText("was ").appendValue(point); + } else { + description.appendText("was ").appendValue(item); + } + } + + @Override + public void describeTo(Description description) { + description.appendValue(" POINT (" + x + " " + y + ")"); + } + } } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchTests.java index d37bc89635c1d..967b4d854c325 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchTests.java @@ -20,7 +20,6 @@ import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.hamcrest.Matcher; -import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -40,8 +39,8 @@ public static Iterable parameters() { Set supported = Set.of(DataType.KEYWORD, DataType.TEXT); List> supportedPerPosition = List.of(supported, supported); List suppliers = new LinkedList<>(); - for (DataType fieldType : validStringDataTypes()) { - for (DataType queryType : validStringDataTypes()) { + for (DataType fieldType : DataType.stringTypes()) { + for (DataType queryType : DataType.stringTypes()) { suppliers.add( new TestCaseSupplier( "<" + fieldType + "-ES field, " + queryType + ">", @@ -67,10 +66,6 @@ private static String matchTypeErrorSupplier(boolean includeOrdinal, List validStringDataTypes() { - return Arrays.stream(DataType.values()).filter(DataType::isString).toList(); - } - private static TestCaseSupplier.TestCase testCase( DataType fieldType, String field, diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/QueryStringTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/QueryStringTests.java index 2dfdb05ec8ecc..b4b4ebcaacde6 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/QueryStringTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/QueryStringTests.java @@ -19,7 +19,6 @@ import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.hamcrest.Matcher; -import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.function.Supplier; @@ -36,7 +35,7 @@ public QueryStringTests(@Name("TestCase") Supplier te @ParametersFactory public static Iterable parameters() { List suppliers = new LinkedList<>(); - for (DataType strType : Arrays.stream(DataType.values()).filter(DataType::isString).toList()) { + for (DataType strType : DataType.stringTypes()) { suppliers.add( new TestCaseSupplier( "<" + strType + ">", diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDatetimeTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDatetimeTests.java index 7799c3c756f23..2852b92ba156e 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDatetimeTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDatetimeTests.java @@ -134,9 +134,9 @@ public static Iterable parameters() { "ToDatetimeFromStringEvaluator[field=" + read + "]", List.of( new TestCaseSupplier.TypedDataSupplier( - "", - // millis before "0001-01-01T00:00:00.000Z" - () -> new BytesRef(randomDateString(Long.MIN_VALUE, -62135596800001L)), + "", + // millis before "-9999-12-31T23:59:59.999Z" + () -> new BytesRef(randomDateString(Long.MIN_VALUE, -377736739200000L)), DataType.KEYWORD ) ), @@ -154,8 +154,8 @@ public static Iterable parameters() { "ToDatetimeFromStringEvaluator[field=" + read + "]", List.of( new TestCaseSupplier.TypedDataSupplier( - "", - // millis before "0001-01-01T00:00:00.000Z" + "", + // millis after "9999-12-31T23:59:59.999Z" () -> new BytesRef(randomDateString(253402300800000L, Long.MAX_VALUE)), DataType.KEYWORD ) diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToVersionTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToVersionTests.java index 46a8086f9479c..57f11331818dc 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToVersionTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToVersionTests.java @@ -49,7 +49,7 @@ public static Iterable parameters() { ); // But strings that are shaped like versions do parse to valid versions - for (DataType inputType : AbstractConvertFunction.STRING_TYPES) { + for (DataType inputType : DataType.stringTypes()) { TestCaseSupplier.unary( suppliers, read, diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPercentileTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPercentileTests.java index 29cc959e6a943..0a419d44e3448 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPercentileTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvPercentileTests.java @@ -17,6 +17,7 @@ import org.elasticsearch.xpack.esql.expression.function.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.esql.expression.function.MultivalueTestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; +import org.hamcrest.Matcher; import java.math.BigDecimal; import java.util.ArrayList; @@ -28,6 +29,7 @@ import static org.elasticsearch.xpack.esql.core.type.DataType.DOUBLE; import static org.elasticsearch.xpack.esql.core.type.DataType.INTEGER; import static org.elasticsearch.xpack.esql.core.type.DataType.LONG; +import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -375,27 +377,25 @@ private static TestCaseSupplier makeSupplier( var values = (List) fieldTypedData.data(); var percentile = ((Number) percentileTypedData.data()).doubleValue(); - var expected = calculatePercentile(values, percentile); + var expectedMatcher = makePercentileMatcher(values, percentile); return new TestCaseSupplier.TestCase( List.of(fieldTypedData, percentileTypedData), evaluatorString(fieldSupplier.type(), percentileSupplier.type()), fieldSupplier.type(), - expected instanceof Double expectedDouble - ? closeTo(expectedDouble, Math.abs(expectedDouble * 0.0000001)) - : equalTo(expected) + expectedMatcher ); } ); } - private static Number calculatePercentile(List rawValues, double percentile) { + private static Matcher makePercentileMatcher(List rawValues, double percentile) { if (rawValues.isEmpty() || percentile < 0 || percentile > 100) { - return null; + return nullValue(); } if (rawValues.size() == 1) { - return rawValues.get(0); + return equalTo(rawValues.get(0)); } int valueCount = rawValues.size(); @@ -407,49 +407,62 @@ private static Number calculatePercentile(List rawValues, double percent if (rawValues.get(0) instanceof Integer) { var values = rawValues.stream().mapToInt(Number::intValue).sorted().toArray(); + int expected; if (percentile == 0) { - return values[0]; + expected = values[0]; } else if (percentile == 100) { - return values[valueCount - 1]; + expected = values[valueCount - 1]; } else { assert lowerIndex >= 0 && upperIndex < valueCount; var difference = (long) values[upperIndex] - values[lowerIndex]; - return values[lowerIndex] + (int) (fraction * difference); + expected = values[lowerIndex] + (int) (fraction * difference); } + + return equalTo(expected); } if (rawValues.get(0) instanceof Long) { var values = rawValues.stream().mapToLong(Number::longValue).sorted().toArray(); + long expected; if (percentile == 0) { - return values[0]; + expected = values[0]; } else if (percentile == 100) { - return values[valueCount - 1]; + expected = values[valueCount - 1]; } else { assert lowerIndex >= 0 && upperIndex < valueCount; - return calculatePercentile(fraction, new BigDecimal(values[lowerIndex]), new BigDecimal(values[upperIndex])).longValue(); + expected = calculatePercentile(fraction, BigDecimal.valueOf(values[lowerIndex]), BigDecimal.valueOf(values[upperIndex])) + .longValue(); } + + // Double*bigLong may lose precision, we allow a small range + return anyOf(equalTo(Math.min(expected, expected - 1)), equalTo(expected), equalTo(Math.max(expected, expected + 1))); } if (rawValues.get(0) instanceof Double) { var values = rawValues.stream().mapToDouble(Number::doubleValue).sorted().toArray(); + double expected; if (percentile == 0) { - return values[0]; + expected = values[0]; } else if (percentile == 100) { - return values[valueCount - 1]; + expected = values[valueCount - 1]; } else { assert lowerIndex >= 0 && upperIndex < valueCount; - return calculatePercentile(fraction, new BigDecimal(values[lowerIndex]), new BigDecimal(values[upperIndex])).doubleValue(); + expected = calculatePercentile(fraction, new BigDecimal(values[lowerIndex]), new BigDecimal(values[upperIndex])) + .doubleValue(); } + + return closeTo(expected, Math.abs(expected * 0.0000001)); } throw new IllegalArgumentException("Unsupported type: " + rawValues.get(0).getClass()); } private static BigDecimal calculatePercentile(double fraction, BigDecimal lowerValue, BigDecimal upperValue) { - return lowerValue.add(new BigDecimal(fraction).multiply(upperValue.subtract(lowerValue))); + var difference = upperValue.subtract(lowerValue); + return lowerValue.add(new BigDecimal(fraction).multiply(difference)); } private static TestCaseSupplier.TypedData percentileWithType(Number value, DataType type) { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/BinarySpatialFunctionTestCase.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/BinarySpatialFunctionTestCase.java index 6794de80f7433..c93d871ca2b8c 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/BinarySpatialFunctionTestCase.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/BinarySpatialFunctionTestCase.java @@ -267,19 +267,10 @@ private static DataType pickSpatialType(DataType leftType, DataType rightType) { private static Matcher spatialEvaluatorString(DataType leftType, DataType rightType) { String crsType = isSpatialGeo(pickSpatialType(leftType, rightType)) ? "Geo" : "Cartesian"; - String paramSuffix = paramSuffix(); - String channels = channelsText("left" + paramSuffix, "right" + paramSuffix); + String channels = channelsText("left", "right"); return equalTo(getFunctionClassName() + crsType + "SourceAndSourceEvaluator[" + channels + "]"); } - private static String paramSuffix() { - try { - return getSpatialRelatesFunctionClass().getSimpleName().contains("Distance") ? "Value" : ""; - } catch (ClassNotFoundException e) { - return ""; - } - } - private static String channelsText(String... args) { return IntStream.range(0, args.length).mapToObj(i -> args[i] + "=Attribute[channel=" + i + "]").collect(Collectors.joining(", ")); } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/AbstractTrimTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/AbstractTrimTests.java index f77a892d8682e..d069f7ffe2298 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/AbstractTrimTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/AbstractTrimTests.java @@ -21,7 +21,7 @@ public abstract class AbstractTrimTests extends AbstractScalarFunctionTestCase { static Iterable parameters(String name, boolean trimLeading, boolean trimTrailing) { List suppliers = new ArrayList<>(); - for (DataType type : strings()) { + for (DataType type : DataType.stringTypes()) { suppliers.add(new TestCaseSupplier("no whitespace/" + type, List.of(type), () -> { String text = randomAlphaOfLength(8); return testCase(name, type, text, text); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java index bbe92ae4a6618..2ad953c9296b7 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java @@ -58,9 +58,7 @@ public static Iterable parameters() { if (rhs == DataType.NULL || DataType.isRepresentable(rhs) == false) { continue; } - boolean lhsIsString = lhs == DataType.KEYWORD || lhs == DataType.TEXT; - boolean rhsIsString = rhs == DataType.KEYWORD || rhs == DataType.TEXT; - if (lhsIsString && rhsIsString) { + if (DataType.isString(lhs) && DataType.isString(rhs)) { continue; } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/EndsWithTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/EndsWithTests.java index 6d086e2626cb6..1b2e9c41cb25c 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/EndsWithTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/EndsWithTests.java @@ -18,7 +18,6 @@ import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.hamcrest.Matcher; -import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.function.Supplier; @@ -33,8 +32,8 @@ public EndsWithTests(@Name("TestCase") Supplier testC @ParametersFactory public static Iterable parameters() { List suppliers = new LinkedList<>(); - for (DataType strType : Arrays.stream(DataType.values()).filter(DataType::isString).toList()) { - for (DataType suffixType : Arrays.stream(DataType.values()).filter(DataType::isString).toList()) { + for (DataType strType : DataType.stringTypes()) { + for (DataType suffixType : DataType.stringTypes()) { suppliers.add( new TestCaseSupplier( "<" + strType + ">, empty <" + suffixType + ">", diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LocateTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LocateTests.java index 207125bed2a19..a10f97c45aa04 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LocateTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LocateTests.java @@ -35,13 +35,11 @@ public LocateTests(@Name("TestCase") Supplier testCas this.testCase = testCaseSupplier.get(); } - private static final DataType[] STRING_TYPES = new DataType[] { DataType.KEYWORD, DataType.TEXT }; - @ParametersFactory public static Iterable parameters() { List suppliers = new ArrayList<>(); - for (DataType strType : STRING_TYPES) { - for (DataType substrType : STRING_TYPES) { + for (DataType strType : DataType.stringTypes()) { + for (DataType substrType : DataType.stringTypes()) { suppliers.add( supplier( "", diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RLikeTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RLikeTests.java index 5a34d850cffe3..dab2fca212ff4 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RLikeTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RLikeTests.java @@ -69,7 +69,7 @@ static Iterable parameters(Function escapeString, Supp casesForString(cases, "6 bytes, 2 code points", () -> "❗️", false, escapeString, optionalPattern); casesForString(cases, "100 random code points", () -> randomUnicodeOfCodepointLength(100), true, escapeString, optionalPattern); for (DataType type : DataType.types()) { - if (type == DataType.KEYWORD || type == DataType.TEXT || type == DataType.NULL) { + if (DataType.isString(type) || type == DataType.NULL) { continue; } if (DataType.isRepresentable(type) == false) { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithTests.java index 8bc8cf3184a75..60ed3b05ad642 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithTests.java @@ -18,7 +18,6 @@ import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.function.Supplier; @@ -32,8 +31,8 @@ public StartsWithTests(@Name("TestCase") Supplier tes @ParametersFactory public static Iterable parameters() { List suppliers = new ArrayList<>(); - for (DataType strType : Arrays.stream(DataType.values()).filter(DataType::isString).toList()) { - for (DataType prefixType : Arrays.stream(DataType.values()).filter(DataType::isString).toList()) { + for (DataType strType : DataType.stringTypes()) { + for (DataType prefixType : DataType.stringTypes()) { suppliers.add(new TestCaseSupplier(List.of(strType, prefixType), () -> { String str = randomAlphaOfLength(5); String prefix = randomAlphaOfLength(5); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/type/EsqlDataTypeConverterTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/type/EsqlDataTypeConverterTests.java index 8ad083683f696..babb9fc8c0bd1 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/type/EsqlDataTypeConverterTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/type/EsqlDataTypeConverterTests.java @@ -62,8 +62,7 @@ public void testCommonTypeNull() { } public void testCommonTypeStrings() { - List STRINGS = Arrays.stream(DataType.values()).filter(DataType::isString).toList(); - for (DataType dataType1 : STRINGS) { + for (DataType dataType1 : DataType.stringTypes()) { for (DataType dataType2 : DataType.values()) { if (dataType2 == NULL) { assertEqualsCommonType(dataType1, NULL, dataType1); diff --git a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/rest/RestFleetSearchAction.java b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/rest/RestFleetSearchAction.java index a6c369734f0e3..a79424b8b7d59 100644 --- a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/rest/RestFleetSearchAction.java +++ b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/rest/RestFleetSearchAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.fleet.rest; -import org.elasticsearch.Version; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.TransportSearchAction; import org.elasticsearch.client.internal.node.NodeClient; @@ -57,12 +56,11 @@ public List routes() { @Override protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { - SearchRequest searchRequest; - if (request.hasParam("min_compatible_shard_node")) { - searchRequest = new SearchRequest(Version.fromString(request.param("min_compatible_shard_node"))); - } else { - searchRequest = new SearchRequest(); - } + SearchRequest searchRequest = new SearchRequest(); + // access the BwC param, but just drop it + // this might be set by old clients + request.param("min_compatible_shard_node"); + String[] indices = searchRequest.indices(); if (indices.length > 1) { throw new IllegalArgumentException( diff --git a/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java b/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java index 369752ea5ed75..f07d17fee87f5 100644 --- a/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java +++ b/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java @@ -6,27 +6,20 @@ */ package org.elasticsearch.xpack.frozen.rest.action; -import org.elasticsearch.action.admin.indices.get.GetIndexRequest; -import org.elasticsearch.action.admin.indices.get.GetIndexResponse; import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.UpdateForV9; import org.elasticsearch.protocol.xpack.frozen.FreezeRequest; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.rest.RestResponse; -import org.elasticsearch.rest.action.RestBuilderListener; import org.elasticsearch.rest.action.RestToXContentListener; -import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.frozen.action.FreezeIndexAction; import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; -import static org.elasticsearch.rest.RestStatus.GONE; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; @@ -53,22 +46,6 @@ public List routes() { @Override protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) { - if (request.getRestApiVersion() == RestApiVersion.V_7 && request.path().endsWith("/_freeze")) { - // translate to a get indices request, so that we'll 404 on non-existent indices - final GetIndexRequest getIndexRequest = new GetIndexRequest(); - getIndexRequest.indices(Strings.splitStringByCommaToArray(request.param("index"))); - getIndexRequest.masterNodeTimeout(getMasterNodeTimeout(request)); - getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions())); - return channel -> client.admin().indices().getIndex(getIndexRequest, new RestBuilderListener<>(channel) { - @Override - public RestResponse buildResponse(GetIndexResponse getIndexResponse, XContentBuilder builder) throws Exception { - builder.close(); - // but if the index *does* exist, we still just respond with 410 -- there's no such thing as _freeze anymore - return new RestResponse(channel, GONE, new UnsupportedOperationException(FREEZE_REMOVED)); - } - }); - } - final var freezeRequest = new FreezeRequest( getMasterNodeTimeout(request), getAckTimeout(request), 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 983e972248945..973151e73d8dc 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 @@ -12,7 +12,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest; import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest.TermBoost; @@ -68,14 +67,7 @@ public class RestGraphAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, "/{index}/_graph/explore") - .replaces(GET, "/{index}" + URI_BASE + "/graph/_explore", RestApiVersion.V_7) - .build(), - Route.builder(POST, "/{index}/_graph/explore") - .replaces(POST, "/{index}" + URI_BASE + "/graph/_explore", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, "/{index}/_graph/explore"), new Route(POST, "/{index}/_graph/explore")); } @Override @@ -85,11 +77,6 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("type")) { - deprecationLogger.compatibleCritical("graph_with_types", TYPES_DEPRECATION_MESSAGE); - request.param("type"); - } - GraphExploreRequest graphRequest = new GraphExploreRequest(Strings.splitStringByCommaToArray(request.param("index"))); graphRequest.indicesOptions(IndicesOptions.fromRequest(request, graphRequest.indicesOptions())); graphRequest.routing(request.param("routing")); diff --git a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CreateFromDeploymentIT.java b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CreateFromDeploymentIT.java new file mode 100644 index 0000000000000..f81ebc25dc860 --- /dev/null +++ b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CreateFromDeploymentIT.java @@ -0,0 +1,161 @@ +/* + * 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.inference; + +import org.elasticsearch.client.Request; +import org.elasticsearch.client.Response; +import org.elasticsearch.client.ResponseException; +import org.elasticsearch.core.Strings; +import org.elasticsearch.inference.TaskType; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; + +public class CreateFromDeploymentIT extends InferenceBaseRestTest { + + @SuppressWarnings("unchecked") + public void testAttachToDeployment() throws IOException { + var modelId = "attach_to_deployment"; + var deploymentId = "existing_deployment"; + + CustomElandModelIT.createMlNodeTextExpansionModel(modelId, client()); + var response = startMlNodeDeploymemnt(modelId, deploymentId); + assertOkOrCreated(response); + + var inferenceId = "inference_on_existing_deployment"; + var putModel = putModel(inferenceId, endpointConfig(deploymentId), TaskType.SPARSE_EMBEDDING); + var serviceSettings = putModel.get("service_settings"); + assertThat( + putModel.toString(), + serviceSettings, + is(Map.of("num_allocations", 1, "num_threads", 1, "model_id", "attach_to_deployment", "deployment_id", "existing_deployment")) + ); + + var results = infer(inferenceId, List.of("washing machine")); + assertNotNull(results.get("sparse_embedding")); + + deleteModel(inferenceId); + // assert deployment not stopped + var stats = (List>) getTrainedModelStats(modelId).get("trained_model_stats"); + var deploymentStats = stats.get(0).get("deployment_stats"); + assertNotNull(stats.toString(), deploymentStats); + + stopMlNodeDeployment(deploymentId); + } + + public void testAttachWithModelId() throws IOException { + var modelId = "attach_with_model_id"; + var deploymentId = "existing_deployment_with_model_id"; + + CustomElandModelIT.createMlNodeTextExpansionModel(modelId, client()); + var response = startMlNodeDeploymemnt(modelId, deploymentId); + assertOkOrCreated(response); + + var inferenceId = "inference_on_existing_deployment"; + var putModel = putModel(inferenceId, endpointConfig(modelId, deploymentId), TaskType.SPARSE_EMBEDDING); + var serviceSettings = putModel.get("service_settings"); + assertThat( + putModel.toString(), + serviceSettings, + is( + Map.of( + "num_allocations", + 1, + "num_threads", + 1, + "model_id", + "attach_with_model_id", + "deployment_id", + "existing_deployment_with_model_id" + ) + ) + ); + + var results = infer(inferenceId, List.of("washing machine")); + assertNotNull(results.get("sparse_embedding")); + + stopMlNodeDeployment(deploymentId); + } + + public void testModelIdDoesNotMatch() throws IOException { + var modelId = "attach_with_model_id"; + var deploymentId = "existing_deployment_with_model_id"; + var aDifferentModelId = "not_the_same_as_the_one_used_in_the_deployment"; + + CustomElandModelIT.createMlNodeTextExpansionModel(modelId, client()); + var response = startMlNodeDeploymemnt(modelId, deploymentId); + assertOkOrCreated(response); + + var inferenceId = "inference_on_existing_deployment"; + var e = expectThrows( + ResponseException.class, + () -> putModel(inferenceId, endpointConfig(aDifferentModelId, deploymentId), TaskType.SPARSE_EMBEDDING) + ); + assertThat( + e.getMessage(), + containsString( + "Deployment [existing_deployment_with_model_id] uses model [attach_with_model_id] " + + "which does not match the model [not_the_same_as_the_one_used_in_the_deployment] in the request." + ) + ); + } + + private String endpointConfig(String deploymentId) { + return Strings.format(""" + { + "service": "elasticsearch", + "service_settings": { + "deployment_id": "%s" + } + } + """, deploymentId); + } + + private String endpointConfig(String modelId, String deploymentId) { + return Strings.format(""" + { + "service": "elasticsearch", + "service_settings": { + "model_id": "%s", + "deployment_id": "%s" + } + } + """, modelId, deploymentId); + } + + private Response startMlNodeDeploymemnt(String modelId, String deploymentId) throws IOException { + String endPoint = "/_ml/trained_models/" + + modelId + + "/deployment/_start?timeout=10s&wait_for=started" + + "&threads_per_allocation=1" + + "&number_of_allocations=1"; + + if (deploymentId != null) { + endPoint = endPoint + "&deployment_id=" + deploymentId; + } + + Request request = new Request("POST", endPoint); + return client().performRequest(request); + } + + protected void stopMlNodeDeployment(String deploymentId) throws IOException { + String endpoint = "/_ml/trained_models/" + deploymentId + "/deployment/_stop"; + Request request = new Request("POST", endpoint); + request.addParameter("force", "true"); + client().performRequest(request); + } + + protected Map getTrainedModelStats(String modelId) throws IOException { + Request request = new Request("GET", "/_ml/trained_models/" + modelId + "/_stats"); + return entityAsMap(client().performRequest(request)); + } +} diff --git a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CustomElandModelIT.java b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CustomElandModelIT.java index c05d08fa33692..e6d959bafea3f 100644 --- a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CustomElandModelIT.java +++ b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/CustomElandModelIT.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.inference; import org.elasticsearch.client.Request; +import org.elasticsearch.client.RestClient; import org.elasticsearch.core.Strings; import org.elasticsearch.inference.TaskType; @@ -65,11 +66,12 @@ public class CustomElandModelIT extends InferenceBaseRestTest { public void testSparse() throws IOException { String modelId = "custom-text-expansion-model"; - createTextExpansionModel(modelId); - putModelDefinition(modelId, BASE_64_ENCODED_MODEL, RAW_MODEL_SIZE); + createTextExpansionModel(modelId, client()); + putModelDefinition(modelId, BASE_64_ENCODED_MODEL, RAW_MODEL_SIZE, client()); putVocabulary( List.of("these", "are", "my", "words", "the", "washing", "machine", "is", "leaking", "octopus", "comforter", "smells"), - modelId + modelId, + client() ); var inferenceConfig = """ @@ -90,7 +92,7 @@ public void testSparse() throws IOException { assertNotNull(results.get("sparse_embedding")); } - protected void createTextExpansionModel(String modelId) throws IOException { + static void createTextExpansionModel(String modelId, RestClient client) throws IOException { // with_special_tokens: false for this test with limited vocab Request request = new Request("PUT", "/_ml/trained_models/" + modelId); request.setJsonEntity(""" @@ -107,10 +109,10 @@ protected void createTextExpansionModel(String modelId) throws IOException { } } }"""); - client().performRequest(request); + client.performRequest(request); } - protected void putVocabulary(List vocabulary, String modelId) throws IOException { + static void putVocabulary(List vocabulary, String modelId, RestClient client) throws IOException { List vocabularyWithPad = new ArrayList<>(); vocabularyWithPad.add("[PAD]"); vocabularyWithPad.add("[UNK]"); @@ -121,14 +123,27 @@ protected void putVocabulary(List vocabulary, String modelId) throws IOE request.setJsonEntity(Strings.format(""" { "vocabulary": [%s] } """, quotedWords)); - client().performRequest(request); + client.performRequest(request); } - protected void putModelDefinition(String modelId, String base64EncodedModel, long unencodedModelSize) throws IOException { + static void putModelDefinition(String modelId, String base64EncodedModel, long unencodedModelSize, RestClient client) + throws IOException { Request request = new Request("PUT", "_ml/trained_models/" + modelId + "/definition/0"); String body = Strings.format(""" {"total_definition_length":%s,"definition": "%s","total_parts": 1}""", unencodedModelSize, base64EncodedModel); request.setJsonEntity(body); - client().performRequest(request); + client.performRequest(request); } + + // Create the model including definition and vocab + static void createMlNodeTextExpansionModel(String modelId, RestClient client) throws IOException { + createTextExpansionModel(modelId, client); + putModelDefinition(modelId, BASE_64_ENCODED_MODEL, RAW_MODEL_SIZE, client); + putVocabulary( + List.of("these", "are", "my", "words", "the", "washing", "machine", "is", "leaking", "octopus", "comforter", "smells"), + modelId, + client + ); + } + } diff --git a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/DefaultEndPointsIT.java b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/DefaultEndPointsIT.java index 083bad2c91613..3a774a7a37d93 100644 --- a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/DefaultEndPointsIT.java +++ b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/DefaultEndPointsIT.java @@ -64,7 +64,7 @@ private static void assertDefaultElserConfig(Map modelConfig) { assertThat( modelConfig.toString(), adaptiveAllocations, - Matchers.is(Map.of("enabled", true, "min_number_of_allocations", 1, "max_number_of_allocations", 8)) + Matchers.is(Map.of("enabled", true, "min_number_of_allocations", 0, "max_number_of_allocations", 8)) ); } @@ -99,7 +99,7 @@ private static void assertDefaultE5Config(Map modelConfig) { assertThat( modelConfig.toString(), adaptiveAllocations, - Matchers.is(Map.of("enabled", true, "min_number_of_allocations", 1, "max_number_of_allocations", 8)) + Matchers.is(Map.of("enabled", true, "min_number_of_allocations", 0, "max_number_of_allocations", 8)) ); } } diff --git a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceBaseRestTest.java b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceBaseRestTest.java index 3ca6b45c2948e..74c1e2f0d3356 100644 --- a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceBaseRestTest.java +++ b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceBaseRestTest.java @@ -207,7 +207,7 @@ protected void putSemanticText(String endpointId, String searchEndpointId, Strin } protected Map putModel(String modelId, String modelConfig, TaskType taskType) throws IOException { - String endpoint = Strings.format("_inference/%s/%s", taskType, modelId); + String endpoint = Strings.format("_inference/%s/%s?error_trace", taskType, modelId); return putRequest(endpoint, modelConfig); } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportDeleteInferenceEndpointAction.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportDeleteInferenceEndpointAction.java index 829a6b6c67ff9..c1dbd8cfec9d5 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportDeleteInferenceEndpointAction.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportDeleteInferenceEndpointAction.java @@ -9,8 +9,6 @@ package org.elasticsearch.xpack.inference.action; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRunnable; @@ -47,7 +45,6 @@ public class TransportDeleteInferenceEndpointAction extends TransportMasterNodeA private final ModelRegistry modelRegistry; private final InferenceServiceRegistry serviceRegistry; - private static final Logger logger = LogManager.getLogger(TransportDeleteInferenceEndpointAction.class); private final Executor executor; @Inject @@ -118,7 +115,7 @@ private void doExecuteForked( var service = serviceRegistry.getService(unparsedModel.service()); if (service.isPresent()) { - service.get().stop(request.getInferenceEndpointId(), listener); + service.get().stop(unparsedModel, listener); } else { listener.onFailure( new ElasticsearchStatusException( diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java index 55aad5c55a2ac..5ee1e40869dbc 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java @@ -9,13 +9,13 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.action.support.ActionFilters; -import org.elasticsearch.action.support.GroupedActionListener; import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.inference.InferenceServiceRegistry; -import org.elasticsearch.inference.Model; +import org.elasticsearch.inference.ModelConfigurations; import org.elasticsearch.inference.TaskType; import org.elasticsearch.inference.UnparsedModel; import org.elasticsearch.injection.guice.Inject; @@ -29,11 +29,8 @@ import org.elasticsearch.xpack.inference.registry.ModelRegistry; import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashMap; import java.util.List; import java.util.concurrent.Executor; -import java.util.stream.Collectors; public class TransportGetInferenceModelAction extends HandledTransportAction< GetInferenceModelAction.Request, @@ -99,69 +96,38 @@ private void getSingleModel( var model = service.get() .parsePersistedConfig(unparsedModel.inferenceEntityId(), unparsedModel.taskType(), unparsedModel.settings()); - - service.get() - .updateModelsWithDynamicFields( - List.of(model), - delegate.delegateFailureAndWrap( - (l2, updatedModels) -> l2.onResponse( - new GetInferenceModelAction.Response( - updatedModels.stream().map(Model::getConfigurations).collect(Collectors.toList()) - ) - ) - ) - ); + delegate.onResponse(new GetInferenceModelAction.Response(List.of(model.getConfigurations()))); })); } private void getAllModels(ActionListener listener) { - modelRegistry.getAllModels(listener.delegateFailureAndWrap((l, models) -> executor.execute(() -> parseModels(models, listener)))); + modelRegistry.getAllModels( + listener.delegateFailureAndWrap((l, models) -> executor.execute(ActionRunnable.supply(l, () -> parseModels(models)))) + ); } private void getModelsByTaskType(TaskType taskType, ActionListener listener) { modelRegistry.getModelsByTaskType( taskType, - listener.delegateFailureAndWrap((l, models) -> executor.execute(() -> parseModels(models, listener))) + listener.delegateFailureAndWrap((l, models) -> executor.execute(ActionRunnable.supply(l, () -> parseModels(models)))) ); } - private void parseModels(List unparsedModels, ActionListener listener) { - var parsedModelsByService = new HashMap>(); - try { - for (var unparsedModel : unparsedModels) { - var service = serviceRegistry.getService(unparsedModel.service()); - if (service.isEmpty()) { - throw serviceNotFoundException(unparsedModel.service(), unparsedModel.inferenceEntityId()); - } - var list = parsedModelsByService.computeIfAbsent(service.get().name(), s -> new ArrayList<>()); - list.add( - service.get() - .parsePersistedConfig(unparsedModel.inferenceEntityId(), unparsedModel.taskType(), unparsedModel.settings()) - ); - } - - var groupedListener = new GroupedActionListener>( - parsedModelsByService.entrySet().size(), - listener.delegateFailureAndWrap((delegate, listOfListOfModels) -> { - var modifiable = new ArrayList(); - for (var l : listOfListOfModels) { - modifiable.addAll(l); - } - modifiable.sort(Comparator.comparing(Model::getInferenceEntityId)); - delegate.onResponse( - new GetInferenceModelAction.Response(modifiable.stream().map(Model::getConfigurations).collect(Collectors.toList())) - ); - }) - ); + private GetInferenceModelAction.Response parseModels(List unparsedModels) { + var parsedModels = new ArrayList(); - for (var entry : parsedModelsByService.entrySet()) { - serviceRegistry.getService(entry.getKey()) - .get() // must be non-null to get this far - .updateModelsWithDynamicFields(entry.getValue(), groupedListener); + for (var unparsedModel : unparsedModels) { + var service = serviceRegistry.getService(unparsedModel.service()); + if (service.isEmpty()) { + throw serviceNotFoundException(unparsedModel.service(), unparsedModel.inferenceEntityId()); } - } catch (Exception e) { - listener.onFailure(e); + parsedModels.add( + service.get() + .parsePersistedConfig(unparsedModel.inferenceEntityId(), unparsedModel.taskType(), unparsedModel.settings()) + .getConfigurations() + ); } + return new GetInferenceModelAction.Response(parsedModels); } private ElasticsearchStatusException serviceNotFoundException(String service, String inferenceId) { diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/EmbeddingRequestChunker.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/EmbeddingRequestChunker.java index 3ae8dc0550391..c5897f32d6eb8 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/EmbeddingRequestChunker.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/EmbeddingRequestChunker.java @@ -324,7 +324,7 @@ private ElasticsearchStatusException unexpectedResultTypeException(String got, S public void onFailure(Exception e) { var errorResult = new ErrorChunkedInferenceResults(e); for (var pos : positions) { - errors.setOnce(pos.inputIndex(), errorResult); + errors.set(pos.inputIndex(), errorResult); } if (resultCount.incrementAndGet() == totalNumberOfRequests) { diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/BaseElasticsearchInternalService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/BaseElasticsearchInternalService.java index 98777e9722242..cd0c33082cb30 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/BaseElasticsearchInternalService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/BaseElasticsearchInternalService.java @@ -22,6 +22,7 @@ import org.elasticsearch.inference.InputType; import org.elasticsearch.inference.Model; import org.elasticsearch.inference.TaskType; +import org.elasticsearch.inference.UnparsedModel; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.action.GetTrainedModelsAction; @@ -98,6 +99,12 @@ public void start(Model model, ActionListener finalListener) { return; } + if (esModel.usesExistingDeployment()) { + // don't start a deployment + finalListener.onResponse(Boolean.TRUE); + return; + } + SubscribableListener.newForked(forkedListener -> { isBuiltinModelPut(model, forkedListener); }) .andThen((l, modelConfigExists) -> { if (modelConfigExists == false) { @@ -119,14 +126,28 @@ public void start(Model model, ActionListener finalListener) { } @Override - public void stop(String inferenceEntityId, ActionListener listener) { - var request = new StopTrainedModelDeploymentAction.Request(inferenceEntityId); - request.setForce(true); - client.execute( - StopTrainedModelDeploymentAction.INSTANCE, - request, - listener.delegateFailureAndWrap((delegatedResponseListener, response) -> delegatedResponseListener.onResponse(Boolean.TRUE)) - ); + public void stop(UnparsedModel unparsedModel, ActionListener listener) { + + var model = parsePersistedConfig(unparsedModel.inferenceEntityId(), unparsedModel.taskType(), unparsedModel.settings()); + if (model instanceof ElasticsearchInternalModel esModel) { + + var serviceSettings = esModel.getServiceSettings(); + if (serviceSettings.getDeploymentId() != null) { + // configured with an existing deployment so do not stop it + listener.onResponse(Boolean.TRUE); + return; + } + + var request = new StopTrainedModelDeploymentAction.Request(esModel.mlNodeDeploymentId()); + request.setForce(true); + client.execute( + StopTrainedModelDeploymentAction.INSTANCE, + request, + listener.delegateFailureAndWrap((delegatedResponseListener, response) -> delegatedResponseListener.onResponse(Boolean.TRUE)) + ); + } else { + listener.onFailure(notElasticsearchModelException(model)); + } } protected static IllegalStateException notElasticsearchModelException(Model model) { diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticDeployedModel.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticDeployedModel.java new file mode 100644 index 0000000000000..996ef6816025d --- /dev/null +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticDeployedModel.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +package org.elasticsearch.xpack.inference.services.elasticsearch; + +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.inference.ChunkingSettings; +import org.elasticsearch.inference.Model; +import org.elasticsearch.inference.TaskType; +import org.elasticsearch.xpack.core.ml.action.CreateTrainedModelAssignmentAction; +import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction; + +public class ElasticDeployedModel extends ElasticsearchInternalModel { + public ElasticDeployedModel( + String inferenceEntityId, + TaskType taskType, + String service, + ElasticsearchInternalServiceSettings serviceSettings, + ChunkingSettings chunkingSettings + ) { + super(inferenceEntityId, taskType, service, serviceSettings, chunkingSettings); + } + + @Override + public boolean usesExistingDeployment() { + return true; + } + + @Override + public StartTrainedModelDeploymentAction.Request getStartTrainedModelDeploymentActionRequest() { + throw new IllegalStateException("cannot start model that uses an existing deployment"); + } + + @Override + public ActionListener getCreateTrainedModelAssignmentActionListener( + Model model, + ActionListener listener + ) { + throw new IllegalStateException("cannot start model that uses an existing deployment"); + } +} diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalModel.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalModel.java index f312790ded655..d38def8dca47f 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalModel.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalModel.java @@ -21,7 +21,7 @@ public abstract class ElasticsearchInternalModel extends Model { - protected ElasticsearchInternalServiceSettings internalServiceSettings; + protected final ElasticsearchInternalServiceSettings internalServiceSettings; public ElasticsearchInternalModel( String inferenceEntityId, @@ -82,22 +82,21 @@ public abstract ActionListener getC ActionListener listener ); + public boolean usesExistingDeployment() { + return internalServiceSettings.getDeploymentId() != null; + } + @Override public ElasticsearchInternalServiceSettings getServiceSettings() { return (ElasticsearchInternalServiceSettings) super.getServiceSettings(); } - public void updateNumAllocation(Integer numAllocations) { - this.internalServiceSettings = new ElasticsearchInternalServiceSettings( - numAllocations, - this.internalServiceSettings.getNumThreads(), - this.internalServiceSettings.modelId(), - this.internalServiceSettings.getAdaptiveAllocationsSettings() - ); - } - @Override public String toString() { return Strings.toString(this.getConfigurations()); } + + public String mlNodeDeploymentId() { + return internalServiceSettings.getDeploymentId() == null ? getInferenceEntityId() : internalServiceSettings.getDeploymentId(); + } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java index 396c679bf322e..389a9fa369c21 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java @@ -32,16 +32,21 @@ import org.elasticsearch.xpack.core.inference.results.InferenceTextEmbeddingFloatResults; import org.elasticsearch.xpack.core.inference.results.RankedDocsResults; import org.elasticsearch.xpack.core.inference.results.SparseEmbeddingResults; -import org.elasticsearch.xpack.core.ml.action.GetDeploymentStatsAction; import org.elasticsearch.xpack.core.ml.action.GetTrainedModelsAction; +import org.elasticsearch.xpack.core.ml.action.GetTrainedModelsStatsAction; import org.elasticsearch.xpack.core.ml.action.InferModelAction; import org.elasticsearch.xpack.core.ml.inference.assignment.AdaptiveAllocationsSettings; +import org.elasticsearch.xpack.core.ml.inference.assignment.AssignmentStats; import org.elasticsearch.xpack.core.ml.inference.results.ErrorInferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.MlTextEmbeddingResults; import org.elasticsearch.xpack.core.ml.inference.results.TextExpansionResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.EmptyConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; +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.TextExpansionConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextExpansionConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextSimilarityConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextSimilarityConfigUpdate; import org.elasticsearch.xpack.inference.chunking.ChunkingSettingsBuilder; import org.elasticsearch.xpack.inference.chunking.EmbeddingRequestChunker; @@ -51,9 +56,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.EnumSet; -import java.util.HashMap; 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.Function; @@ -137,7 +142,12 @@ public void parseRequestConfig( throwIfNotEmptyMap(config, name()); String modelId = (String) serviceSettingsMap.get(ElasticsearchInternalServiceSettings.MODEL_ID); - if (modelId == null) { + String deploymentId = (String) serviceSettingsMap.get(ElasticsearchInternalServiceSettings.DEPLOYMENT_ID); + if (deploymentId != null) { + validateAgainstDeployment(modelId, deploymentId, taskType, modelListener.delegateFailureAndWrap((l, settings) -> { + l.onResponse(new ElasticDeployedModel(inferenceEntityId, taskType, NAME, settings.build(), chunkingSettings)); + })); + } else if (modelId == null) { if (OLD_ELSER_SERVICE_NAME.equals(serviceName)) { // TODO complete deprecation of null model ID // throw new ValidationException().addValidationError("Error parsing request config, model id is missing"); @@ -220,6 +230,8 @@ private void customElandCase( + "]. You may need to load it into the cluster using eland." ); } else { + throwIfUnsupportedTaskType(modelId, taskType, response.getResources().results().get(0).getInferenceConfig()); + var model = createCustomElandModel( inferenceEntityId, taskType, @@ -540,7 +552,7 @@ public void inferTextEmbedding( ActionListener listener ) { var request = buildInferenceRequest( - model.getConfigurations().getInferenceEntityId(), + model.mlNodeDeploymentId(), TextEmbeddingConfigUpdate.EMPTY_INSTANCE, inputs, inputType, @@ -565,13 +577,7 @@ public void inferSparseEmbedding( TimeValue timeout, ActionListener listener ) { - var request = buildInferenceRequest( - model.getConfigurations().getInferenceEntityId(), - TextExpansionConfigUpdate.EMPTY_UPDATE, - inputs, - inputType, - timeout - ); + var request = buildInferenceRequest(model.mlNodeDeploymentId(), TextExpansionConfigUpdate.EMPTY_UPDATE, inputs, inputType, timeout); ActionListener mlResultsListener = listener.delegateFailureAndWrap( (l, inferenceResult) -> l.onResponse(SparseEmbeddingResults.of(inferenceResult.getInferenceResults())) @@ -593,13 +599,7 @@ public void inferRerank( Map requestTaskSettings, ActionListener listener ) { - var request = buildInferenceRequest( - model.getConfigurations().getInferenceEntityId(), - new TextSimilarityConfigUpdate(query), - inputs, - inputType, - timeout - ); + var request = buildInferenceRequest(model.mlNodeDeploymentId(), new TextSimilarityConfigUpdate(query), inputs, inputType, timeout); var modelSettings = (CustomElandRerankTaskSettings) model.getTaskSettings(); var requestSettings = CustomElandRerankTaskSettings.fromMap(requestTaskSettings); @@ -668,7 +668,7 @@ public void chunkedInfer( for (var batch : batchedRequests) { var inferenceRequest = buildInferenceRequest( - model.getConfigurations().getInferenceEntityId(), + esModel.mlNodeDeploymentId(), EmptyConfigUpdate.INSTANCE, batch.batch().inputs(), inputType, @@ -786,47 +786,11 @@ public List defaultConfigIds() { ); } + /** + * Default configurations that can be out of the box without creating an endpoint first. + * @param defaultsListener Config listener + */ @Override - public void updateModelsWithDynamicFields(List models, ActionListener> listener) { - var modelsByDeploymentIds = new HashMap(); - for (var model : models) { - if (model instanceof ElasticsearchInternalModel esModel) { - modelsByDeploymentIds.put(esModel.internalServiceSettings.deloymentId(), esModel); - } else { - listener.onFailure( - new ElasticsearchStatusException( - "Cannot update model [{}] as it is not an Elasticsearch service model", - RestStatus.INTERNAL_SERVER_ERROR, - model.getInferenceEntityId() - ) - ); - return; - } - } - - if (modelsByDeploymentIds.isEmpty()) { - listener.onResponse(models); - return; - } - - String deploymentIds = String.join(",", modelsByDeploymentIds.keySet()); - client.execute( - GetDeploymentStatsAction.INSTANCE, - new GetDeploymentStatsAction.Request(deploymentIds), - ActionListener.wrap(stats -> { - for (var deploymentStats : stats.getStats().results()) { - var model = modelsByDeploymentIds.get(deploymentStats.getDeploymentId()); - model.updateNumAllocation(deploymentStats.getNumberOfAllocations()); - } - listener.onResponse(new ArrayList<>(modelsByDeploymentIds.values())); - }, e -> { - logger.warn("Get deployment stats failed, cannot update the endpoint's number of allocations", e); - // continue with the original response - listener.onResponse(models); - }) - ); - } - public void defaultConfigs(ActionListener> defaultsListener) { preferredModelVariantFn.accept(defaultsListener.delegateFailureAndWrap((delegate, preferredModelVariant) -> { if (PreferredModelVariant.LINUX_X86_OPTIMIZED.equals(preferredModelVariant)) { @@ -854,7 +818,7 @@ private List defaultConfigs(boolean useLinuxOptimizedModel) { null, 1, useLinuxOptimizedModel ? ELSER_V2_MODEL_LINUX_X86 : ELSER_V2_MODEL, - new AdaptiveAllocationsSettings(Boolean.TRUE, 1, 8) + new AdaptiveAllocationsSettings(Boolean.TRUE, 0, 8) ), ElserMlNodeTaskSettings.DEFAULT, null // default chunking settings @@ -867,7 +831,7 @@ private List defaultConfigs(boolean useLinuxOptimizedModel) { null, 1, useLinuxOptimizedModel ? MULTILINGUAL_E5_SMALL_MODEL_ID_LINUX_X86 : MULTILINGUAL_E5_SMALL_MODEL_ID, - new AdaptiveAllocationsSettings(Boolean.TRUE, 1, 8) + new AdaptiveAllocationsSettings(Boolean.TRUE, 0, 8) ), null // default chunking settings ); @@ -895,4 +859,108 @@ static EmbeddingRequestChunker.EmbeddingType embeddingTypeFromTaskTypeAndSetting ); }; } + + private void validateAgainstDeployment( + String modelId, + String deploymentId, + TaskType taskType, + ActionListener listener + ) { + getDeployment(deploymentId, listener.delegateFailureAndWrap((l, response) -> { + if (response.isPresent()) { + if (modelId != null && modelId.equals(response.get().getModelId()) == false) { + listener.onFailure( + new ElasticsearchStatusException( + "Deployment [{}] uses model [{}] which does not match the model [{}] in the request.", + RestStatus.BAD_REQUEST, // TODO better message + deploymentId, + response.get().getModelId(), + modelId + ) + ); + return; + } + + var updatedSettings = new ElasticsearchInternalServiceSettings.Builder().setNumAllocations( + response.get().getNumberOfAllocations() + ) + .setNumThreads(response.get().getThreadsPerAllocation()) + .setAdaptiveAllocationsSettings(response.get().getAdaptiveAllocationsSettings()) + .setDeploymentId(deploymentId) + .setModelId(response.get().getModelId()); + + checkTaskTypeForMlNodeModel(response.get().getModelId(), taskType, l.delegateFailureAndWrap((l2, compatibleTaskType) -> { + l2.onResponse(updatedSettings); + })); + } + })); + } + + private void getDeployment(String deploymentId, ActionListener> listener) { + client.execute( + GetTrainedModelsStatsAction.INSTANCE, + new GetTrainedModelsStatsAction.Request(deploymentId), + listener.delegateFailureAndWrap((l, response) -> { + l.onResponse( + response.getResources() + .results() + .stream() + .filter(s -> s.getDeploymentStats() != null && s.getDeploymentStats().getDeploymentId().equals(deploymentId)) + .map(GetTrainedModelsStatsAction.Response.TrainedModelStats::getDeploymentStats) + .findFirst() + ); + }) + ); + } + + private void checkTaskTypeForMlNodeModel(String modelId, TaskType taskType, ActionListener listener) { + client.execute( + GetTrainedModelsAction.INSTANCE, + new GetTrainedModelsAction.Request(modelId), + listener.delegateFailureAndWrap((l, response) -> { + if (response.getResources().results().isEmpty()) { + l.onFailure(new IllegalStateException("this shouldn't happen")); + return; + } + + var inferenceConfig = response.getResources().results().get(0).getInferenceConfig(); + throwIfUnsupportedTaskType(modelId, taskType, inferenceConfig); + l.onResponse(Boolean.TRUE); + }) + ); + } + + static void throwIfUnsupportedTaskType(String modelId, TaskType taskType, InferenceConfig inferenceConfig) { + var deploymentTaskType = inferenceConfigToTaskType(inferenceConfig); + if (deploymentTaskType == null) { + throw new ElasticsearchStatusException( + "Deployed model [{}] has type [{}] which does not map to any supported task types", + RestStatus.BAD_REQUEST, + modelId, + inferenceConfig.getWriteableName() + ); + } + if (deploymentTaskType != taskType) { + throw new ElasticsearchStatusException( + "Deployed model [{}] with type [{}] does not match the requested task type [{}]", + RestStatus.BAD_REQUEST, + modelId, + inferenceConfig.getWriteableName(), + taskType + ); + } + + } + + static TaskType inferenceConfigToTaskType(InferenceConfig config) { + if (config instanceof TextExpansionConfig) { + return TaskType.SPARSE_EMBEDDING; + } else if (config instanceof TextEmbeddingConfig) { + return TaskType.TEXT_EMBEDDING; + } else if (config instanceof TextSimilarityConfig) { + return TaskType.RERANK; + } else { + return null; + } + } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettings.java index 68db964e86b10..fedf48fb583a3 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettings.java @@ -36,12 +36,14 @@ public class ElasticsearchInternalServiceSettings implements ServiceSettings { public static final String NUM_ALLOCATIONS = "num_allocations"; public static final String NUM_THREADS = "num_threads"; public static final String MODEL_ID = "model_id"; + public static final String DEPLOYMENT_ID = "deployment_id"; public static final String ADAPTIVE_ALLOCATIONS = "adaptive_allocations"; private final Integer numAllocations; private final int numThreads; private final String modelId; private final AdaptiveAllocationsSettings adaptiveAllocationsSettings; + private final String deploymentId; public static ElasticsearchInternalServiceSettings fromPersistedMap(Map map) { return fromRequestMap(map).build(); @@ -95,12 +97,15 @@ protected static ElasticsearchInternalServiceSettings.Builder fromMap( ); } + String deploymentId = extractOptionalString(map, DEPLOYMENT_ID, ModelConfigurations.SERVICE_SETTINGS, validationException); + // if an error occurred while parsing, we'll set these to an invalid value, so we don't accidentally get a // null pointer when doing unboxing return new ElasticsearchInternalServiceSettings.Builder().setNumAllocations(numAllocations) .setNumThreads(Objects.requireNonNullElse(numThreads, FAILED_INT_PARSE_VALUE)) .setModelId(modelId) - .setAdaptiveAllocationsSettings(adaptiveAllocationsSettings); + .setAdaptiveAllocationsSettings(adaptiveAllocationsSettings) + .setDeploymentId(deploymentId); } public ElasticsearchInternalServiceSettings( @@ -113,6 +118,21 @@ public ElasticsearchInternalServiceSettings( this.numThreads = numThreads; this.modelId = Objects.requireNonNull(modelId); this.adaptiveAllocationsSettings = adaptiveAllocationsSettings; + this.deploymentId = null; + } + + public ElasticsearchInternalServiceSettings( + Integer numAllocations, + int numThreads, + String modelId, + AdaptiveAllocationsSettings adaptiveAllocationsSettings, + String deploymentId + ) { + this.numAllocations = numAllocations; + this.numThreads = numThreads; + this.modelId = Objects.requireNonNull(modelId); + this.adaptiveAllocationsSettings = adaptiveAllocationsSettings; + this.deploymentId = deploymentId; } protected ElasticsearchInternalServiceSettings(ElasticsearchInternalServiceSettings other) { @@ -120,6 +140,7 @@ protected ElasticsearchInternalServiceSettings(ElasticsearchInternalServiceSetti this.numThreads = other.numThreads; this.modelId = other.modelId; this.adaptiveAllocationsSettings = other.adaptiveAllocationsSettings; + this.deploymentId = other.deploymentId; } /** @@ -132,6 +153,7 @@ public ElasticsearchInternalServiceSettings(ElasticsearchInternalServiceSettings this.numThreads = other.numThreads; this.modelId = other.modelId; this.adaptiveAllocationsSettings = other.adaptiveAllocationsSettings; + this.deploymentId = other.deploymentId; } public ElasticsearchInternalServiceSettings(StreamInput in) throws IOException { @@ -145,6 +167,9 @@ public ElasticsearchInternalServiceSettings(StreamInput in) throws IOException { this.adaptiveAllocationsSettings = in.getTransportVersion().onOrAfter(TransportVersions.INFERENCE_ADAPTIVE_ALLOCATIONS) ? in.readOptionalWriteable(AdaptiveAllocationsSettings::new) : null; + this.deploymentId = in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ATTACH_TO_EXISTSING_DEPLOYMENT) + ? in.readOptionalString() + : null; } @Override @@ -159,6 +184,9 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(TransportVersions.INFERENCE_ADAPTIVE_ALLOCATIONS)) { out.writeOptionalWriteable(getAdaptiveAllocationsSettings()); } + if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ATTACH_TO_EXISTSING_DEPLOYMENT)) { + out.writeOptionalString(deploymentId); + } } @Override @@ -166,10 +194,6 @@ public String modelId() { return modelId; } - public String deloymentId() { - return modelId; - } - public Integer getNumAllocations() { return numAllocations; } @@ -182,6 +206,10 @@ public AdaptiveAllocationsSettings getAdaptiveAllocationsSettings() { return adaptiveAllocationsSettings; } + public String getDeploymentId() { + return deploymentId; + } + @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); @@ -199,6 +227,9 @@ protected void addInternalSettingsToXContent(XContentBuilder builder, Params par if (adaptiveAllocationsSettings != null) { builder.field(ADAPTIVE_ALLOCATIONS, adaptiveAllocationsSettings); } + if (deploymentId != null) { + builder.field(DEPLOYMENT_ID, deploymentId); + } } @Override @@ -221,9 +252,10 @@ public static class Builder { private int numThreads; private String modelId; private AdaptiveAllocationsSettings adaptiveAllocationsSettings; + private String deploymentId; public ElasticsearchInternalServiceSettings build() { - return new ElasticsearchInternalServiceSettings(numAllocations, numThreads, modelId, adaptiveAllocationsSettings); + return new ElasticsearchInternalServiceSettings(numAllocations, numThreads, modelId, adaptiveAllocationsSettings, deploymentId); } public Builder setNumAllocations(Integer numAllocations) { @@ -241,6 +273,11 @@ public Builder setModelId(String modelId) { return this; } + public Builder setDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + public Builder setAdaptiveAllocationsSettings(AdaptiveAllocationsSettings adaptiveAllocationsSettings) { this.adaptiveAllocationsSettings = adaptiveAllocationsSettings; return this; @@ -270,11 +307,12 @@ public boolean equals(Object o) { return Objects.equals(numAllocations, that.numAllocations) && numThreads == that.numThreads && Objects.equals(modelId, that.modelId) - && Objects.equals(adaptiveAllocationsSettings, that.adaptiveAllocationsSettings); + && Objects.equals(adaptiveAllocationsSettings, that.adaptiveAllocationsSettings) + && Objects.equals(deploymentId, that.deploymentId); } @Override public int hashCode() { - return Objects.hash(numAllocations, numThreads, modelId, adaptiveAllocationsSettings); + return Objects.hash(numAllocations, numThreads, modelId, adaptiveAllocationsSettings, deploymentId); } } diff --git a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettingsTests.java b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettingsTests.java index 419db748d793d..0db0a7669c8aa 100644 --- a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettingsTests.java +++ b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceSettingsTests.java @@ -22,11 +22,18 @@ public class ElasticsearchInternalServiceSettingsTests extends AbstractWireSeria public static ElasticsearchInternalServiceSettings validInstance(String modelId) { boolean useAdaptive = randomBoolean(); + var deploymentId = randomBoolean() ? null : randomAlphaOfLength(5); if (useAdaptive) { var adaptive = new AdaptiveAllocationsSettings(true, 1, randomIntBetween(2, 8)); - return new ElasticsearchInternalServiceSettings(randomBoolean() ? 1 : null, randomIntBetween(1, 16), modelId, adaptive); + return new ElasticsearchInternalServiceSettings( + randomBoolean() ? 1 : null, + randomIntBetween(1, 16), + modelId, + adaptive, + deploymentId + ); } else { - return new ElasticsearchInternalServiceSettings(randomIntBetween(1, 10), randomIntBetween(1, 16), modelId, null); + return new ElasticsearchInternalServiceSettings(randomIntBetween(1, 10), randomIntBetween(1, 16), modelId, null, deploymentId); } } @@ -48,7 +55,8 @@ protected ElasticsearchInternalServiceSettings mutateInstance(ElasticsearchInter instance.getNumAllocations() == null ? 1 : instance.getNumAllocations() + 1, instance.getNumThreads(), instance.modelId(), - instance.getAdaptiveAllocationsSettings() + instance.getAdaptiveAllocationsSettings(), + instance.getDeploymentId() ) ); case 1 -> new ElserInternalServiceSettings( @@ -56,7 +64,8 @@ protected ElasticsearchInternalServiceSettings mutateInstance(ElasticsearchInter instance.getNumAllocations(), instance.getNumThreads() + 1, instance.modelId(), - instance.getAdaptiveAllocationsSettings() + instance.getAdaptiveAllocationsSettings(), + instance.getDeploymentId() ) ); case 2 -> new ElserInternalServiceSettings( @@ -64,7 +73,8 @@ protected ElasticsearchInternalServiceSettings mutateInstance(ElasticsearchInter instance.getNumAllocations(), instance.getNumThreads(), instance.modelId() + "-bar", - instance.getAdaptiveAllocationsSettings() + instance.getAdaptiveAllocationsSettings(), + instance.getDeploymentId() ) ); default -> throw new IllegalStateException(); diff --git a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java index 860642a23fb2c..b82b8a08f2175 100644 --- a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java +++ b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java @@ -52,7 +52,10 @@ import org.elasticsearch.xpack.core.ml.inference.results.MlTextEmbeddingResultsTests; import org.elasticsearch.xpack.core.ml.inference.results.TextExpansionResults; import org.elasticsearch.xpack.core.ml.inference.results.TextExpansionResultsTests; +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.TextExpansionConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextSimilarityConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TokenizationConfigUpdate; import org.elasticsearch.xpack.inference.InferencePlugin; import org.elasticsearch.xpack.inference.chunking.ChunkingSettingsTests; @@ -564,9 +567,9 @@ public void testParseRequestConfig_Rerank() { var client = mock(Client.class); doAnswer(invocation -> { var listener = (ActionListener) invocation.getArguments()[2]; - listener.onResponse( - new GetTrainedModelsAction.Response(new QueryPage<>(List.of(mock(TrainedModelConfig.class)), 1, mock(ParseField.class))) - ); + var modelConfig = mock(TrainedModelConfig.class); + when(modelConfig.getInferenceConfig()).thenReturn(mock(TextSimilarityConfig.class)); + listener.onResponse(new GetTrainedModelsAction.Response(new QueryPage<>(List.of(modelConfig), 1, mock(ParseField.class)))); return null; }).when(client).execute(Mockito.same(GetTrainedModelsAction.INSTANCE), any(), any()); @@ -611,9 +614,9 @@ public void testParseRequestConfig_Rerank_DefaultTaskSettings() { var client = mock(Client.class); doAnswer(invocation -> { var listener = (ActionListener) invocation.getArguments()[2]; - listener.onResponse( - new GetTrainedModelsAction.Response(new QueryPage<>(List.of(mock(TrainedModelConfig.class)), 1, mock(ParseField.class))) - ); + var modelConfig = mock(TrainedModelConfig.class); + when(modelConfig.getInferenceConfig()).thenReturn(mock(TextSimilarityConfig.class)); + listener.onResponse(new GetTrainedModelsAction.Response(new QueryPage<>(List.of(modelConfig), 1, mock(ParseField.class)))); return null; }).when(client).execute(Mockito.same(GetTrainedModelsAction.INSTANCE), any(), any()); @@ -710,9 +713,9 @@ private void testParseRequestConfig_SparseEmbedding( var client = mock(Client.class); doAnswer(invocation -> { var listener = (ActionListener) invocation.getArguments()[2]; - listener.onResponse( - new GetTrainedModelsAction.Response(new QueryPage<>(List.of(mock(TrainedModelConfig.class)), 1, mock(ParseField.class))) - ); + var modelConfig = mock(TrainedModelConfig.class); + when(modelConfig.getInferenceConfig()).thenReturn(mock(TextExpansionConfig.class)); + listener.onResponse(new GetTrainedModelsAction.Response(new QueryPage<>(List.of(modelConfig), 1, mock(ParseField.class)))); return null; }).when(client).execute(Mockito.same(GetTrainedModelsAction.INSTANCE), any(), any()); @@ -1303,14 +1306,20 @@ public void testParsePersistedConfig_Rerank() { } public void testParseRequestConfigEland_PreservesTaskType() { + var taskType = randomFrom(EnumSet.of(TaskType.RERANK, TaskType.TEXT_EMBEDDING, TaskType.SPARSE_EMBEDDING)); + var modelConfig = mock(TrainedModelConfig.class); + switch (taskType) { + case RERANK -> when(modelConfig.getInferenceConfig()).thenReturn(mock(TextSimilarityConfig.class)); + case SPARSE_EMBEDDING -> when(modelConfig.getInferenceConfig()).thenReturn(mock(TextExpansionConfig.class)); + case TEXT_EMBEDDING -> when(modelConfig.getInferenceConfig()).thenReturn(mock(TextEmbeddingConfig.class)); + } + var client = mock(Client.class); doAnswer(invocationOnMock -> { @SuppressWarnings("unchecked") ActionListener listener = (ActionListener) invocationOnMock .getArguments()[2]; - listener.onResponse( - new GetTrainedModelsAction.Response(new QueryPage<>(List.of(mock(TrainedModelConfig.class)), 1, mock(ParseField.class))) - ); + listener.onResponse(new GetTrainedModelsAction.Response(new QueryPage<>(List.of(modelConfig), 1, mock(ParseField.class)))); return Void.TYPE; }).when(client).execute(eq(GetTrainedModelsAction.INSTANCE), any(), any()); when(client.threadPool()).thenReturn(threadPool); @@ -1331,7 +1340,6 @@ public void testParseRequestConfigEland_PreservesTaskType() { ) ); - var taskType = randomFrom(EnumSet.of(TaskType.RERANK, TaskType.TEXT_EMBEDDING, TaskType.SPARSE_EMBEDDING)); CustomElandModel expectedModel = getCustomElandModel(taskType); PlainActionFuture listener = new PlainActionFuture<>(); diff --git a/x-pack/plugin/logsdb/src/yamlRestTest/resources/rest-api-spec/test/30_logsdb_default_mapping.yml b/x-pack/plugin/logsdb/src/yamlRestTest/resources/rest-api-spec/test/30_logsdb_default_mapping.yml index 52c500c102cee..3f2bca2e4bcd9 100644 --- a/x-pack/plugin/logsdb/src/yamlRestTest/resources/rest-api-spec/test/30_logsdb_default_mapping.yml +++ b/x-pack/plugin/logsdb/src/yamlRestTest/resources/rest-api-spec/test/30_logsdb_default_mapping.yml @@ -280,3 +280,784 @@ create logsdb data stream with timestamp object mapping: - match: { error.type: "illegal_argument_exception" } - match: { error.reason: "composable template [logsdb-index-template] template after composition with component templates [logsdb-mappings] is invalid" } + +--- +create logsdb data stream with custom sorting without host.name: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-http-prod ] + priority: 10000 + template: + settings: + index: + sort.field: [ agent.id ] + sort.order: [ desc ] + mode: logsdb + mappings: + properties: + agent.id: + type: keyword + host.hostname: + type: keyword + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-http-prod + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logs-http-prod + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.agent.properties.id.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.hostname.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.type: null } + +--- +create logsdb data stream with custom sorting and host object: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-nginx-prod ] + priority: 10000 + template: + settings: + index: + sort.field: [ host.hostname, host.region ] + sort.order: [ desc, desc ] + mode: logsdb + mappings: + properties: + host: + type: object + properties: + ip: + type: ip + hostname: + type: keyword + region: + type: keyword + name: + type: integer + + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-nginx-prod + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logs-nginx-prod + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.ip.type: ip } + - match: { .$backing_index.mappings.properties.host.properties.hostname.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.region.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.type: integer } # Overrides LogsDB injected + +--- +create logsdb data stream with custom sorting and dynamically mapped host.name: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-kafka-qa ] + priority: 10000 + template: + settings: + index: + sort.field: [ "agent.id", "@timestamp" ] + sort.order: [ desc, asc ] + mode: logsdb + mappings: + properties: + agent: + type: object + properties: + name: + type: keyword + id: + type: keyword + + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-kafka-qa + - is_true: acknowledged + + - do: + bulk: + index: logs-kafka-qa + refresh: true + body: + - { "create": { } } + - { "@timestamp": "2022-01-01T00:00:00", agent.name: "foo", agent.id: "foo-568", host: { id: "db8fdcf1-b1e2-444b-8c6a-0466c61dcce4" } } + - { "create": { } } + - { "@timestamp": "2022-01-01T00:01:00", agent.name: "bar", agent.id: "foo-309", host: { id: "35e1ed10-961e-46c7-83ea-4109c913a1d6" } } + + - do: + indices.get_data_stream: + name: logs-kafka-qa + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.agent.properties.name.type: keyword } + - match: { .$backing_index.mappings.properties.agent.properties.id.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name: null } + - match: { .$backing_index.mappings.properties.host.properties.id.type: text } + +--- +create logsdb data stream with custom sorting and host.name object: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-nginx-qa ] + priority: 10000 + template: + settings: + index: + sort.field: [ "host.name.value", "@timestamp" ] + sort.order: [ desc, desc ] + mode: logsdb + mappings: + properties: + host: + type: object + properties: + name: + type: object + properties: + value: + type: keyword + alias: + type: keyword + + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-nginx-qa + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logs-nginx-qa + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.name.properties.value.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.properties.alias.type: keyword } + +--- +create logsdb data stream with default sorting on malformed host.name: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-win-prod ] + priority: 10000 + template: + settings: + index: + mode: logsdb + mappings: + properties: + agent: + type: object + properties: + name: + type: keyword + id: + type: keyword + + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-win-prod + - is_true: acknowledged + + - do: + bulk: + index: logs-win-prod + refresh: true + body: + - { "create": { } } + - { "@timestamp": "2022-01-01T00:00:00", agent.name: "foo", agent.id: "foo-568", host: { name: 192.168.10.12, id: "e70e91cd-bb3f-43f0-909c-2748e7fdfd54" } } + - { "create": { } } + - { "@timestamp": "2022-01-01T00:01:00", agent.name: "bar", agent.id: "foo-309", host: { name: 192.168.15.17, id: "ad2e3edb-2c4b-4f12-83dd-255691ed614c" } } + + - do: + indices.get_data_stream: + name: logs-win-prod + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.agent.properties.name.type: keyword } + - match: { .$backing_index.mappings.properties.agent.properties.id.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.type: keyword } # LogsDB injected + - match: { .$backing_index.mappings.properties.host.properties.name.ignore_above: 1024 } # LogsDB injected + - match: { .$backing_index.mappings.properties.host.properties.id.type: text } + +--- +create logsdb data stream with custom sorting and host.name date field: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-http-prod ] + priority: 10000 + template: + settings: + index: + sort.field: [ host.name, host.hostname ] + sort.order: [ desc, desc ] + mode: logsdb + mappings: + properties: + host: + type: object + properties: + hostname: + type: keyword + name: + type: date + + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-http-prod + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logs-http-prod + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.hostname.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.type: date } + +--- +create logsdb data stream with custom sorting and missing host.name field mapping: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-http-qa ] + priority: 10000 + template: + settings: + index: + sort.field: [ host.name, host.hostname ] + sort.order: [ desc, desc ] + mode: logsdb + mappings: + properties: + host: + type: object + properties: + hostname: + type: keyword + + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-http-qa + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logs-http-qa + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.hostname.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.ignore_above: 1024 } + +--- +create logsdb data stream with custom sorting and host.name field without doc values: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-http-dev ] + priority: 10000 + template: + settings: + index: + sort.field: [ "host.name", "@timestamp" ] + sort.order: [ desc, desc ] + mode: logsdb + mappings: + properties: + host: + type: object + properties: + name: + type: keyword + doc_values: false + + data_stream: { } + - is_true: acknowledged + + - do: + catch: bad_request + indices.create_data_stream: + name: logs-http-dev + + - match: { error.type: "illegal_argument_exception" } + - match: { error.reason: "docvalues not found for index sort field:[host.name]" } + +--- +create logsdb data stream with incompatible ignore_above on host.name: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logsdb-index-template-ignore-above] has index patterns [logsdb-ignore-above] matching patterns from existing older templates [global]" + indices.put_index_template: + name: logsdb-index-template-ignore-above + body: + index_patterns: [ logsdb-ignore-above ] + priority: 10000 + template: + settings: + index: + sort.field: [ host.name ] + sort.order: [ desc ] + mode: logsdb + mappings: + properties: + host.name: + type: keyword + ignore_above: 128 + data_stream: {} + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logsdb-ignore-above + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logsdb-ignore-above + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.name.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.ignore_above: 128 } + +--- +create logsdb data stream with no sorting and host.name as text: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logsdb-index-template-non-keyword] has index patterns [logsdb-non-keyword] matching patterns from existing older templates [global]" + indices.put_index_template: + name: logsdb-index-template-non-keyword + body: + index_patterns: [ logsdb-non-keyword ] + priority: 10000 + template: + settings: + mode: logsdb + mappings: + properties: + host.name: + type: text + data_stream: {} + - is_true: acknowledged + + - do: + catch: bad_request + indices.create_data_stream: + name: logsdb-non-keyword + + - match: { error.type: "illegal_argument_exception" } + - match: { error.reason: "docvalues not found for index sort field:[host.name]" } + +--- +create logsdb data stream without index sorting and ignore_above on host.name: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logsdb-index-template-ignore-above-override] has index patterns [logsdb-ignore-above-override] matching patterns from existing older templates [global]" + indices.put_index_template: + name: logsdb-index-template-ignore-above-override + body: + index_patterns: [ logsdb-ignore-above-override ] + priority: 10000 + template: + settings: + index: + mode: logsdb + mappings: + properties: + host.name: + type: keyword + ignore_above: 128 + data_stream: {} + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logsdb-ignore-above-override + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logsdb-ignore-above-override + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.name.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.ignore_above: 128 } + +--- +create logsdb data stream with host.name as alias and sorting on it: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logsdb-index-template-alias] has index patterns [logsdb-alias] matching patterns from existing older templates [global]" + indices.put_index_template: + name: logsdb-index-template-alias + body: + index_patterns: [ logsdb-alias ] + template: + settings: + index: + sort.field: [ host.name ] + sort.order: [ desc ] + mode: logsdb + mappings: + properties: + host.name: + type: alias + path: host.hostname + host.hostname: + type: + keyword + data_stream: {} + - do: + catch: bad_request + indices.create_data_stream: + name: logsdb-alias + + - match: { error.type: "illegal_argument_exception" } + - match: { error.reason: "Cannot use alias [host.name] as an index sort field" } + +--- +create logsdb data stream with multi-fields on host.name: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logsdb-index-template-multi-fields] has index patterns [logsdb-multi-fields] matching patterns from existing older templates [global]" + indices.put_index_template: + name: logsdb-index-template-multi-fields + body: + index_patterns: [ logsdb-multi-fields ] + template: + settings: + index: + sort.field: [ host.name.keyword ] + sort.order: [ asc ] + mode: logsdb + mappings: + properties: + host.name: + type: "text" + fields: + keyword: + type: "keyword" + data_stream: {} + + - do: + indices.create_data_stream: + name: logsdb-multi-fields + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logsdb-multi-fields + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.name.fields.keyword.type: keyword } + +--- +create logsdb data stream with multi-fields on host.name and no sorting: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [ logsdb-no-sort-multi-fields-template ] has index patterns [logsdb-no-sort-multi-fields] matching patterns from existing older templates [global]" + indices.put_index_template: + name: logsdb-no-sort-multi-fields-template + body: + index_patterns: [ logsdb-no-sort-multi-fields ] + template: + settings: + mode: logsdb + mappings: + properties: + host.name: + type: text + fields: + keyword: + type: keyword + data_stream: {} + + - do: + catch: bad_request + indices.create_data_stream: + name: logsdb-no-sort-multi-fields + + - match: { error.type: "illegal_argument_exception" } + - match: { error.reason: "docvalues not found for index sort field:[host.name]" } + +--- +create logsdb data stream with custom empty sorting: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-http-empty ] + priority: 10000 + template: + settings: + index: + sort.field: [ ] + sort.order: [ ] + mode: logsdb + mappings: + properties: + hostname: + type: keyword + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-http-empty + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logs-http-empty + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } + - match: { .$backing_index.mappings.properties.host.properties.name.type: keyword } + - match: { .$backing_index.mappings.properties.host.properties.name.ignore_above: 1024 } + +--- +create logsdb data stream with custom sorting on timestamp: + - skip: + features: [ "allowed_warnings" ] + - requires: + cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ] + reason: support for normalizer on keyword fields + + - do: + allowed_warnings: + - "index template [logs-template] has index patterns [logs-*-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [logs-template] will take precedence during new index creation" + indices.put_index_template: + name: logs-template + body: + index_patterns: [ logs-http-dev ] + priority: 10000 + template: + settings: + index: + sort.field: [ "@timestamp" ] + sort.order: [ "asc" ] + mode: logsdb + mappings: + properties: + hostname: + type: keyword + data_stream: { } + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: logs-http-dev + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: logs-http-dev + + - set: { data_streams.0.indices.0.index_name: backing_index } + - do: + indices.get_mapping: + index: $backing_index + + - match: { .$backing_index.mappings.properties.@timestamp.type: date } diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java index bb322cf79adc0..d981a60adbdb5 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java @@ -747,7 +747,15 @@ public void testMultiIndexDelete() throws Exception { } } }""", AnomalyDetectorsIndex.jobResultsAliasedName(jobId), Job.ID, jobId)); - client().performRequest(extraIndex1); + + // Creating an index with a leading dot (".") is now deprecated. + // Ensure the ensuing warning exception doesn't cause a test case failure + try { + client().performRequest(extraIndex1); + } catch (org.elasticsearch.client.WarningFailureException e) { + logger.warn(e.getMessage()); + } + Request extraIndex2 = new Request("PUT", indexName + "-002"); extraIndex2.setJsonEntity(Strings.format(""" { @@ -762,7 +770,14 @@ public void testMultiIndexDelete() throws Exception { } } }""", AnomalyDetectorsIndex.jobResultsAliasedName(jobId), Job.ID, jobId)); - client().performRequest(extraIndex2); + + // Creating an index with a leading dot (".") is now deprecated. + // Ensure the ensuing warning exception doesn't cause a test case failure + try { + client().performRequest(extraIndex2); + } catch (org.elasticsearch.client.WarningFailureException e) { + logger.warn(e.getMessage()); + } // Use _cat/indices/.ml-anomalies-* instead of _cat/indices/_all to workaround https://github.com/elastic/elasticsearch/issues/45652 String indicesBeforeDelete = EntityUtils.toString( @@ -983,10 +998,10 @@ private Response openJob(String jobId, Optional timeout) throws IOExc } private void closeJob(String jobId) throws IOException { - Response openResponse = client().performRequest( + Response closeResponse = client().performRequest( new Request("POST", MachineLearning.BASE_PATH + "anomaly_detectors/" + jobId + "/_close") ); - assertThat(entityAsMap(openResponse), hasEntry("closed", true)); + assertThat(entityAsMap(closeResponse), hasEntry("closed", true)); } private Response putJob(String jobId, String jsonBody) throws IOException { @@ -1000,5 +1015,8 @@ public void clearMlState() throws Exception { new MlRestTestStateCleaner(logger, adminClient()).resetFeatures(); // Don't check analytics jobs as they are independent of anomaly detection jobs and should not be created by this test. waitForPendingTasks(adminClient(), taskName -> taskName.contains(MlTasks.DATA_FRAME_ANALYTICS_TASK_NAME)); + // Finally, clean up any lingering persistent tasks (such as "_close", "_close[n]" etc.) that may negatively + // impact subsequent tests. + client().performRequest(new Request("POST", "/_tasks/_cancel")); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java index 1c3a73a409dd1..9624d619ff20a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java @@ -433,7 +433,8 @@ private void processDeploymentStats(GetDeploymentStatsAction.Response statsRespo public boolean maybeStartAllocation(TrainedModelAssignment assignment) { if (assignment.getAdaptiveAllocationsSettings() != null && assignment.getAdaptiveAllocationsSettings().getEnabled() == Boolean.TRUE - && assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == 0) { + && (assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == null + || assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == 0)) { // Prevent against a flurry of scale up requests. if (deploymentIdsWithInFlightScaleFromZeroRequests.contains(assignment.getDeploymentId()) == false) { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestDeleteExpiredDataAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestDeleteExpiredDataAction.java index 37731fcbfb10b..efa34ccff70c4 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestDeleteExpiredDataAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestDeleteExpiredDataAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -20,8 +19,8 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.DELETE; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestDeleteExpiredDataAction extends BaseRestHandler { @@ -29,12 +28,8 @@ public class RestDeleteExpiredDataAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(DELETE, BASE_PATH + "_delete_expired_data/{" + Job.ID + "}") - .replaces(DELETE, PRE_V7_BASE_PATH + "_delete_expired_data/{" + Job.ID + "}", RestApiVersion.V_7) - .build(), - Route.builder(DELETE, BASE_PATH + "_delete_expired_data") - .replaces(DELETE, PRE_V7_BASE_PATH + "_delete_expired_data", RestApiVersion.V_7) - .build() + new Route(DELETE, BASE_PATH + "_delete_expired_data/{" + ID + "}"), + new Route(DELETE, BASE_PATH + "_delete_expired_data") ); } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestMlInfoAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestMlInfoAction.java index aace51a45c77b..d08f25b3433b5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestMlInfoAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestMlInfoAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -20,14 +19,13 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestMlInfoAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(GET, BASE_PATH + "info").replaces(GET, PRE_V7_BASE_PATH + "info", RestApiVersion.V_7).build()); + return List.of(new Route(GET, BASE_PATH + "info")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestSetUpgradeModeAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestSetUpgradeModeAction.java index 67970d2ad056e..1d12a8b555225 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestSetUpgradeModeAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/RestSetUpgradeModeAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -22,18 +21,13 @@ import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestSetUpgradeModeAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "set_upgrade_mode") - .replaces(POST, PRE_V7_BASE_PATH + "set_upgrade_mode", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "set_upgrade_mode")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarAction.java index 2825d1e4433af..bed1ebc370520 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -20,19 +19,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.DELETE; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestDeleteCalendarAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, BASE_PATH + "calendars/{" + Calendar.ID + "}") - .replaces(DELETE, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, BASE_PATH + "calendars/{" + ID + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarEventAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarEventAction.java index ec23eb8ea3551..f645d6cb7efbd 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarEventAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarEventAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,23 +20,16 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.DELETE; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; +import static org.elasticsearch.xpack.core.ml.calendars.ScheduledEvent.EVENT_ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestDeleteCalendarEventAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, BASE_PATH + "calendars/{" + Calendar.ID + "}/events/{" + ScheduledEvent.EVENT_ID + "}") - .replaces( - DELETE, - PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}/events/{" + ScheduledEvent.EVENT_ID + "}", - RestApiVersion.V_7 - ) - .build() - ); + return List.of(new Route(DELETE, BASE_PATH + "calendars/{" + ID + "}/events/{" + EVENT_ID + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarJobAction.java index 342a9008a69b8..782fdc9073ab4 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestDeleteCalendarJobAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,19 +20,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.DELETE; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestDeleteCalendarJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, BASE_PATH + "calendars/{" + Calendar.ID + "}/jobs/{" + Job.ID + "}") - .replaces(DELETE, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}/jobs/{" + Job.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, BASE_PATH + "calendars/{" + ID + "}/jobs/{" + Job.ID + "}")); } @Override 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 be5f9cd3c1446..4bf2cfa8472fe 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,6 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,19 +22,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestGetCalendarEventsAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, BASE_PATH + "calendars/{" + Calendar.ID + "}/events") - .replaces(GET, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}/events", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, BASE_PATH + "calendars/{" + ID + "}/events")); } @Override 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 1e662e28cf564..16f2a840b4575 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,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -24,8 +23,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestGetCalendarsAction extends BaseRestHandler { @@ -33,14 +32,10 @@ public class RestGetCalendarsAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "calendars/{" + Calendar.ID + "}") - .replaces(GET, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}", RestApiVersion.V_7) - .build(), - Route.builder(GET, BASE_PATH + "calendars/").replaces(GET, PRE_V7_BASE_PATH + "calendars/", RestApiVersion.V_7).build(), - Route.builder(POST, BASE_PATH + "calendars/{" + Calendar.ID + "}") - .replaces(POST, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "calendars/").replaces(POST, PRE_V7_BASE_PATH + "calendars/", RestApiVersion.V_7).build() + new Route(GET, BASE_PATH + "calendars/{" + ID + "}"), + new Route(GET, BASE_PATH + "calendars/"), + new Route(POST, BASE_PATH + "calendars/{" + ID + "}"), + new Route(POST, BASE_PATH + "calendars/") ); } 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 9c686e441f4e3..525127cb0fde4 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,6 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,19 +20,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPostCalendarEventAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "calendars/{" + Calendar.ID + "}/events") - .replaces(POST, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}/events", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "calendars/{" + ID + "}/events")); } @Override 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 6b4b709de6ada..3457195bf1499 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,6 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -22,19 +21,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.PUT; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPutCalendarAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(PUT, BASE_PATH + "calendars/{" + Calendar.ID + "}") - .replaces(PUT, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(PUT, BASE_PATH + "calendars/{" + ID + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarJobAction.java index bdbda6d931f73..694100045aa8a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarJobAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,19 +20,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.PUT; +import static org.elasticsearch.xpack.core.ml.calendars.Calendar.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPutCalendarJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(PUT, BASE_PATH + "calendars/{" + Calendar.ID + "}/jobs/{" + Job.ID + "}") - .replaces(PUT, PRE_V7_BASE_PATH + "calendars/{" + Calendar.ID + "}/jobs/{" + Job.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(PUT, BASE_PATH + "calendars/{" + ID + "}/jobs/{" + Job.ID + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestDeleteDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestDeleteDatafeedAction.java index c195da8fbb0f4..6b4777e112254 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestDeleteDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestDeleteDatafeedAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.datafeeds; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,19 +22,15 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestDeleteDatafeedAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}") - .replaces(DELETE, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, BASE_PATH + "datafeeds/{" + ID + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedStatsAction.java index e676f7d0a07db..eb930edffe055 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedStatsAction.java @@ -24,8 +24,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.xpack.core.ml.MachineLearningField.DEPRECATED_ALLOW_NO_DATAFEEDS_PARAM; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; import static org.elasticsearch.xpack.ml.rest.RestCompatibilityChecker.checkAndSetDeprecatedParam; @ServerlessScope(Scope.PUBLIC) @@ -33,14 +33,7 @@ public class RestGetDatafeedStatsAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_stats") - .replaces(GET, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_stats", RestApiVersion.V_7) - .build(), - Route.builder(GET, BASE_PATH + "datafeeds/_stats") - .replaces(GET, PRE_V7_BASE_PATH + "datafeeds/_stats", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, BASE_PATH + "datafeeds/{" + ID + "}/_stats"), new Route(GET, BASE_PATH + "datafeeds/_stats")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedsAction.java index 53f0a371fb9d4..6b3a857cdbb9b 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestGetDatafeedsAction.java @@ -26,9 +26,9 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.xpack.core.ml.MachineLearningField.DEPRECATED_ALLOW_NO_DATAFEEDS_PARAM; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.core.ml.utils.ToXContentParams.EXCLUDE_GENERATED; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; import static org.elasticsearch.xpack.ml.rest.RestCompatibilityChecker.checkAndSetDeprecatedParam; @ServerlessScope(Scope.PUBLIC) @@ -36,12 +36,7 @@ public class RestGetDatafeedsAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}") - .replaces(GET, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}", RestApiVersion.V_7) - .build(), - Route.builder(GET, BASE_PATH + "datafeeds").replaces(GET, PRE_V7_BASE_PATH + "datafeeds", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, BASE_PATH + "datafeeds/{" + ID + "}"), new Route(GET, BASE_PATH + "datafeeds")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPreviewDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPreviewDatafeedAction.java index 999449b4fa206..f6a73f0cb8c84 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPreviewDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPreviewDatafeedAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.datafeeds; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,8 +22,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPreviewDatafeedAction extends BaseRestHandler { @@ -32,18 +31,10 @@ public class RestPreviewDatafeedAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_preview") - .replaces(GET, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_preview", RestApiVersion.V_7) - .build(), - Route.builder(GET, BASE_PATH + "datafeeds/_preview") - .replaces(GET, PRE_V7_BASE_PATH + "datafeeds/_preview", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_preview") - .replaces(POST, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_preview", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "datafeeds/_preview") - .replaces(POST, PRE_V7_BASE_PATH + "datafeeds/_preview", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "datafeeds/{" + ID + "}/_preview"), + new Route(GET, BASE_PATH + "datafeeds/_preview"), + new Route(POST, BASE_PATH + "datafeeds/{" + ID + "}/_preview"), + new Route(POST, BASE_PATH + "datafeeds/_preview") ); } 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 64caa8b737e3c..360b14277a19a 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,6 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -25,19 +24,15 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPutDatafeedAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(PUT, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}") - .replaces(PUT, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(PUT, BASE_PATH + "datafeeds/{" + ID + "}")); } @Override 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 8d6e6d5336a1f..82db97dced01e 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 @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.datafeeds; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; @@ -26,8 +25,8 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestStartDatafeedAction extends BaseRestHandler { @@ -36,11 +35,7 @@ public class RestStartDatafeedAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_start") - .replaces(POST, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_start", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "datafeeds/{" + ID + "}/_start")); } @Override 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 862c0b5318f29..bdbdc18a0d9cb 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 @@ -28,8 +28,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.xpack.core.ml.MachineLearningField.DEPRECATED_ALLOW_NO_DATAFEEDS_PARAM; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; import static org.elasticsearch.xpack.ml.rest.RestCompatibilityChecker.checkAndSetDeprecatedParam; @ServerlessScope(Scope.PUBLIC) @@ -37,11 +37,7 @@ public class RestStopDatafeedAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_stop") - .replaces(POST, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_stop", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "datafeeds/{" + ID + "}/_stop")); } @Override 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 44a8415a91fde..5335de78aa18a 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,6 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -25,19 +24,15 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; +import static org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestUpdateDatafeedAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_update") - .replaces(POST, PRE_V7_BASE_PATH + "datafeeds/{" + DatafeedConfig.ID + "}/_update", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "datafeeds/{" + ID + "}/_update")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestDeleteFilterAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestDeleteFilterAction.java index 494c5638dc75a..57c99627b9330 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestDeleteFilterAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestDeleteFilterAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.filter; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -22,19 +21,15 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; +import static org.elasticsearch.xpack.core.ml.action.DeleteFilterAction.Request.FILTER_ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestDeleteFilterAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, BASE_PATH + "filters/{" + Request.FILTER_ID + "}") - .replaces(DELETE, PRE_V7_BASE_PATH + "filters/{" + Request.FILTER_ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, BASE_PATH + "filters/{" + FILTER_ID + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestGetFiltersAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestGetFiltersAction.java index b4c76c3fa4475..45a30796d56f3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestGetFiltersAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestGetFiltersAction.java @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,20 +22,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.xpack.core.ml.job.config.MlFilter.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestGetFiltersAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, BASE_PATH + "filters/{" + MlFilter.ID + "}") - .replaces(GET, PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID + "}", RestApiVersion.V_7) - .build(), - Route.builder(GET, BASE_PATH + "filters/").replaces(GET, PRE_V7_BASE_PATH + "filters/", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, BASE_PATH + "filters/{" + ID + "}"), new Route(GET, BASE_PATH + "filters/")); } @Override 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 78753a46dc492..1d62137666d93 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,6 @@ package org.elasticsearch.xpack.ml.rest.filter; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,19 +20,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.PUT; +import static org.elasticsearch.xpack.core.ml.job.config.MlFilter.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPutFilterAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(PUT, BASE_PATH + "filters/{" + MlFilter.ID + "}") - .replaces(PUT, PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(PUT, BASE_PATH + "filters/{" + ID + "}")); } @Override 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 a2cdb4a85395a..b32997d0eee45 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,6 @@ package org.elasticsearch.xpack.ml.rest.filter; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,19 +20,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.MlFilter.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestUpdateFilterAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "filters/{" + MlFilter.ID + "}/_update") - .replaces(POST, PRE_V7_BASE_PATH + "filters/{" + MlFilter.ID + "}/_update", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "filters/{" + ID + "}/_update")); } @Override 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 d328b90a8e0d3..fc2c102747992 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 @@ -20,6 +20,8 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.PUT; +import static org.elasticsearch.xpack.core.ml.action.PutTrainedModelDefinitionPartAction.Request.PART; +import static org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.MODEL_ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; @ServerlessScope(Scope.PUBLIC) @@ -27,17 +29,7 @@ public class RestPutTrainedModelDefinitionPartAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder( - PUT, - BASE_PATH - + "trained_models/{" - + TrainedModelConfig.MODEL_ID.getPreferredName() - + "}/definition/{" - + PutTrainedModelDefinitionPartAction.Request.PART - + "}" - ).build() - ); + return List.of(new Route(PUT, BASE_PATH + "trained_models/{" + MODEL_ID.getPreferredName() + "}/definition/{" + PART + "}")); } @Override 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 ee228223eb340..34f6c4b9f51bb 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 @@ -20,6 +20,7 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.PUT; +import static org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig.MODEL_ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; @ServerlessScope(Scope.PUBLIC) @@ -27,9 +28,7 @@ public class RestPutTrainedModelVocabularyAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(PUT, BASE_PATH + "trained_models/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}/vocabulary").build() - ); + return List.of(new Route(PUT, BASE_PATH + "trained_models/{" + MODEL_ID.getPreferredName() + "}/vocabulary")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestCloseJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestCloseJobAction.java index 6ee4ba8be376e..0986a6a2400db 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestCloseJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestCloseJobAction.java @@ -23,8 +23,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.xpack.core.ml.MachineLearningField.DEPRECATED_ALLOW_NO_JOBS_PARAM; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; import static org.elasticsearch.xpack.ml.rest.RestCompatibilityChecker.checkAndSetDeprecatedParam; @ServerlessScope(Scope.PUBLIC) @@ -32,11 +32,7 @@ public class RestCloseJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_close") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_close", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/_close")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java index ba3bf73a3a4d6..13cb58964733f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,8 +22,9 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE; import static org.elasticsearch.rest.RestUtils.getAckTimeout; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; +import static org.elasticsearch.xpack.core.ml.job.results.Forecast.FORECAST_ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestDeleteForecastAction extends BaseRestHandler { @@ -32,16 +32,8 @@ public class RestDeleteForecastAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(DELETE, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_forecast/") - .replaces(DELETE, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_forecast/", RestApiVersion.V_7) - .build(), - Route.builder(DELETE, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_forecast/{" + Forecast.FORECAST_ID + "}") - .replaces( - DELETE, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_forecast/{" + Forecast.FORECAST_ID + "}", - RestApiVersion.V_7 - ) - .build() + new Route(DELETE, BASE_PATH + "anomaly_detectors/{" + ID + "}/_forecast/"), + new Route(DELETE, BASE_PATH + "anomaly_detectors/{" + ID + "}/_forecast/{" + FORECAST_ID + "}") ); } 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 1db528cae4a3d..0a4e1c0ea68bb 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 @@ -8,7 +8,6 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -28,19 +27,15 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestDeleteJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}") - .replaces(DELETE, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, BASE_PATH + "anomaly_detectors/{" + ID + "}")); } @Override 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 d8784a369594c..650c5d92e7589 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,6 @@ package org.elasticsearch.xpack.ml.rest.job; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,8 +20,8 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestFlushJobAction extends BaseRestHandler { @@ -35,11 +34,7 @@ public class RestFlushJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_flush") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_flush", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/_flush")); } @Override 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 5f3388c143dd4..b45fe5aeb89a0 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,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -22,19 +21,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestForecastJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_forecast") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_forecast", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/_forecast")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobStatsAction.java index d77a913ab0491..1ecc0ff0cefa3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobStatsAction.java @@ -25,8 +25,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.xpack.core.ml.MachineLearningField.DEPRECATED_ALLOW_NO_JOBS_PARAM; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; import static org.elasticsearch.xpack.ml.rest.RestCompatibilityChecker.checkAndSetDeprecatedParam; @ServerlessScope(Scope.PUBLIC) @@ -35,12 +35,8 @@ public class RestGetJobStatsAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_stats") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_stats", RestApiVersion.V_7) - .build(), - Route.builder(GET, BASE_PATH + "anomaly_detectors/_stats") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/_stats", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/_stats"), + new Route(GET, BASE_PATH + "anomaly_detectors/_stats") ); } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobsAction.java index f3c7b8c6636ef..e6f4325024c3c 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestGetJobsAction.java @@ -27,9 +27,9 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.xpack.core.ml.MachineLearningField.DEPRECATED_ALLOW_NO_JOBS_PARAM; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.core.ml.utils.ToXContentParams.EXCLUDE_GENERATED; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; import static org.elasticsearch.xpack.ml.rest.RestCompatibilityChecker.checkAndSetDeprecatedParam; @ServerlessScope(Scope.PUBLIC) @@ -37,14 +37,7 @@ public class RestGetJobsAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}", RestApiVersion.V_7) - .build(), - Route.builder(GET, BASE_PATH + "anomaly_detectors") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}"), new Route(GET, BASE_PATH + "anomaly_detectors")); } @Override 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 dba1a7a2fb132..74dfc959acb26 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 @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.job; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; @@ -25,19 +24,15 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestOpenJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_open") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_open", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/_open")); } @Override 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 7b2097012e8c1..e1e8296a62073 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,6 @@ package org.elasticsearch.xpack.ml.rest.job; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,19 +22,15 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPostJobUpdateAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_update") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/_update", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/_update")); } @Override 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 4c754d9bcfdd9..743fe8fac4317 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,6 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -25,19 +24,15 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.PUBLIC) public class RestPutJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(PUT, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}") - .replaces(PUT, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(PUT, BASE_PATH + "anomaly_detectors/{" + ID + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestDeleteModelSnapshotAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestDeleteModelSnapshotAction.java index d3069f4f6c405..2a9d83ccfc292 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestDeleteModelSnapshotAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestDeleteModelSnapshotAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.rest.modelsnapshots; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -20,24 +19,16 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.DELETE; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotField.SNAPSHOT_ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestDeleteModelSnapshotAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}") - .replaces( - DELETE, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}", - RestApiVersion.V_7 - ) - .build() - ); + return List.of(new Route(DELETE, BASE_PATH + "anomaly_detectors/{" + ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}")); } @Override 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 7cca7d250d030..ec2d567700df8 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,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -26,8 +25,9 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction.Request.SNAPSHOT_ID; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestGetModelSnapshotsAction extends BaseRestHandler { @@ -44,26 +44,10 @@ public class RestGetModelSnapshotsAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + Request.SNAPSHOT_ID + "}") - .replaces( - GET, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + Request.SNAPSHOT_ID + "}", - RestApiVersion.V_7 - ) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + Request.SNAPSHOT_ID + "}") - .replaces( - POST, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + Request.SNAPSHOT_ID + "}", - RestApiVersion.V_7 - ) - .build(), - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}"), + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/model_snapshots"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/model_snapshots") ); } 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 20833853b3107..c4a441d637fb0 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,6 @@ package org.elasticsearch.xpack.ml.rest.modelsnapshots; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -24,8 +23,8 @@ import static org.elasticsearch.rest.RestUtils.getAckTimeout; import static org.elasticsearch.rest.RestUtils.getMasterNodeTimeout; import static org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction.Request.SNAPSHOT_ID; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestRevertModelSnapshotAction extends BaseRestHandler { @@ -34,15 +33,7 @@ public class RestRevertModelSnapshotAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}/_revert") - .replaces( - POST, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}/_revert", - RestApiVersion.V_7 - ) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}/_revert")); } @Override 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 911305aca474c..e540d7115b3cd 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,6 @@ package org.elasticsearch.xpack.ml.rest.modelsnapshots; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,24 +20,16 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshotField.SNAPSHOT_ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestUpdateModelSnapshotAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}/_update") - .replaces( - POST, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}/_update", - RestApiVersion.V_7 - ) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/model_snapshots/{" + SNAPSHOT_ID + "}/_update")); } @Override 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 babffc3fd4650..a049529c889fc 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,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -18,15 +17,15 @@ import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.ml.action.GetBucketsAction; import org.elasticsearch.xpack.core.ml.job.config.Job; -import org.elasticsearch.xpack.core.ml.job.results.Result; import java.io.IOException; import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; +import static org.elasticsearch.xpack.core.ml.job.results.Result.TIMESTAMP; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestGetBucketsAction extends BaseRestHandler { @@ -34,26 +33,10 @@ public class RestGetBucketsAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets/{" + Result.TIMESTAMP + "}") - .replaces( - GET, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets/{" + Result.TIMESTAMP + "}", - RestApiVersion.V_7 - ) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets/{" + Result.TIMESTAMP + "}") - .replaces( - POST, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets/{" + Result.TIMESTAMP + "}", - RestApiVersion.V_7 - ) - .build(), - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/buckets", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/buckets/{" + TIMESTAMP + "}"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/buckets/{" + TIMESTAMP + "}"), + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/buckets"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/buckets") ); } 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 22abcabf5f34f..5eb7f38cd1d1b 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,6 @@ package org.elasticsearch.xpack.ml.rest.results; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -26,8 +25,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.xpack.core.ml.action.GetCategoriesAction.Request.CATEGORY_ID; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestGetCategoriesAction extends BaseRestHandler { @@ -35,26 +34,10 @@ public class RestGetCategoriesAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories/{" + CATEGORY_ID + "}") - .replaces( - GET, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories/{" + CATEGORY_ID + "}", - RestApiVersion.V_7 - ) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories/{" + CATEGORY_ID + "}") - .replaces( - POST, - PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories/{" + CATEGORY_ID + "}", - RestApiVersion.V_7 - ) - .build(), - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/categories", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/categories/{" + CATEGORY_ID + "}"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/categories/{" + CATEGORY_ID + "}"), + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/categories"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/categories") ); } 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 02b57e9c75654..54947d72a96d8 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,6 @@ package org.elasticsearch.xpack.ml.rest.results; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,8 +22,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestGetInfluencersAction extends BaseRestHandler { @@ -32,12 +31,8 @@ public class RestGetInfluencersAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/influencers") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/influencers", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/influencers") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/influencers", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/influencers"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/influencers") ); } 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 c93d7dd57a28d..e73e5b32d3a1c 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 @@ -24,8 +24,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.xpack.core.ml.MachineLearningField.DEPRECATED_ALLOW_NO_JOBS_PARAM; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; import static org.elasticsearch.xpack.ml.rest.RestCompatibilityChecker.checkAndSetDeprecatedParam; @ServerlessScope(Scope.PUBLIC) @@ -34,12 +34,8 @@ public class RestGetOverallBucketsAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/overall_buckets") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/overall_buckets", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/overall_buckets") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/overall_buckets", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/overall_buckets"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/overall_buckets") ); } 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 3b756ddbec17c..84cf13e7032c8 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,6 @@ package org.elasticsearch.xpack.ml.rest.results; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -23,8 +22,8 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.job.config.Job.ID; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestGetRecordsAction extends BaseRestHandler { @@ -32,12 +31,8 @@ public class RestGetRecordsAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(GET, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/records") - .replaces(GET, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/records", RestApiVersion.V_7) - .build(), - Route.builder(POST, BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/records") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/{" + Job.ID + "}/results/records", RestApiVersion.V_7) - .build() + new Route(GET, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/records"), + new Route(POST, BASE_PATH + "anomaly_detectors/{" + ID + "}/results/records") ); } 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 865d630c47816..f1ecf0382cc97 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,6 @@ package org.elasticsearch.xpack.ml.rest.validate; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,18 +20,13 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestValidateDetectorAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/_validate/detector") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/_validate/detector", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/_validate/detector")); } @Override 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 00e776956c7dd..61945ce30faee 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,6 @@ package org.elasticsearch.xpack.ml.rest.validate; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -21,18 +20,13 @@ import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.xpack.ml.MachineLearning.BASE_PATH; -import static org.elasticsearch.xpack.ml.MachineLearning.PRE_V7_BASE_PATH; @ServerlessScope(Scope.INTERNAL) public class RestValidateJobConfigAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, BASE_PATH + "anomaly_detectors/_validate") - .replaces(POST, PRE_V7_BASE_PATH + "anomaly_detectors/_validate", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, BASE_PATH + "anomaly_detectors/_validate")); } @Override 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 300ac5a650a8d..b69b958a27ce6 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,6 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; @@ -53,10 +52,7 @@ public class RestMonitoringBulkAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, "/_monitoring/bulk").replaces(POST, "/_xpack/monitoring/_bulk", RestApiVersion.V_7).build(), - Route.builder(PUT, "/_monitoring/bulk").replaces(PUT, "/_xpack/monitoring/_bulk", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_monitoring/bulk"), new Route(PUT, "/_monitoring/bulk")); } @Override diff --git a/x-pack/plugin/otel-data/src/main/resources/component-templates/metrics-otel@mappings.yaml b/x-pack/plugin/otel-data/src/main/resources/component-templates/metrics-otel@mappings.yaml index 37dd93b7f16d9..d2df9b5629704 100644 --- a/x-pack/plugin/otel-data/src/main/resources/component-templates/metrics-otel@mappings.yaml +++ b/x-pack/plugin/otel-data/src/main/resources/component-templates/metrics-otel@mappings.yaml @@ -3,6 +3,8 @@ _meta: description: Default mappings for the OpenTelemetry metrics index template installed by x-pack managed: true template: + settings: + index.mapping.ignore_malformed: true mappings: properties: start_timestamp: @@ -19,27 +21,22 @@ template: - histogram: mapping: type: histogram - ignore_malformed: true - counter_long: mapping: type: long time_series_metric: counter - ignore_malformed: true - gauge_long: mapping: type: long time_series_metric: gauge - ignore_malformed: true - counter_double: mapping: type: double time_series_metric: counter - ignore_malformed: true - gauge_double: mapping: type: double time_series_metric: gauge - ignore_malformed: true - summary: mapping: type: aggregate_metric_double diff --git a/x-pack/plugin/otel-data/src/main/resources/index-templates/metrics-otel@template.yaml b/x-pack/plugin/otel-data/src/main/resources/index-templates/metrics-otel@template.yaml index 3b4c3127bb71c..f8489605ad1bf 100644 --- a/x-pack/plugin/otel-data/src/main/resources/index-templates/metrics-otel@template.yaml +++ b/x-pack/plugin/otel-data/src/main/resources/index-templates/metrics-otel@template.yaml @@ -27,14 +27,3 @@ template: data_stream.type: type: constant_keyword value: metrics - dynamic_templates: - - ecs_ip: - mapping: - type: ip - path_match: [ "ip", "*.ip", "*_ip" ] - match_mapping_type: string - - all_strings_to_keywords: - mapping: - ignore_above: 1024 - type: keyword - match_mapping_type: string diff --git a/x-pack/plugin/otel-data/src/main/resources/resources.yaml b/x-pack/plugin/otel-data/src/main/resources/resources.yaml index 52873287696ab..b2d30c7f85cc4 100644 --- a/x-pack/plugin/otel-data/src/main/resources/resources.yaml +++ b/x-pack/plugin/otel-data/src/main/resources/resources.yaml @@ -1,7 +1,7 @@ # "version" holds the version of the templates and ingest pipelines installed # by xpack-plugin otel-data. This must be increased whenever an existing template is # changed, in order for it to be updated on Elasticsearch upgrade. -version: 5 +version: 6 component-templates: - otel@mappings diff --git a/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_logs_tests.yml b/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_logs_tests.yml index be4de6dca6c76..6bc0cee78be4f 100644 --- a/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_logs_tests.yml +++ b/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_logs_tests.yml @@ -163,3 +163,27 @@ Structured log body: fields: ["event.dataset"] - length: { hits.hits: 1 } - match: { hits.hits.0.fields.event\.dataset: ["generic.otel"] } +--- +host.name pass-through: + - do: + bulk: + index: logs-generic.otel-default + refresh: true + body: + - create: {} + - "@timestamp": 2024-07-18T14:48:33.467654000Z + resource: + attributes: + host.name: localhost + - is_false: errors + - do: + search: + index: logs-generic.otel-default + body: + query: + term: + host.name: localhost + fields: [ "*" ] + - length: { hits.hits: 1 } + - match: { hits.hits.0.fields.resource\.attributes\.host\.name: [ "localhost" ] } + - match: { hits.hits.0.fields.host\.name: [ "localhost" ] } diff --git a/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml b/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml index 81aded9cef3be..1aafe3765813b 100644 --- a/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml +++ b/x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml @@ -245,3 +245,37 @@ IP dimensions: - match: { .$idx0name.mappings.properties.metrics.properties.summary.type: 'aggregate_metric_double' } - match: { .$idx0name.mappings.properties.metrics.properties.summary_minmax.type: 'aggregate_metric_double' } - match: { .$idx0name.mappings.properties.metrics.properties.histogram.type: 'histogram' } +--- +Empty IP field: + - do: + bulk: + index: metrics-generic.otel-default + refresh: true + body: + - create: {"dynamic_templates":{"metrics.foo.bar":"counter_long"}} + - "@timestamp": 2024-07-18T14:48:33.467654000Z + resource: + attributes: + host.name: localhost + host.ip: "" + metrics: + foo.bar: 42 + - is_false: errors + + - do: + indices.get_data_stream: + name: metrics-generic.otel-default + - set: { data_streams.0.indices.0.index_name: idx0name } + + - do: + indices.get_mapping: + index: $idx0name + expand_wildcards: hidden + - match: { .$idx0name.mappings.properties.resource.properties.attributes.properties.host\.ip.type: 'ip' } + - do: + search: + index: metrics-generic.otel-default + body: + fields: ["*"] + - length: { hits.hits: 1 } + - match: { hits.hits.0._ignored: ["resource.attributes.host.ip"] } diff --git a/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java b/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java index def26a613775a..edd5e557aadf0 100644 --- a/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java +++ b/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderIT.java @@ -174,7 +174,10 @@ public void testRRFPagination() { ); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 2, 3, 6, and 7 @@ -221,7 +224,10 @@ public void testRRFWithAggs() { ); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 2, 3, 6, and 7 @@ -273,7 +279,10 @@ public void testRRFWithCollapse() { ); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 2, 3, 6, and 7 @@ -327,7 +336,10 @@ public void testRRFRetrieverWithCollapseAndAggs() { ); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 2, 3, 6, and 7 @@ -390,7 +402,10 @@ public void testMultipleRRFRetrievers() { ); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 2, 3, 6, and 7 @@ -453,7 +468,10 @@ public void testRRFExplainWithNamedRetrievers() { standard0.retrieverName("my_custom_retriever"); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 2, 3, 6, and 7 @@ -509,7 +527,10 @@ public void testRRFExplainWithAnotherNestedRRF() { standard0.retrieverName("my_custom_retriever"); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 2, 3, 6, and 7 @@ -577,7 +598,10 @@ public void testRRFInnerRetrieverSearchError() { QueryBuilders.constantScoreQuery(QueryBuilders.rangeQuery(VECTOR_FIELD).gte(10)) ); StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); source.retriever( @@ -613,7 +637,10 @@ public void extractToSearchSourceBuilder(SearchSourceBuilder searchSourceBuilder } }; StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); source.retriever( @@ -646,7 +673,10 @@ public void extractToSearchSourceBuilder(SearchSourceBuilder searchSourceBuilder } }; StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); source.retriever( diff --git a/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderNestedDocsIT.java b/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderNestedDocsIT.java index ea251917cfae2..69c61fe3bca1f 100644 --- a/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderNestedDocsIT.java +++ b/x-pack/plugin/rank-rrf/src/internalClusterTest/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilderNestedDocsIT.java @@ -142,7 +142,10 @@ public void testRRFRetrieverWithNestedQuery() { ); // this one retrieves docs 2 and 6 due to prefilter StandardRetrieverBuilder standard1 = new StandardRetrieverBuilder( - QueryBuilders.constantScoreQuery(QueryBuilders.termsQuery(ID_FIELD, "doc_2", "doc_3", "doc_6")).boost(20L) + QueryBuilders.boolQuery() + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_2")).boost(20L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_3")).boost(10L)) + .should(QueryBuilders.constantScoreQuery(QueryBuilders.idsQuery().addIds("doc_6")).boost(5L)) ); standard1.getPreFilterQueryBuilders().add(QueryBuilders.queryStringQuery("search").defaultField(TEXT_FIELD)); // this one retrieves docs 6 diff --git a/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/700_rrf_retriever_search_api_compatibility.yml b/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/700_rrf_retriever_search_api_compatibility.yml index 517c162c33e95..f3914843b80ec 100644 --- a/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/700_rrf_retriever_search_api_compatibility.yml +++ b/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/700_rrf_retriever_search_api_compatibility.yml @@ -11,6 +11,8 @@ setup: body: mappings: properties: + id: + type: integer text: type: text text_to_highlight: @@ -39,6 +41,7 @@ setup: index: test id: "1" body: + id: 1 text: "term1" vector: [1.0] @@ -47,6 +50,7 @@ setup: index: test id: "2" body: + id: 2 text: "term2" text_to_highlight: "search for the truth" keyword: "biology" @@ -57,6 +61,7 @@ setup: index: test id: "3" body: + id: 3 text: "term3" text_to_highlight: "nothing related" keyword: "technology" @@ -67,6 +72,7 @@ setup: index: test id: "4" body: + id: 4 text: "term4" vector: [4.0] - do: @@ -74,6 +80,7 @@ setup: index: test id: "5" body: + id: 5 text: "term5" text_to_highlight: "You know, for Search!" keyword: "technology" @@ -81,9 +88,10 @@ setup: vector: [5.0] - do: index: + id: 6 index: test - id: "6" body: + id: 6 text: "term6" keyword: "biology" integer: 6 @@ -93,6 +101,7 @@ setup: index: test id: "7" body: + id: 7 text: "term7" keyword: "astronomy" vector: [77.0] @@ -102,6 +111,7 @@ setup: index: test id: "8" body: + id: 8 text: "term8" keyword: "technology" nested: { views: 100} @@ -110,6 +120,7 @@ setup: index: test id: "9" body: + id: 9 text: "term9" integer: 2 keyword: "technology" @@ -439,7 +450,19 @@ setup: rank_window_size: 5 rank_constant: 10 size: 3 - collapse: { field: keyword, inner_hits: { name: sub_hits, size: 2 } } + collapse: { + field: keyword, + inner_hits: { + name: sub_hits, + size: 2, + sort: + { + id: { + order: desc + } + } + } + } - match: { hits.total : 9 } @@ -456,8 +479,8 @@ setup: - match: { hits.hits.1.inner_hits.sub_hits.hits.total : 4 } - length: { hits.hits.1.inner_hits.sub_hits.hits.hits : 2 } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "5" } - - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "3" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "9" } + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "8" } - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "6" } diff --git a/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/800_rrf_with_text_similarity_reranker_retriever.yml b/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/800_rrf_with_text_similarity_reranker_retriever.yml index 3e758ae11f7e6..105efcec8bc65 100644 --- a/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/800_rrf_with_text_similarity_reranker_retriever.yml +++ b/x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/800_rrf_with_text_similarity_reranker_retriever.yml @@ -125,6 +125,9 @@ setup: term: { topic: "science" } + }, + "sort": { + "integer": "asc" } } }, @@ -303,6 +306,9 @@ setup: term: { topic: "science" } + }, + "sort": { + "integer": "asc" } } }, 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 3662fc94e4c7c..e80c69ae84122 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,7 +8,6 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestStatus; @@ -26,7 +25,7 @@ public class RestDeleteRollupJobAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(DELETE, "/_rollup/job/{id}").replaces(DELETE, "/_xpack/rollup/job/{id}/", RestApiVersion.V_7).build()); + return List.of(new Route(DELETE, "/_rollup/job/{id}")); } @Override 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 5f3d64587d8e6..d60a5307ebe05 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,7 +8,6 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -25,7 +24,7 @@ public class RestGetRollupCapsAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(GET, "/_rollup/data/{id}").replaces(GET, "/_xpack/rollup/data/{id}/", RestApiVersion.V_7).build()); + return List.of(new Route(GET, "/_rollup/data/{id}")); } @Override 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 e8714116dad22..1dab108ad7a3c 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,7 +10,6 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -27,9 +26,7 @@ public class RestGetRollupIndexCapsAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, "/{index}/_rollup/data").replaces(GET, "/{index}/_xpack/rollup/data", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/{index}/_rollup/data")); } @Override 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 1b19a17fa2a79..3308425c08232 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,7 +8,6 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -25,7 +24,7 @@ public class RestGetRollupJobsAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(GET, "/_rollup/job/{id}").replaces(GET, "/_xpack/rollup/job/{id}/", RestApiVersion.V_7).build()); + return List.of(new Route(GET, "/_rollup/job/{id}")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java index e434da37b7585..7ca5489ff5ddc 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -23,7 +22,7 @@ public class RestPutRollupJobAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(PUT, "/_rollup/job/{id}").replaces(PUT, "/_xpack/rollup/job/{id}", RestApiVersion.V_7).build()); + return List.of(new Route(PUT, "/_rollup/job/{id}")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java index 3c84e67dcd010..b22d70cc8d789 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -23,9 +22,7 @@ public class RestStartRollupJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, "/_rollup/job/{id}/_start").replaces(POST, "/_xpack/rollup/job/{id}/_start", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_rollup/job/{id}/_start")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java index a5de3b6b22ce0..540dafb841c2d 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; @@ -24,9 +23,7 @@ public class RestStopRollupJobAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, "/_rollup/job/{id}/_stop").replaces(POST, "/_xpack/rollup/job/{id}/_stop", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_rollup/job/{id}/_stop")); } @Override diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java index c0f82adc88784..f81c53c5e7753 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java @@ -26,6 +26,7 @@ import static org.elasticsearch.integration.RoleMappingFileSettingsIT.setupClusterStateListener; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.setupClusterStateListenerForCleanup; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.writeJSONFile; +import static org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMappingXContentTranslator.NAME_FIELD; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.emptyIterable; @@ -91,6 +92,7 @@ public void testReservedStatePersistsOnRestart() throws Exception { var clusterState = clusterAdmin().state(new ClusterStateRequest(TEST_REQUEST_TIMEOUT)).actionGet().getState(); assertRoleMappingReservedMetadata(clusterState, "everyone_kibana_alone", "everyone_fleet_alone"); List roleMappings = new ArrayList<>(RoleMappingMetadata.getFromClusterState(clusterState).getRoleMappings()); + System.out.println("roleMappings: " + roleMappings); assertThat( roleMappings, containsInAnyOrder( @@ -99,7 +101,7 @@ public void testReservedStatePersistsOnRestart() throws Exception { new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("kibana_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something"), + Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something", NAME_FIELD, "everyone_kibana_alone"), true ), new ExpressionRoleMapping( @@ -107,7 +109,7 @@ public void testReservedStatePersistsOnRestart() throws Exception { new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("fleet_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else"), + Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else", NAME_FIELD, "everyone_fleet_alone"), false ) ) @@ -125,19 +127,19 @@ public void testReservedStatePersistsOnRestart() throws Exception { roleMappings, containsInAnyOrder( new ExpressionRoleMapping( - "name_not_available_after_deserialization", + "everyone_kibana_alone", new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("kibana_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something"), + Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something", NAME_FIELD, "everyone_kibana_alone"), true ), new ExpressionRoleMapping( - "name_not_available_after_deserialization", + "everyone_fleet_alone", new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("fleet_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else"), + Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else", NAME_FIELD, "everyone_fleet_alone"), false ) ) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java index 19cff3d62cefc..97f4ccfe9d1bb 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java @@ -14,7 +14,7 @@ import org.elasticsearch.xcontent.XContentParserConfiguration; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequestBuilder; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMapping; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMappingXContentTranslator; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; @@ -44,9 +44,8 @@ public String name() { @Override public TransformState transform(Object source, TransformState prevState) throws Exception { @SuppressWarnings("unchecked") - Set roleMappings = validate((List) source); - RoleMappingMetadata newRoleMappingMetadata = new RoleMappingMetadata(roleMappings, true); - // check feature: if available, check if we need to re-write to cluster state. how -> put field in metadata... + Set roleMappings = validate((List) source); + RoleMappingMetadata newRoleMappingMetadata = new RoleMappingMetadata(roleMappings); if (newRoleMappingMetadata.equals(RoleMappingMetadata.getFromClusterState(prevState.state()))) { return prevState; } else { @@ -73,7 +72,7 @@ public List fromXContent(XContentParser parser) throws IO return result; } - private Set validate(List roleMappings) { + private Set validate(List roleMappings) { var exceptions = new ArrayList(); for (var roleMapping : roleMappings) { // File based defined role mappings are allowed to use MetadataUtils.RESERVED_PREFIX @@ -88,7 +87,7 @@ private Set validate(List roleMa throw illegalArgumentException; } return roleMappings.stream() - .map(putRoleMappingRequest -> new ClusterStateRoleMapping(putRoleMappingRequest.getMapping())) + .map(it -> ClusterStateRoleMappingXContentTranslator.copyWithNameInMetadata(it.getMapping())) .collect(Collectors.toUnmodifiableSet()); } } 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 680f6b0f14f5e..ec287b01d0df2 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -41,9 +40,7 @@ public RestAuthenticateAction(Settings settings, SecurityContext securityContext @Override public List routes() { - return List.of( - Route.builder(GET, "/_security/_authenticate").replaces(GET, "/_xpack/security/_authenticate", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/_security/_authenticate")); } @Override 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 5615e2bc7915c..ec32b19f7e666 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,9 +8,7 @@ package org.elasticsearch.xpack.security.rest.action.apikey; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -66,7 +64,7 @@ public List routes() { @Override protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException { try (XContentParser parser = request.contentParser()) { - final InvalidateApiKeyRequest invalidateApiKeyRequest = getObjectParser(request).parse(parser, null); + final InvalidateApiKeyRequest invalidateApiKeyRequest = PARSER.parse(parser, null); return channel -> client.execute( InvalidateApiKeyAction.INSTANCE, invalidateApiKeyRequest, @@ -86,41 +84,6 @@ public String getName() { return "xpack_security_invalidate_api_key"; } - private static 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")); 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 3102ba4e4ee36..fc07fa88d6d3d 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 @@ -14,7 +14,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; @@ -85,9 +84,7 @@ public RestGetTokenAction(Settings settings, XPackLicenseState xPackLicenseState @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/oauth2/token").replaces(POST, "/_xpack/security/oauth2/token", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_security/oauth2/token")); } @Override 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 d26d9c0e63aab..1959f8914d5e6 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 @@ -9,7 +9,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequestFilter; @@ -70,9 +69,7 @@ public RestInvalidateTokenAction(Settings settings, XPackLicenseState xPackLicen @Override public List routes() { - return List.of( - Route.builder(DELETE, "/_security/oauth2/token").replaces(DELETE, "/_xpack/security/oauth2/token", RestApiVersion.V_7).build() - ); + return List.of(new Route(DELETE, "/_security/oauth2/token")); } @Override 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 6e0183c066668..967a2aec3f608 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -41,11 +40,7 @@ public RestDeletePrivilegesAction(Settings settings, XPackLicenseState licenseSt @Override public List routes() { - return List.of( - Route.builder(DELETE, "/_security/privilege/{application}/{privilege}") - .replaces(DELETE, "/_xpack/security/privilege/{application}/{privilege}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, "/_security/privilege/{application}/{privilege}")); } @Override 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 827d0db186310..f8b8db44142ba 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 @@ -10,7 +10,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -47,13 +46,9 @@ public RestGetPrivilegesAction(Settings settings, XPackLicenseState licenseState @Override public List routes() { return List.of( - Route.builder(GET, "/_security/privilege/").replaces(GET, "/_xpack/security/privilege/", RestApiVersion.V_7).build(), - Route.builder(GET, "/_security/privilege/{application}") - .replaces(GET, "/_xpack/security/privilege/{application}", RestApiVersion.V_7) - .build(), - Route.builder(GET, "/_security/privilege/{application}/{privilege}") - .replaces(GET, "/_xpack/security/privilege/{application}/{privilege}", RestApiVersion.V_7) - .build() + new Route(GET, "/_security/privilege/"), + new Route(GET, "/_security/privilege/{application}"), + new Route(GET, "/_security/privilege/{application}/{privilege}") ); } 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 53db1d135c125..78fe41e939316 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -44,10 +43,7 @@ public RestPutPrivilegesAction(Settings settings, XPackLicenseState licenseState @Override public List routes() { - return List.of( - Route.builder(PUT, "/_security/privilege/").replaces(PUT, "/_xpack/security/privilege/", RestApiVersion.V_7).build(), - Route.builder(POST, "/_security/privilege/").replaces(POST, "/_xpack/security/privilege/", RestApiVersion.V_7).build() - ); + return List.of(new Route(PUT, "/_security/privilege/"), new Route(POST, "/_security/privilege/")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestDisableProfileAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestDisableProfileAction.java index 60e2cc332d3e9..08632c9c04759 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestDisableProfileAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestDisableProfileAction.java @@ -33,10 +33,7 @@ public RestDisableProfileAction(Settings settings, XPackLicenseState licenseStat @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/profile/{uid}/_disable").build(), - Route.builder(PUT, "/_security/profile/{uid}/_disable").build() - ); + return List.of(new Route(POST, "/_security/profile/{uid}/_disable"), new Route(PUT, "/_security/profile/{uid}/_disable")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestEnableProfileAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestEnableProfileAction.java index 21cc647b3ef4b..74bc9d43002db 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestEnableProfileAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/profile/RestEnableProfileAction.java @@ -33,10 +33,7 @@ public RestEnableProfileAction(Settings settings, XPackLicenseState licenseState @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/profile/{uid}/_enable").build(), - Route.builder(PUT, "/_security/profile/{uid}/_enable").build() - ); + return List.of(new Route(POST, "/_security/profile/{uid}/_enable"), new Route(PUT, "/_security/profile/{uid}/_enable")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/realm/RestClearRealmCacheAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/realm/RestClearRealmCacheAction.java index 3b274bcea38d7..194029225da2d 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/realm/RestClearRealmCacheAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/realm/RestClearRealmCacheAction.java @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -31,11 +30,7 @@ public RestClearRealmCacheAction(Settings settings, XPackLicenseState licenseSta @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/realm/{realms}/_clear_cache") - .replaces(POST, "/_xpack/security/realm/{realms}/_clear_cache", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, "/_security/realm/{realms}/_clear_cache")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkDeleteRolesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkDeleteRolesAction.java index 683faf5cfa914..a420196b7237b 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkDeleteRolesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkDeleteRolesAction.java @@ -43,7 +43,7 @@ public RestBulkDeleteRolesAction(Settings settings, XPackLicenseState licenseSta @Override public List routes() { - return List.of(Route.builder(DELETE, "/_security/role").build()); + return List.of(new Route(DELETE, "/_security/role")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkPutRolesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkPutRolesAction.java index f132da09c4ec0..550e94b477034 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkPutRolesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestBulkPutRolesAction.java @@ -34,7 +34,7 @@ public RestBulkPutRolesAction(Settings settings, XPackLicenseState licenseState, @Override public List routes() { - return List.of(Route.builder(POST, "/_security/role").build()); + return List.of(new Route(POST, "/_security/role")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestClearRolesCacheAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestClearRolesCacheAction.java index e562d187764e6..546da4a1f31b1 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestClearRolesCacheAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestClearRolesCacheAction.java @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; @@ -31,11 +30,7 @@ public RestClearRolesCacheAction(Settings settings, XPackLicenseState licenseSta @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/role/{name}/_clear_cache") - .replaces(POST, "/_xpack/security/role/{name}/_clear_cache", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, "/_security/role/{name}/_clear_cache")); } @Override 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 0c3f0364e60d4..b74ef7eaa3190 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -37,9 +36,7 @@ public RestDeleteRoleAction(Settings settings, XPackLicenseState licenseState) { @Override public List routes() { - return List.of( - Route.builder(DELETE, "/_security/role/{name}").replaces(DELETE, "/_xpack/security/role/{name}", RestApiVersion.V_7).build() - ); + return List.of(new Route(DELETE, "/_security/role/{name}")); } @Override 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 dc9ecbbc63a8d..82fe3dc5e12c2 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 @@ -9,7 +9,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -39,10 +38,7 @@ public RestGetRolesAction(Settings settings, XPackLicenseState licenseState) { @Override public List routes() { - return List.of( - Route.builder(GET, "/_security/role/").replaces(GET, "/_xpack/security/role/", RestApiVersion.V_7).build(), - Route.builder(GET, "/_security/role/{name}").replaces(GET, "/_xpack/security/role/{name}", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/_security/role/"), new Route(GET, "/_security/role/{name}")); } @Override 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 6a819c098e9f1..a56ab4500f849 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -42,10 +41,7 @@ public RestPutRoleAction(Settings settings, XPackLicenseState licenseState, PutR @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/role/{name}").replaces(POST, "/_xpack/security/role/{name}", RestApiVersion.V_7).build(), - Route.builder(PUT, "/_security/role/{name}").replaces(PUT, "/_xpack/security/role/{name}", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_security/role/{name}"), new Route(PUT, "/_security/role/{name}")); } @Override 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 5964228009c4b..eb4dca0546254 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -37,11 +36,7 @@ public RestDeleteRoleMappingAction(Settings settings, XPackLicenseState licenseS @Override public List routes() { - return List.of( - Route.builder(DELETE, "/_security/role_mapping/{name}") - .replaces(DELETE, "/_xpack/security/role_mapping/{name}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, "/_security/role_mapping/{name}")); } @Override 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 7a3378d843bca..21b20ffa551bd 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -38,12 +37,7 @@ public RestGetRoleMappingsAction(Settings settings, XPackLicenseState licenseSta @Override public List routes() { - return List.of( - Route.builder(GET, "/_security/role_mapping/").replaces(GET, "/_xpack/security/role_mapping/", RestApiVersion.V_7).build(), - Route.builder(GET, "/_security/role_mapping/{name}") - .replaces(GET, "/_xpack/security/role_mapping/{name}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, "/_security/role_mapping/"), new Route(GET, "/_security/role_mapping/{name}")); } @Override 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 019b1e5095627..378307022d8d8 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 @@ -42,10 +42,7 @@ public RestPutRoleMappingAction(Settings settings, XPackLicenseState licenseStat @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/role_mapping/{name}").build(), - Route.builder(PUT, "/_security/role_mapping/{name}").build() - ); + return List.of(new Route(POST, "/_security/role_mapping/{name}"), new Route(PUT, "/_security/role_mapping/{name}")); } @Override 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 09527b251b6e8..f59d6984478ee 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 @@ -11,7 +11,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequestFilter; @@ -73,11 +72,7 @@ public RestSamlAuthenticateAction(Settings settings, XPackLicenseState licenseSt @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/saml/authenticate") - .replaces(POST, "/_xpack/security/saml/authenticate", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, "/_security/saml/authenticate")); } @Override 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 f05bdb9a174dc..f326b1371209e 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -53,9 +52,7 @@ public RestSamlInvalidateSessionAction(Settings settings, XPackLicenseState lice @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/saml/invalidate").replaces(POST, "/_xpack/security/saml/invalidate", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_security/saml/invalidate")); } @Override 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 bc271e38d82b4..51e61d62af955 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -51,9 +50,7 @@ public RestSamlLogoutAction(Settings settings, XPackLicenseState licenseState) { @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/saml/logout").replaces(POST, "/_xpack/security/saml/logout", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_security/saml/logout")); } @Override 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 cf3ad0d2edd3a..0903338578bac 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -55,9 +54,7 @@ public RestSamlPrepareAuthenticationAction(Settings settings, XPackLicenseState @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/saml/prepare").replaces(POST, "/_xpack/security/saml/prepare", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_security/saml/prepare")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestGetSecuritySettingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestGetSecuritySettingsAction.java index 0b4ced0a20444..44b66a69b8f2a 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestGetSecuritySettingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestGetSecuritySettingsAction.java @@ -19,6 +19,8 @@ import java.io.IOException; import java.util.List; +import static org.elasticsearch.rest.RestRequest.Method.GET; + public class RestGetSecuritySettingsAction extends SecurityBaseRestHandler { public RestGetSecuritySettingsAction(Settings settings, XPackLicenseState licenseState) { @@ -32,7 +34,7 @@ public String getName() { @Override public List routes() { - return List.of(Route.builder(RestRequest.Method.GET, "/_security/settings").build()); + return List.of(new Route(GET, "/_security/settings")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestUpdateSecuritySettingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestUpdateSecuritySettingsAction.java index 27ed6d2475d2c..f54b524df9ea1 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestUpdateSecuritySettingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/settings/RestUpdateSecuritySettingsAction.java @@ -19,6 +19,8 @@ import java.io.IOException; import java.util.List; +import static org.elasticsearch.rest.RestRequest.Method.PUT; + public class RestUpdateSecuritySettingsAction extends SecurityBaseRestHandler { public RestUpdateSecuritySettingsAction(Settings settings, XPackLicenseState licenseState) { @@ -32,7 +34,7 @@ public String getName() { @Override public List routes() { - return List.of(Route.builder(RestRequest.Method.PUT, "/_security/settings").build()); + return List.of(new Route(PUT, "/_security/settings")); } @Override 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 68500c4d07e26..7840c34dbe393 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 @@ -10,7 +10,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequestFilter; @@ -48,14 +47,10 @@ public RestChangePasswordAction(Settings settings, SecurityContext securityConte @Override public List routes() { return List.of( - Route.builder(PUT, "/_security/user/{username}/_password") - .replaces(PUT, "/_xpack/security/user/{username}/_password", RestApiVersion.V_7) - .build(), - Route.builder(POST, "/_security/user/{username}/_password") - .replaces(POST, "/_xpack/security/user/{username}/_password", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_security/user/_password").replaces(PUT, "/_xpack/security/user/_password", RestApiVersion.V_7).build(), - Route.builder(POST, "/_security/user/_password").replaces(POST, "/_xpack/security/user/_password", RestApiVersion.V_7).build() + new Route(PUT, "/_security/user/{username}/_password"), + new Route(POST, "/_security/user/{username}/_password"), + new Route(PUT, "/_security/user/_password"), + new Route(POST, "/_security/user/_password") ); } 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 55c68b3b4b3f1..01136bdc21025 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -37,11 +36,7 @@ public RestDeleteUserAction(Settings settings, XPackLicenseState licenseState) { @Override public List routes() { - return List.of( - Route.builder(DELETE, "/_security/user/{username}") - .replaces(DELETE, "/_xpack/security/user/{username}", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(DELETE, "/_security/user/{username}")); } @Override 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 96e8ffd74a314..bbf5e0ca71842 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 @@ -9,7 +9,6 @@ import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; @@ -48,9 +47,7 @@ public RestGetUserPrivilegesAction(Settings settings, SecurityContext securityCo @Override public List routes() { - return List.of( - Route.builder(GET, "/_security/user/_privileges").replaces(GET, "/_xpack/security/user/_privileges", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/_security/user/_privileges")); } @Override 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 ebc956add641a..7a24854ef6d9c 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 @@ -9,7 +9,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -39,10 +38,7 @@ public RestGetUsersAction(Settings settings, XPackLicenseState licenseState) { @Override public List routes() { - return List.of( - Route.builder(GET, "/_security/user/").replaces(GET, "/_xpack/security/user/", RestApiVersion.V_7).build(), - Route.builder(GET, "/_security/user/{username}").replaces(GET, "/_xpack/security/user/{username}", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/_security/user/"), new Route(GET, "/_security/user/{username}")); } @Override 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 a896d4855b73d..f2233a7e19fd0 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 @@ -10,7 +10,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.Tuple; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; @@ -60,18 +59,10 @@ public RestHasPrivilegesAction( @Override public List routes() { return List.of( - Route.builder(GET, "/_security/user/{username}/_has_privileges") - .replaces(GET, "/_xpack/security/user/{username}/_has_privileges", RestApiVersion.V_7) - .build(), - Route.builder(POST, "/_security/user/{username}/_has_privileges") - .replaces(POST, "/_xpack/security/user/{username}/_has_privileges", RestApiVersion.V_7) - .build(), - Route.builder(GET, "/_security/user/_has_privileges") - .replaces(GET, "/_xpack/security/user/_has_privileges", RestApiVersion.V_7) - .build(), - Route.builder(POST, "/_security/user/_has_privileges") - .replaces(POST, "/_xpack/security/user/_has_privileges", RestApiVersion.V_7) - .build() + new Route(GET, "/_security/user/{username}/_has_privileges"), + new Route(POST, "/_security/user/{username}/_has_privileges"), + new Route(GET, "/_security/user/_has_privileges"), + new Route(POST, "/_security/user/_has_privileges") ); } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestProfileHasPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestProfileHasPrivilegesAction.java index 77c35438d0d0b..a2de75b8b4f64 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestProfileHasPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestProfileHasPrivilegesAction.java @@ -38,10 +38,7 @@ public RestProfileHasPrivilegesAction(Settings settings, XPackLicenseState licen @Override public List routes() { - return List.of( - Route.builder(GET, "/_security/profile/_has_privileges").build(), - Route.builder(POST, "/_security/profile/_has_privileges").build() - ); + return List.of(new Route(GET, "/_security/profile/_has_privileges"), new Route(POST, "/_security/profile/_has_privileges")); } @Override 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 0d20103f06b57..bbaa8ac915127 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 @@ -8,7 +8,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequestFilter; @@ -45,12 +44,7 @@ public RestPutUserAction(Settings settings, XPackLicenseState licenseState) { @Override public List routes() { - return List.of( - Route.builder(POST, "/_security/user/{username}") - .replaces(POST, "/_xpack/security/user/{username}", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_security/user/{username}").replaces(PUT, "/_xpack/security/user/{username}", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_security/user/{username}"), new Route(PUT, "/_security/user/{username}")); } @Override 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 f34450cbbe1ef..1ee42b191f31a 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 @@ -9,7 +9,6 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -40,18 +39,10 @@ public RestSetEnabledAction(Settings settings, XPackLicenseState licenseState) { @Override public List routes() { return List.of( - Route.builder(POST, "/_security/user/{username}/_enable") - .replaces(POST, "/_xpack/security/user/{username}/_enable", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_security/user/{username}/_enable") - .replaces(PUT, "/_xpack/security/user/{username}/_enable", RestApiVersion.V_7) - .build(), - Route.builder(POST, "/_security/user/{username}/_disable") - .replaces(POST, "/_xpack/security/user/{username}/_disable", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_security/user/{username}/_disable") - .replaces(PUT, "/_xpack/security/user/{username}/_disable", RestApiVersion.V_7) - .build() + new Route(POST, "/_security/user/{username}/_enable"), + new Route(PUT, "/_security/user/{username}/_enable"), + new Route(POST, "/_security/user/{username}/_disable"), + new Route(PUT, "/_security/user/{username}/_disable") ); } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4ServerTransportAuthenticationTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4ServerTransportAuthenticationTests.java index 3d3f96b98d5e5..d294fb50046d6 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4ServerTransportAuthenticationTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4ServerTransportAuthenticationTests.java @@ -158,7 +158,7 @@ public TransportRequestHandler interceptHandler( } } ); - DiscoveryNode remoteNode = remoteTransportService.getLocalDiscoNode(); + DiscoveryNode remoteNode = remoteTransportService.getLocalNode(); remoteTransportService.registerRequestHandler( RemoteClusterNodesAction.TYPE.name(), EsExecutors.DIRECT_EXECUTOR_SERVICE, 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 b2ce91140de76..06293df4f4559 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 @@ -10,7 +10,6 @@ import org.apache.logging.log4j.Logger; import org.apache.lucene.search.TotalHits; import org.apache.lucene.util.PriorityQueue; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.DelegatingActionListener; import org.elasticsearch.action.search.ClosePointInTimeRequest; @@ -101,7 +100,6 @@ import static org.elasticsearch.action.ActionListener.wrap; import static org.elasticsearch.xpack.ql.execution.search.extractor.AbstractFieldHitExtractor.MultiValueSupport.LENIENT; import static org.elasticsearch.xpack.ql.execution.search.extractor.AbstractFieldHitExtractor.MultiValueSupport.NONE; -import static org.elasticsearch.xpack.sql.proto.VersionCompatibility.INTRODUCING_UNSIGNED_LONG; // TODO: add retry/back-off public class Querier { @@ -202,7 +200,7 @@ public static void closePointInTime(Client client, BytesReference pointInTimeId, public static SearchRequest prepareRequest(SearchSourceBuilder source, SqlConfiguration cfg, boolean includeFrozen, String... indices) { source.timeout(cfg.requestTimeout()); - SearchRequest searchRequest = new SearchRequest(Version.fromId(INTRODUCING_UNSIGNED_LONG.id)); + SearchRequest searchRequest = new SearchRequest(); if (source.pointInTimeBuilder() == null) { searchRequest.indices(indices); searchRequest.indicesOptions( 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 26b6bfdc0cead..bf68e174f033c 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,6 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -19,7 +18,6 @@ import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.xpack.sql.action.Protocol; import org.elasticsearch.xpack.sql.action.SqlClearCursorAction; import org.elasticsearch.xpack.sql.action.SqlClearCursorRequest; import org.elasticsearch.xpack.sql.action.SqlClearCursorResponse; @@ -29,17 +27,14 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.sql.proto.CoreProtocol.CLEAR_CURSOR_REST_ENDPOINT; @ServerlessScope(Scope.PUBLIC) public class RestSqlClearCursorAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, Protocol.CLEAR_CURSOR_REST_ENDPOINT) - .replaces(POST, Protocol.CLEAR_CURSOR_DEPRECATED_REST_ENDPOINT, RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, CLEAR_CURSOR_REST_ENDPOINT)); } @Override 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 43051e9e16160..63f942714f8de 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,7 +8,6 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.logging.LogManager; import org.elasticsearch.logging.Logger; import org.elasticsearch.rest.BaseRestHandler; @@ -17,7 +16,6 @@ import org.elasticsearch.rest.ServerlessScope; import org.elasticsearch.rest.action.RestCancellableNodeClient; import org.elasticsearch.xcontent.XContentParser; -import org.elasticsearch.xpack.sql.action.Protocol; import org.elasticsearch.xpack.sql.action.SqlQueryAction; import org.elasticsearch.xpack.sql.action.SqlQueryRequest; @@ -29,6 +27,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.xpack.ql.util.LoggingUtils.logOnFailure; +import static org.elasticsearch.xpack.sql.proto.CoreProtocol.SQL_QUERY_REST_ENDPOINT; import static org.elasticsearch.xpack.sql.proto.CoreProtocol.URL_PARAM_DELIMITER; @ServerlessScope(Scope.PUBLIC) @@ -37,14 +36,7 @@ public class RestSqlQueryAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, Protocol.SQL_QUERY_REST_ENDPOINT) - .replaces(GET, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT, RestApiVersion.V_7) - .build(), - Route.builder(POST, Protocol.SQL_QUERY_REST_ENDPOINT) - .replaces(POST, Protocol.SQL_QUERY_DEPRECATED_REST_ENDPOINT, RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, SQL_QUERY_REST_ENDPOINT), new Route(POST, SQL_QUERY_REST_ENDPOINT)); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java index 7ba50b2f5aaf6..897226f50d75c 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java @@ -8,25 +8,20 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestActions; -import org.elasticsearch.xpack.sql.action.Protocol; import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.xpack.sql.proto.CoreProtocol.SQL_STATS_REST_ENDPOINT; public class RestSqlStatsAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, Protocol.SQL_STATS_REST_ENDPOINT) - .replaces(GET, Protocol.SQL_STATS_DEPRECATED_REST_ENDPOINT, RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, SQL_STATS_REST_ENDPOINT)); } @Override 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 04565d77b68d2..690c340e30d44 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,14 +7,12 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.Scope; import org.elasticsearch.rest.ServerlessScope; import org.elasticsearch.rest.action.RestToXContentListener; import org.elasticsearch.xcontent.XContentParser; -import org.elasticsearch.xpack.sql.action.Protocol; import org.elasticsearch.xpack.sql.action.SqlTranslateAction; import org.elasticsearch.xpack.sql.action.SqlTranslateRequest; @@ -23,6 +21,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.sql.proto.CoreProtocol.SQL_TRANSLATE_REST_ENDPOINT; /** * REST action for translating SQL queries into ES requests @@ -32,14 +31,7 @@ public class RestSqlTranslateAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, Protocol.SQL_TRANSLATE_REST_ENDPOINT) - .replaces(GET, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT, RestApiVersion.V_7) - .build(), - Route.builder(POST, Protocol.SQL_TRANSLATE_REST_ENDPOINT) - .replaces(POST, Protocol.SQL_TRANSLATE_DEPRECATED_REST_ENDPOINT, RestApiVersion.V_7) - .build() - ); + return List.of(new Route(GET, SQL_TRANSLATE_REST_ENDPOINT), new Route(POST, SQL_TRANSLATE_REST_ENDPOINT)); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java index 7a76ffe8eb109..41fa66ae36aeb 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java @@ -9,7 +9,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.ActionListenerResponseHandler; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.cluster.service.ClusterService; @@ -57,7 +56,6 @@ import static java.util.Collections.unmodifiableList; import static org.elasticsearch.action.ActionListener.wrap; import static org.elasticsearch.xpack.core.ClientHelper.ASYNC_SEARCH_ORIGIN; -import static org.elasticsearch.xpack.ql.plugin.TransportActionUtils.executeRequestWithRetryAttempt; import static org.elasticsearch.xpack.sql.plugin.Transports.clusterName; import static org.elasticsearch.xpack.sql.plugin.Transports.username; import static org.elasticsearch.xpack.sql.proto.Mode.CLI; @@ -161,22 +159,11 @@ public static void operation( ); if (Strings.hasText(request.cursor()) == false) { - executeRequestWithRetryAttempt( - clusterService, - listener::onFailure, - onFailure -> planExecutor.sql( - cfg, - request.query(), - request.params(), - wrap(p -> listener.onResponse(createResponseWithSchema(request, p, task)), onFailure) - ), - node -> transportService.sendRequest( - node, - SqlQueryAction.NAME, - request, - new ActionListenerResponseHandler<>(listener, SqlQueryResponse::new, EsExecutors.DIRECT_EXECUTOR_SERVICE) - ), - log + planExecutor.sql( + cfg, + request.query(), + request.params(), + wrap(p -> listener.onResponse(createResponseWithSchema(request, p, task)), listener::onFailure) ); } else { Tuple decoded = Cursors.decodeFromStringWithZone(request.cursor(), planExecutor.writeableRegistry()); 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 a01bf660ba8d5..f298a1cf00624 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 @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.watcher.rest.action; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -34,14 +33,10 @@ public class RestAckWatchAction extends BaseRestHandler { @Override public List routes() { return List.of( - Route.builder(POST, "/_watcher/watch/{id}/_ack").replaces(POST, "/_xpack/watcher/watch/{id}/_ack", RestApiVersion.V_7).build(), - Route.builder(PUT, "/_watcher/watch/{id}/_ack").replaces(PUT, "/_xpack/watcher/watch/{id}/_ack", RestApiVersion.V_7).build(), - Route.builder(POST, "/_watcher/watch/{id}/_ack/{actions}") - .replaces(POST, "/_xpack/watcher/watch/{id}/_ack/{actions}", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_watcher/watch/{id}/_ack/{actions}") - .replaces(PUT, "/_xpack/watcher/watch/{id}/_ack/{actions}", RestApiVersion.V_7) - .build() + new Route(POST, "/_watcher/watch/{id}/_ack"), + new Route(PUT, "/_watcher/watch/{id}/_ack"), + new Route(POST, "/_watcher/watch/{id}/_ack/{actions}"), + new Route(PUT, "/_watcher/watch/{id}/_ack/{actions}") ); } 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 18c9e5a2825f4..b8b466883f7fe 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 @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.watcher.rest.action; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -33,14 +32,7 @@ public class RestActivateWatchAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, "/_watcher/watch/{id}/_activate") - .replaces(POST, "/_xpack/watcher/watch/{id}/_activate", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_watcher/watch/{id}/_activate") - .replaces(PUT, "/_xpack/watcher/watch/{id}/_activate", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, "/_watcher/watch/{id}/_activate"), new Route(PUT, "/_watcher/watch/{id}/_activate")); } @Override @@ -72,14 +64,7 @@ public static class DeactivateRestHandler extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(POST, "/_watcher/watch/{id}/_deactivate") - .replaces(POST, "/_xpack/watcher/watch/{id}/_deactivate", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_watcher/watch/{id}/_deactivate") - .replaces(PUT, "/_xpack/watcher/watch/{id}/_deactivate", RestApiVersion.V_7) - .build() - ); + return List.of(new Route(POST, "/_watcher/watch/{id}/_deactivate"), new Route(PUT, "/_watcher/watch/{id}/_deactivate")); } @Override 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 3c2ddc7a254d1..e909a34157583 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 @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.watcher.rest.action; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.protocol.xpack.watcher.DeleteWatchRequest; import org.elasticsearch.protocol.xpack.watcher.DeleteWatchResponse; import org.elasticsearch.rest.BaseRestHandler; @@ -29,9 +28,7 @@ public class RestDeleteWatchAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(DELETE, "/_watcher/watch/{id}").replaces(DELETE, "/_xpack/watcher/watch/{id}", RestApiVersion.V_7).build() - ); + return List.of(new Route(DELETE, "/_watcher/watch/{id}")); } @Override 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 56d249c427be1..a25e7704c0653 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 @@ -10,7 +10,6 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequestFilter; @@ -55,14 +54,10 @@ public class RestExecuteWatchAction extends BaseRestHandler implements RestReque @Override public List routes() { return List.of( - Route.builder(POST, "/_watcher/watch/{id}/_execute") - .replaces(POST, "/_xpack/watcher/watch/{id}/_execute", RestApiVersion.V_7) - .build(), - Route.builder(PUT, "/_watcher/watch/{id}/_execute") - .replaces(PUT, "/_xpack/watcher/watch/{id}/_execute", RestApiVersion.V_7) - .build(), - Route.builder(POST, "/_watcher/watch/_execute").replaces(POST, "/_xpack/watcher/watch/_execute", RestApiVersion.V_7).build(), - Route.builder(PUT, "/_watcher/watch/_execute").replaces(PUT, "/_xpack/watcher/watch/_execute", RestApiVersion.V_7).build() + new Route(POST, "/_watcher/watch/{id}/_execute"), + new Route(PUT, "/_watcher/watch/{id}/_execute"), + new Route(POST, "/_watcher/watch/_execute"), + new Route(PUT, "/_watcher/watch/_execute") ); } 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 5467297ab1e72..f296e9869cd9e 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 @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.watcher.rest.action; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; @@ -29,7 +28,7 @@ public class RestGetWatchAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(GET, "/_watcher/watch/{id}").replaces(GET, "/_xpack/watcher/watch/{id}", RestApiVersion.V_7).build()); + return List.of(new Route(GET, "/_watcher/watch/{id}")); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatcherSettingsAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatcherSettingsAction.java index 73a933c9c2e46..ff9e8c45d72f3 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatcherSettingsAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatcherSettingsAction.java @@ -17,6 +17,8 @@ import java.io.IOException; import java.util.List; +import static org.elasticsearch.rest.RestRequest.Method.GET; + /** * Allows retrieving a subset of index settings (those use-settable) for the .watches index. * See {@link RestUpdateWatcherSettingsAction} for the setting counterpart. @@ -29,7 +31,7 @@ public String getName() { @Override public List routes() { - return List.of(Route.builder(RestRequest.Method.GET, "/_watcher/settings").build()); + return List.of(new Route(GET, "/_watcher/settings")); } @Override 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 42820dabf9d7d..9dba72b1f64c3 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 @@ -9,7 +9,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.rest.BaseRestHandler; @@ -33,10 +32,7 @@ public class RestPutWatchAction extends BaseRestHandler implements RestRequestFi @Override public List routes() { - return List.of( - Route.builder(POST, "/_watcher/watch/{id}").replaces(POST, "/_xpack/watcher/watch/{id}", RestApiVersion.V_7).build(), - Route.builder(PUT, "/_watcher/watch/{id}").replaces(PUT, "/_xpack/watcher/watch/{id}", RestApiVersion.V_7).build() - ); + return List.of(new Route(POST, "/_watcher/watch/{id}"), new Route(PUT, "/_watcher/watch/{id}")); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestUpdateWatcherSettingsAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestUpdateWatcherSettingsAction.java index 26f64a0918141..db14a6572fa99 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestUpdateWatcherSettingsAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestUpdateWatcherSettingsAction.java @@ -17,6 +17,8 @@ import java.io.IOException; import java.util.List; +import static org.elasticsearch.rest.RestRequest.Method.PUT; + /** * Allows setting a subset of index settings for the .watches index. * See {@link RestGetWatcherSettingsAction} for the retrieval counterpart. @@ -29,7 +31,7 @@ public String getName() { @Override public List routes() { - return List.of(Route.builder(RestRequest.Method.PUT, "/_watcher/settings").build()); + return List.of(new Route(PUT, "/_watcher/settings")); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java index f6b9ae9c4031c..a52e0882fa81e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.watcher.rest.action; import org.elasticsearch.client.internal.node.NodeClient; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestUtils; @@ -24,7 +23,7 @@ public class RestWatchServiceAction extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(POST, "/_watcher/_start").replaces(POST, "/_xpack/watcher/_start", RestApiVersion.V_7).build()); + return List.of(new Route(POST, "/_watcher/_start")); } @Override @@ -42,7 +41,7 @@ public static class StopRestHandler extends BaseRestHandler { @Override public List routes() { - return List.of(Route.builder(POST, "/_watcher/_stop").replaces(POST, "/_xpack/watcher/_stop", RestApiVersion.V_7).build()); + return List.of(new Route(POST, "/_watcher/_stop")); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java index f7a59553a65ff..2c04501ee66d6 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestActions; @@ -29,10 +28,7 @@ public class RestWatcherStatsAction extends BaseRestHandler { @Override public List routes() { - return List.of( - Route.builder(GET, "/_watcher/stats").replaces(GET, "/_xpack/watcher/stats", RestApiVersion.V_7).build(), - Route.builder(GET, "/_watcher/stats/{metric}").replaces(GET, "/_xpack/watcher/stats/{metric}", RestApiVersion.V_7).build() - ); + return List.of(new Route(GET, "/_watcher/stats"), new Route(GET, "/_watcher/stats/{metric}")); } @Override From d85b0d74cf7bb69d41208f2be3ecb229cc2e52a7 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Wed, 16 Oct 2024 21:37:17 +0200 Subject: [PATCH 03/34] More --- ...> RoleMappingXContentNameFieldHelper.java} | 22 ++++++----- .../security/authz/RoleMappingMetadata.java | 4 +- .../FileSettingsRoleMappingsRestartIT.java | 38 ++++++++++++++++--- .../ReservedRoleMappingAction.java | 9 +++-- .../TransportGetRoleMappingsAction.java | 2 +- 5 files changed, 53 insertions(+), 22 deletions(-) rename x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/{ClusterStateRoleMappingXContentTranslator.java => RoleMappingXContentNameFieldHelper.java} (72%) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMappingXContentTranslator.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/RoleMappingXContentNameFieldHelper.java similarity index 72% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMappingXContentTranslator.java rename to x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/RoleMappingXContentNameFieldHelper.java index bc85294db11cb..6682c75f4ed40 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ClusterStateRoleMappingXContentTranslator.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/RoleMappingXContentNameFieldHelper.java @@ -15,20 +15,21 @@ import java.util.HashMap; import java.util.Map; -public class ClusterStateRoleMappingXContentTranslator { +public final class RoleMappingXContentNameFieldHelper { + private static final Logger logger = LogManager.getLogger(RoleMappingXContentNameFieldHelper.class); - private static final Logger logger = LogManager.getLogger(ClusterStateRoleMappingXContentTranslator.class); - - public static final String NAME_FIELD = "_es_reserved_name"; + public static final String METADATA_NAME_FIELD = "_es_role_mapping_name"; public static final String FALLBACK_NAME = "name_not_available_after_deserialization"; + private RoleMappingXContentNameFieldHelper() {} + public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { Map metadata = new HashMap<>(roleMapping.getMetadata()); - Object previousValue = metadata.put(NAME_FIELD, roleMapping.getName()); + Object previousValue = metadata.put(METADATA_NAME_FIELD, roleMapping.getName()); if (previousValue != null) { logger.error( "Metadata field [{}] is reserved and will be overwritten. Please rename this field in your role mapping configuration.", - NAME_FIELD + METADATA_NAME_FIELD ); } return new ExpressionRoleMapping( @@ -36,12 +37,13 @@ public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping.getExpression(), roleMapping.getRoles(), roleMapping.getRoleTemplates(), + // TODO deterministic order, maybe Map.copyOf(metadata), roleMapping.isEnabled() ); } - public static ExpressionRoleMapping fromXContent(XContentParser parser) throws IOException { + public static ExpressionRoleMapping parseWithNameFromMetadata(XContentParser parser) throws IOException { ExpressionRoleMapping roleMapping = ExpressionRoleMapping.parse(FALLBACK_NAME, parser); String name = getNameFromMetadata(roleMapping); return new ExpressionRoleMapping( @@ -56,12 +58,12 @@ public static ExpressionRoleMapping fromXContent(XContentParser parser) throws I private static String getNameFromMetadata(ExpressionRoleMapping roleMapping) { Map metadata = roleMapping.getMetadata(); - if (metadata.containsKey(NAME_FIELD) && metadata.get(NAME_FIELD) instanceof String name) { + if (metadata.containsKey(METADATA_NAME_FIELD) && metadata.get(METADATA_NAME_FIELD) instanceof String name) { return name; } - logger.error("role mapping metadata should contain reserved string field [" + NAME_FIELD + "]"); - assert false : "role mapping metadata should contain reserved string field [" + NAME_FIELD + "]"; + logger.error("role mapping metadata should contain reserved string field [" + METADATA_NAME_FIELD + "]"); + assert false : "role mapping metadata should contain reserved string field [" + METADATA_NAME_FIELD + "]"; return FALLBACK_NAME; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index 0f9c3777ea937..29ae6549bae3c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -21,8 +21,8 @@ import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xcontent.XContentParser; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMappingXContentTranslator; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; +import org.elasticsearch.xpack.core.security.authc.support.mapper.RoleMappingXContentNameFieldHelper; import java.io.IOException; import java.util.Collection; @@ -49,7 +49,7 @@ public final class RoleMappingMetadata extends AbstractNamedDiffable ClusterStateRoleMappingXContentTranslator.fromXContent(p), + (p, c) -> RoleMappingXContentNameFieldHelper.parseWithNameFromMetadata(p), new ParseField(TYPE) ); } diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java index f81c53c5e7753..13f9cda122bd2 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java @@ -26,7 +26,7 @@ import static org.elasticsearch.integration.RoleMappingFileSettingsIT.setupClusterStateListener; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.setupClusterStateListenerForCleanup; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.writeJSONFile; -import static org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMappingXContentTranslator.NAME_FIELD; +import static org.elasticsearch.xpack.core.security.authc.support.mapper.RoleMappingXContentNameFieldHelper.METADATA_NAME_FIELD; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.emptyIterable; @@ -101,7 +101,14 @@ public void testReservedStatePersistsOnRestart() throws Exception { new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("kibana_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something", NAME_FIELD, "everyone_kibana_alone"), + Map.of( + "uuid", + "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", + "_foo", + "something", + METADATA_NAME_FIELD, + "everyone_kibana_alone" + ), true ), new ExpressionRoleMapping( @@ -109,7 +116,14 @@ public void testReservedStatePersistsOnRestart() throws Exception { new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("fleet_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else", NAME_FIELD, "everyone_fleet_alone"), + Map.of( + "uuid", + "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", + "_foo", + "something_else", + METADATA_NAME_FIELD, + "everyone_fleet_alone" + ), false ) ) @@ -131,7 +145,14 @@ public void testReservedStatePersistsOnRestart() throws Exception { new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("kibana_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something", NAME_FIELD, "everyone_kibana_alone"), + Map.of( + "uuid", + "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", + "_foo", + "something", + METADATA_NAME_FIELD, + "everyone_kibana_alone" + ), true ), new ExpressionRoleMapping( @@ -139,7 +160,14 @@ public void testReservedStatePersistsOnRestart() throws Exception { new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("fleet_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else", NAME_FIELD, "everyone_fleet_alone"), + Map.of( + "uuid", + "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", + "_foo", + "something_else", + METADATA_NAME_FIELD, + "everyone_fleet_alone" + ), false ) ) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java index 97f4ccfe9d1bb..0b5a70e27624c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.xcontent.XContentParserConfiguration; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequestBuilder; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ClusterStateRoleMappingXContentTranslator; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; +import org.elasticsearch.xpack.core.security.authc.support.mapper.RoleMappingXContentNameFieldHelper; import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; import java.io.IOException; @@ -44,7 +44,7 @@ public String name() { @Override public TransformState transform(Object source, TransformState prevState) throws Exception { @SuppressWarnings("unchecked") - Set roleMappings = validate((List) source); + Set roleMappings = validateAndTranslate((List) source); RoleMappingMetadata newRoleMappingMetadata = new RoleMappingMetadata(roleMappings); if (newRoleMappingMetadata.equals(RoleMappingMetadata.getFromClusterState(prevState.state()))) { return prevState; @@ -72,7 +72,7 @@ public List fromXContent(XContentParser parser) throws IO return result; } - private Set validate(List roleMappings) { + private Set validateAndTranslate(List roleMappings) { var exceptions = new ArrayList(); for (var roleMapping : roleMappings) { // File based defined role mappings are allowed to use MetadataUtils.RESERVED_PREFIX @@ -87,7 +87,8 @@ private Set validate(List roleMapp throw illegalArgumentException; } return roleMappings.stream() - .map(it -> ClusterStateRoleMappingXContentTranslator.copyWithNameInMetadata(it.getMapping())) + // Store name in metadata to make it available for XContent deserialization via `RoleMappingMetadata#fromXContent()` + .map(r -> RoleMappingXContentNameFieldHelper.copyWithNameInMetadata(r.getMapping())) .collect(Collectors.toUnmodifiableSet()); } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java index ac0d3177cca09..3a0b046bcb15a 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java @@ -52,7 +52,7 @@ protected void doExecute(Task task, final GetRoleMappingsRequest request, final names = new HashSet<>(Arrays.asList(request.getNames())); } this.roleMappingStore.getRoleMappings(names, ActionListener.wrap(mappings -> { - ExpressionRoleMapping[] array = mappings.toArray(new ExpressionRoleMapping[mappings.size()]); + ExpressionRoleMapping[] array = mappings.toArray(new ExpressionRoleMapping[0]); listener.onResponse(new GetRoleMappingsResponse(array)); }, listener::onFailure)); } From fe846e23d4e595b22623e4682013c4031a885a73 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Wed, 16 Oct 2024 21:40:45 +0200 Subject: [PATCH 04/34] Tweaks --- ...> ReservedRoleMappingXContentNameFieldHelper.java} | 11 ++++++----- .../core/security/authz/RoleMappingMetadata.java | 4 ++-- .../security/FileSettingsRoleMappingsRestartIT.java | 2 +- .../action/rolemapping/ReservedRoleMappingAction.java | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) rename x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/{RoleMappingXContentNameFieldHelper.java => ReservedRoleMappingXContentNameFieldHelper.java} (84%) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/RoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java similarity index 84% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/RoleMappingXContentNameFieldHelper.java rename to x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index 6682c75f4ed40..34f28b7fb1442 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/RoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -15,20 +15,21 @@ import java.util.HashMap; import java.util.Map; -public final class RoleMappingXContentNameFieldHelper { - private static final Logger logger = LogManager.getLogger(RoleMappingXContentNameFieldHelper.class); +public final class ReservedRoleMappingXContentNameFieldHelper { + private static final Logger logger = LogManager.getLogger(ReservedRoleMappingXContentNameFieldHelper.class); - public static final String METADATA_NAME_FIELD = "_es_role_mapping_name"; + public static final String METADATA_NAME_FIELD = "_es_reserved_role_mapping_name"; public static final String FALLBACK_NAME = "name_not_available_after_deserialization"; - private RoleMappingXContentNameFieldHelper() {} + private ReservedRoleMappingXContentNameFieldHelper() {} public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { Map metadata = new HashMap<>(roleMapping.getMetadata()); Object previousValue = metadata.put(METADATA_NAME_FIELD, roleMapping.getName()); if (previousValue != null) { logger.error( - "Metadata field [{}] is reserved and will be overwritten. Please rename this field in your role mapping configuration.", + "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + + "Please rename this field in your role mapping configuration.", METADATA_NAME_FIELD ); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index 29ae6549bae3c..8eb6104da53bb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -22,7 +22,7 @@ import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; -import org.elasticsearch.xpack.core.security.authc.support.mapper.RoleMappingXContentNameFieldHelper; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; import java.io.IOException; import java.util.Collection; @@ -49,7 +49,7 @@ public final class RoleMappingMetadata extends AbstractNamedDiffable RoleMappingXContentNameFieldHelper.parseWithNameFromMetadata(p), + (p, c) -> ReservedRoleMappingXContentNameFieldHelper.parseWithNameFromMetadata(p), new ParseField(TYPE) ); } diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java index 13f9cda122bd2..fc2c2a4ea9877 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java @@ -26,7 +26,7 @@ import static org.elasticsearch.integration.RoleMappingFileSettingsIT.setupClusterStateListener; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.setupClusterStateListenerForCleanup; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.writeJSONFile; -import static org.elasticsearch.xpack.core.security.authc.support.mapper.RoleMappingXContentNameFieldHelper.METADATA_NAME_FIELD; +import static org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper.METADATA_NAME_FIELD; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.emptyIterable; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java index 0b5a70e27624c..9c14af9524520 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java @@ -15,7 +15,7 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequestBuilder; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; -import org.elasticsearch.xpack.core.security.authc.support.mapper.RoleMappingXContentNameFieldHelper; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; import java.io.IOException; @@ -88,7 +88,7 @@ private Set validateAndTranslate(List RoleMappingXContentNameFieldHelper.copyWithNameInMetadata(r.getMapping())) + .map(r -> ReservedRoleMappingXContentNameFieldHelper.copyWithNameInMetadata(r.getMapping())) .collect(Collectors.toUnmodifiableSet()); } } From ba1531eaf9414506ea8825573167b342588dbd2e Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Wed, 16 Oct 2024 21:43:06 +0200 Subject: [PATCH 05/34] Remove sout --- .../xpack/security/FileSettingsRoleMappingsRestartIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java index fc2c2a4ea9877..e7683e7456eb8 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java @@ -92,7 +92,6 @@ public void testReservedStatePersistsOnRestart() throws Exception { var clusterState = clusterAdmin().state(new ClusterStateRequest(TEST_REQUEST_TIMEOUT)).actionGet().getState(); assertRoleMappingReservedMetadata(clusterState, "everyone_kibana_alone", "everyone_fleet_alone"); List roleMappings = new ArrayList<>(RoleMappingMetadata.getFromClusterState(clusterState).getRoleMappings()); - System.out.println("roleMappings: " + roleMappings); assertThat( roleMappings, containsInAnyOrder( From c63e6b0c4136e6d683eaee4aa5682f48b80027b6 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Wed, 16 Oct 2024 21:47:13 +0200 Subject: [PATCH 06/34] Better logs --- .../ReservedRoleMappingXContentNameFieldHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index 34f28b7fb1442..b985c3fe2397b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -63,8 +63,12 @@ private static String getNameFromMetadata(ExpressionRoleMapping roleMapping) { return name; } - logger.error("role mapping metadata should contain reserved string field [" + METADATA_NAME_FIELD + "]"); - assert false : "role mapping metadata should contain reserved string field [" + METADATA_NAME_FIELD + "]"; + logger.error( + "Role mapping metadata is missing a required internal system field [{}]. " + + "This may result in inconsistent Role Mappings API behavior.", + METADATA_NAME_FIELD + ); + assert false : "role mapping metadata should contain string field [" + METADATA_NAME_FIELD + "]"; return FALLBACK_NAME; } } From 02cb783b58f4ab1709528e02d0fe3aa9298f97b0 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Wed, 16 Oct 2024 22:01:46 +0200 Subject: [PATCH 07/34] Nits --- .../ReservedRoleMappingXContentNameFieldHelper.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index b985c3fe2397b..4cad7b5bee5a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -12,8 +12,8 @@ import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; -import java.util.HashMap; import java.util.Map; +import java.util.TreeMap; public final class ReservedRoleMappingXContentNameFieldHelper { private static final Logger logger = LogManager.getLogger(ReservedRoleMappingXContentNameFieldHelper.class); @@ -24,7 +24,8 @@ public final class ReservedRoleMappingXContentNameFieldHelper { private ReservedRoleMappingXContentNameFieldHelper() {} public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { - Map metadata = new HashMap<>(roleMapping.getMetadata()); + // Use tree map to get deterministic order, and ensure we have a mutable map to work with + Map metadata = new TreeMap<>(roleMapping.getMetadata()); Object previousValue = metadata.put(METADATA_NAME_FIELD, roleMapping.getName()); if (previousValue != null) { logger.error( @@ -38,17 +39,15 @@ public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping.getExpression(), roleMapping.getRoles(), roleMapping.getRoleTemplates(), - // TODO deterministic order, maybe - Map.copyOf(metadata), + metadata, roleMapping.isEnabled() ); } public static ExpressionRoleMapping parseWithNameFromMetadata(XContentParser parser) throws IOException { ExpressionRoleMapping roleMapping = ExpressionRoleMapping.parse(FALLBACK_NAME, parser); - String name = getNameFromMetadata(roleMapping); return new ExpressionRoleMapping( - name, + getNameFromMetadata(roleMapping), roleMapping.getExpression(), roleMapping.getRoles(), roleMapping.getRoleTemplates(), From bf802739cabf79698c2683f55350d3932482beb7 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Thu, 17 Oct 2024 11:40:25 +0200 Subject: [PATCH 08/34] Still not it... --- ...vedRoleMappingXContentNameFieldHelper.java | 50 ++++++++++++++----- .../security/authz/RoleMappingMetadata.java | 7 ++- .../ReservedRoleMappingAction.java | 4 +- ...ingMetadataXContentSerializationTests.java | 8 +-- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index 4cad7b5bee5a2..cbac402bec6a1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -12,8 +12,8 @@ import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; +import java.util.HashMap; import java.util.Map; -import java.util.TreeMap; public final class ReservedRoleMappingXContentNameFieldHelper { private static final Logger logger = LogManager.getLogger(ReservedRoleMappingXContentNameFieldHelper.class); @@ -24,10 +24,33 @@ public final class ReservedRoleMappingXContentNameFieldHelper { private ReservedRoleMappingXContentNameFieldHelper() {} public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { - // Use tree map to get deterministic order, and ensure we have a mutable map to work with - Map metadata = new TreeMap<>(roleMapping.getMetadata()); - Object previousValue = metadata.put(METADATA_NAME_FIELD, roleMapping.getName()); - if (previousValue != null) { + // metadata name field already present, nothing to do + if (roleMapping.getMetadata().containsKey(METADATA_NAME_FIELD)) { + return roleMapping; + } + // xcontent should already give us back a hashmap but make sure we have one, so we can modify it + // can't use Maps.copyWith... since these create maps that don't support `null` values in map entries + Map metadata = toHashMap(roleMapping.getMetadata()); + metadata.put(METADATA_NAME_FIELD, roleMapping.getName()); + return new ExpressionRoleMapping( + roleMapping.getName(), + roleMapping.getExpression(), + roleMapping.getRoles(), + roleMapping.getRoleTemplates(), + metadata, + roleMapping.isEnabled() + ); + } + + public static ExpressionRoleMapping removeNameFromMetadata(ExpressionRoleMapping roleMapping, boolean logError) { + if (roleMapping.getMetadata().containsKey(METADATA_NAME_FIELD) == false) { + return roleMapping; + } + // xcontent should already give us back a hashmap but make sure we have one, so we can modify it + // can't use Maps.copyWith... since these create maps that don't support `null` values in map entries + Map metadata = toHashMap(roleMapping.getMetadata()); + metadata.remove(METADATA_NAME_FIELD); + if (logError) { logger.error( "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + "Please rename this field in your role mapping configuration.", @@ -60,14 +83,17 @@ private static String getNameFromMetadata(ExpressionRoleMapping roleMapping) { Map metadata = roleMapping.getMetadata(); if (metadata.containsKey(METADATA_NAME_FIELD) && metadata.get(METADATA_NAME_FIELD) instanceof String name) { return name; + } else { + // This is valid the first time we recover from cluster-state: the old format metadata won't have a name stored in metadata yet + return FALLBACK_NAME; } + } - logger.error( - "Role mapping metadata is missing a required internal system field [{}]. " - + "This may result in inconsistent Role Mappings API behavior.", - METADATA_NAME_FIELD - ); - assert false : "role mapping metadata should contain string field [" + METADATA_NAME_FIELD + "]"; - return FALLBACK_NAME; + private static HashMap toHashMap(Map map) { + if (map instanceof HashMap) { + return (HashMap) map; + } else { + return new HashMap<>(map); + } } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index 8eb6104da53bb..6e0eda387e2f5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -31,6 +31,7 @@ import java.util.LinkedHashSet; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.Metadata.ALL_CONTEXTS; import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; @@ -63,11 +64,13 @@ public static RoleMappingMetadata getFromClusterState(ClusterState clusterState) private final Set roleMappings; public RoleMappingMetadata(Set roleMappings) { - this.roleMappings = roleMappings; + this.roleMappings = roleMappings.stream() + .map(ReservedRoleMappingXContentNameFieldHelper::copyWithNameInMetadata) + .collect(Collectors.toSet()); } public RoleMappingMetadata(StreamInput input) throws IOException { - this.roleMappings = input.readCollectionAsSet(ExpressionRoleMapping::new); + this(input.readCollectionAsSet(ExpressionRoleMapping::new)); } public Set getRoleMappings() { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java index 9c14af9524520..acd12351879c5 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java @@ -87,8 +87,8 @@ private Set validateAndTranslate(List ReservedRoleMappingXContentNameFieldHelper.copyWithNameInMetadata(r.getMapping())) + // user-defined values for the metadata name field must get stripped out + .map(r -> ReservedRoleMappingXContentNameFieldHelper.removeNameFromMetadata(r.getMapping(), true)) .collect(Collectors.toUnmodifiableSet()); } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java index db0201a1c072b..54597ee004fdf 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java @@ -17,7 +17,6 @@ import java.io.IOException; import java.util.HashSet; -import java.util.Objects; import java.util.Set; import static org.elasticsearch.xpack.security.authc.support.mapper.ExpressionRoleMappingTests.randomRoleMapping; @@ -64,12 +63,7 @@ protected void assertEqualInstances(RoleMappingMetadata expectedInstance, RoleMa for (ExpressionRoleMapping expectedExpressionRoleMapping : expectedInstance.getRoleMappings()) { boolean found = false; for (ExpressionRoleMapping newExpressionRoleMapping : newInstance.getRoleMappings()) { - // everything equals except name, because the name is lost during deserialization of {@code RoleMappingMetadata} - found |= newExpressionRoleMapping.isEnabled() == expectedExpressionRoleMapping.isEnabled() - && Objects.equals(newExpressionRoleMapping.getExpression(), expectedExpressionRoleMapping.getExpression()) - && Objects.equals(newExpressionRoleMapping.getRoles(), expectedExpressionRoleMapping.getRoles()) - && Objects.equals(newExpressionRoleMapping.getRoleTemplates(), expectedExpressionRoleMapping.getRoleTemplates()) - && Objects.equals(newExpressionRoleMapping.getMetadata(), expectedExpressionRoleMapping.getMetadata()); + found |= newExpressionRoleMapping.equals(expectedExpressionRoleMapping); } assertTrue(found); } From e5120048a1d0fccba37ac8457f839649c391583d Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Thu, 17 Oct 2024 11:52:52 +0200 Subject: [PATCH 09/34] Maybe --- ...vedRoleMappingXContentNameFieldHelper.java | 27 ++----------------- .../security/authz/RoleMappingMetadata.java | 7 ++--- .../ReservedRoleMappingAction.java | 3 +-- ...ingMetadataXContentSerializationTests.java | 8 +++++- 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index cbac402bec6a1..336c128ccc971 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -24,33 +24,10 @@ public final class ReservedRoleMappingXContentNameFieldHelper { private ReservedRoleMappingXContentNameFieldHelper() {} public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { - // metadata name field already present, nothing to do - if (roleMapping.getMetadata().containsKey(METADATA_NAME_FIELD)) { - return roleMapping; - } - // xcontent should already give us back a hashmap but make sure we have one, so we can modify it - // can't use Maps.copyWith... since these create maps that don't support `null` values in map entries - Map metadata = toHashMap(roleMapping.getMetadata()); - metadata.put(METADATA_NAME_FIELD, roleMapping.getName()); - return new ExpressionRoleMapping( - roleMapping.getName(), - roleMapping.getExpression(), - roleMapping.getRoles(), - roleMapping.getRoleTemplates(), - metadata, - roleMapping.isEnabled() - ); - } - - public static ExpressionRoleMapping removeNameFromMetadata(ExpressionRoleMapping roleMapping, boolean logError) { - if (roleMapping.getMetadata().containsKey(METADATA_NAME_FIELD) == false) { - return roleMapping; - } // xcontent should already give us back a hashmap but make sure we have one, so we can modify it - // can't use Maps.copyWith... since these create maps that don't support `null` values in map entries Map metadata = toHashMap(roleMapping.getMetadata()); - metadata.remove(METADATA_NAME_FIELD); - if (logError) { + // note: can't use Maps.copyWith... since these create maps that don't support `null` values in map entries + if (metadata.put(METADATA_NAME_FIELD, roleMapping.getName()) != null) { logger.error( "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + "Please rename this field in your role mapping configuration.", diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index 6e0eda387e2f5..8eb6104da53bb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -31,7 +31,6 @@ import java.util.LinkedHashSet; import java.util.Objects; import java.util.Set; -import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.Metadata.ALL_CONTEXTS; import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; @@ -64,13 +63,11 @@ public static RoleMappingMetadata getFromClusterState(ClusterState clusterState) private final Set roleMappings; public RoleMappingMetadata(Set roleMappings) { - this.roleMappings = roleMappings.stream() - .map(ReservedRoleMappingXContentNameFieldHelper::copyWithNameInMetadata) - .collect(Collectors.toSet()); + this.roleMappings = roleMappings; } public RoleMappingMetadata(StreamInput input) throws IOException { - this(input.readCollectionAsSet(ExpressionRoleMapping::new)); + this.roleMappings = input.readCollectionAsSet(ExpressionRoleMapping::new); } public Set getRoleMappings() { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java index acd12351879c5..daa5f65604da4 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java @@ -87,8 +87,7 @@ private Set validateAndTranslate(List ReservedRoleMappingXContentNameFieldHelper.removeNameFromMetadata(r.getMapping(), true)) + .map(r -> ReservedRoleMappingXContentNameFieldHelper.copyWithNameInMetadata(r.getMapping())) .collect(Collectors.toUnmodifiableSet()); } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java index 54597ee004fdf..db0201a1c072b 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/RoleMappingMetadataXContentSerializationTests.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.util.HashSet; +import java.util.Objects; import java.util.Set; import static org.elasticsearch.xpack.security.authc.support.mapper.ExpressionRoleMappingTests.randomRoleMapping; @@ -63,7 +64,12 @@ protected void assertEqualInstances(RoleMappingMetadata expectedInstance, RoleMa for (ExpressionRoleMapping expectedExpressionRoleMapping : expectedInstance.getRoleMappings()) { boolean found = false; for (ExpressionRoleMapping newExpressionRoleMapping : newInstance.getRoleMappings()) { - found |= newExpressionRoleMapping.equals(expectedExpressionRoleMapping); + // everything equals except name, because the name is lost during deserialization of {@code RoleMappingMetadata} + found |= newExpressionRoleMapping.isEnabled() == expectedExpressionRoleMapping.isEnabled() + && Objects.equals(newExpressionRoleMapping.getExpression(), expectedExpressionRoleMapping.getExpression()) + && Objects.equals(newExpressionRoleMapping.getRoles(), expectedExpressionRoleMapping.getRoles()) + && Objects.equals(newExpressionRoleMapping.getRoleTemplates(), expectedExpressionRoleMapping.getRoleTemplates()) + && Objects.equals(newExpressionRoleMapping.getMetadata(), expectedExpressionRoleMapping.getMetadata()); } assertTrue(found); } From 5cab323f229621610b032987ac92b313092da2cf Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Thu, 17 Oct 2024 21:35:22 +0200 Subject: [PATCH 10/34] API --- ...vedRoleMappingXContentNameFieldHelper.java | 11 +-- .../xpack/security/Security.java | 1 + .../TransportGetRoleMappingsAction.java | 75 +++++++++++++++++-- .../mapper/ClusterStateRoleMapper.java | 30 ++++++-- .../TransportGetRoleMappingsActionTests.java | 2 +- 5 files changed, 98 insertions(+), 21 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index 336c128ccc971..df45078418c36 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -24,8 +24,7 @@ public final class ReservedRoleMappingXContentNameFieldHelper { private ReservedRoleMappingXContentNameFieldHelper() {} public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { - // xcontent should already give us back a hashmap but make sure we have one, so we can modify it - Map metadata = toHashMap(roleMapping.getMetadata()); + Map metadata = new HashMap<>(roleMapping.getMetadata()); // note: can't use Maps.copyWith... since these create maps that don't support `null` values in map entries if (metadata.put(METADATA_NAME_FIELD, roleMapping.getName()) != null) { logger.error( @@ -65,12 +64,4 @@ private static String getNameFromMetadata(ExpressionRoleMapping roleMapping) { return FALLBACK_NAME; } } - - private static HashMap toHashMap(Map map) { - if (map instanceof HashMap) { - return (HashMap) map; - } else { - return new HashMap<>(map); - } - } } 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 79a00fa1293bd..8f32bcf7ace8a 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 @@ -899,6 +899,7 @@ Collection createComponents( components.add(nativeUsersStore); components.add(new PluginComponentBinding<>(NativeRoleMappingStore.class, nativeRoleMappingStore)); components.add(new PluginComponentBinding<>(UserRoleMapper.class, userRoleMapper)); + components.add(clusterStateRoleMapper); components.add(reservedRealm); components.add(realms); this.realms.set(realms); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java index 3a0b046bcb15a..95a15d8a245f7 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java @@ -6,6 +6,8 @@ */ package org.elasticsearch.xpack.security.action.rolemapping; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; @@ -17,21 +19,34 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.GetRoleMappingsRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.GetRoleMappingsResponse; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; +import org.elasticsearch.xpack.security.authc.support.mapper.ClusterStateRoleMapper; import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; public class TransportGetRoleMappingsAction extends HandledTransportAction { + private static final Logger logger = LogManager.getLogger(TransportGetRoleMappingsAction.class); + + private static final String READ_ONLY_ROLE_MAPPING_SUFFIX = " (read only)"; + private static final String READ_ONLY_METADATA_FLAG = "_read_only"; private final NativeRoleMappingStore roleMappingStore; + private final ClusterStateRoleMapper clusterStateRoleMapper; @Inject public TransportGetRoleMappingsAction( ActionFilters actionFilters, TransportService transportService, - NativeRoleMappingStore nativeRoleMappingStore + NativeRoleMappingStore nativeRoleMappingStore, + ClusterStateRoleMapper clusterStateRoleMapper ) { super( GetRoleMappingsAction.NAME, @@ -41,19 +56,69 @@ public TransportGetRoleMappingsAction( EsExecutors.DIRECT_EXECUTOR_SERVICE ); this.roleMappingStore = nativeRoleMappingStore; + this.clusterStateRoleMapper = clusterStateRoleMapper; } @Override protected void doExecute(Task task, final GetRoleMappingsRequest request, final ActionListener listener) { final Set names; if (request.getNames() == null || request.getNames().length == 0) { - names = null; + names = Set.of(); } else { names = new HashSet<>(Arrays.asList(request.getNames())); } - this.roleMappingStore.getRoleMappings(names, ActionListener.wrap(mappings -> { - ExpressionRoleMapping[] array = mappings.toArray(new ExpressionRoleMapping[0]); - listener.onResponse(new GetRoleMappingsResponse(array)); + roleMappingStore.getRoleMappings(names, ActionListener.wrap(nativeRoleMappings -> { + final Collection clusterStateRoleMappings = clusterStateRoleMapper.getMappings( + // if the API was queried with a reserved suffix for any of the names, we need to remove it because role mappings are + // stored without it in cluster-state + removeReservedSuffix(names) + ); + listener.onResponse(toResponse(clusterStateRoleMappings, nativeRoleMappings)); }, listener::onFailure)); } + + private GetRoleMappingsResponse toResponse( + Collection clusterStateRoleMappings, + Collection nativeRoleMappings + ) { + return new GetRoleMappingsResponse( + Stream.concat(nativeRoleMappings.stream(), clusterStateRoleMappings.stream().map(this::toResponse)) + .toArray(ExpressionRoleMapping[]::new) + ); + } + + private ExpressionRoleMapping toResponse(ExpressionRoleMapping mapping) { + Map metadata = new HashMap<>(mapping.getMetadata()); + metadata.remove(ReservedRoleMappingXContentNameFieldHelper.METADATA_NAME_FIELD); + if (metadata.put(READ_ONLY_METADATA_FLAG, true) != null) { + logger.error( + "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + + "Please rename this field in your role mapping configuration.", + READ_ONLY_METADATA_FLAG + ); + } + return new ExpressionRoleMapping( + addReservedSuffix(mapping), + mapping.getExpression(), + mapping.getRoles(), + mapping.getRoleTemplates(), + metadata, + mapping.isEnabled() + ); + } + + private String addReservedSuffix(ExpressionRoleMapping mapping) { + return mapping.getName() + READ_ONLY_ROLE_MAPPING_SUFFIX; + } + + private Set removeReservedSuffix(Set names) { + return names.stream().map(this::removeReservedSuffix).collect(Collectors.toSet()); + } + + private String removeReservedSuffix(String name) { + if (name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX)) { + return name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()); + } + return name; + } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java index 5dea6a938263c..e871d3b404285 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java @@ -14,13 +14,16 @@ import org.elasticsearch.cluster.ClusterStateListener; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.core.Nullable; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; +import java.util.Arrays; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; import static org.elasticsearch.xpack.core.security.SecurityExtension.SecurityComponents; @@ -28,12 +31,11 @@ * A role mapper the reads the role mapping rules (i.e. {@link ExpressionRoleMapping}s) from the cluster state * (i.e. {@link RoleMappingMetadata}). This is not enabled by default. */ -public final class ClusterStateRoleMapper extends AbstractRoleMapperClearRealmCache implements ClusterStateListener { - +public class ClusterStateRoleMapper extends AbstractRoleMapperClearRealmCache implements ClusterStateListener { /** - * This setting is never registered by the xpack security plugin - in order to disable the + * This setting is never registered by the xpack security plugin - in order to enable the * cluster-state based role mapper another plugin must register it as a boolean setting - * and set it to `false`. + * and set it to `true`. * If this setting is set to true then: *
    *
  • Realms that make use role mappings (all realms but file and native) will, @@ -81,12 +83,30 @@ public void clusterChanged(ClusterChangedEvent event) { } } + public boolean hasMapping(String name) { + return getMappings().stream().map(ExpressionRoleMapping::getName).anyMatch(name::equals); + } + + public Set getMappings(@Nullable Set names) { + if (enabled == false) { + return Set.of(); + } + final Set mappings = getMappings(); + if (names == null || names.isEmpty()) { + return mappings; + } + return mappings.stream().filter(it -> names.contains(it.getName())).collect(Collectors.toSet()); + } + private Set getMappings() { if (enabled == false) { return Set.of(); } else { final Set mappings = RoleMappingMetadata.getFromClusterState(clusterService.state()).getRoleMappings(); - logger.trace("Retrieved [{}] mapping(s) from cluster state", mappings.size()); + logger.trace( + "Retrieved mapping(s) {} from cluster state", + Arrays.toString(mappings.stream().map(ExpressionRoleMapping::getName).toArray(String[]::new)) + ); return mappings; } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index 6e8698f095d32..b98fa5432c258 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -58,7 +58,7 @@ public void setupMocks() { null, Collections.emptySet() ); - action = new TransportGetRoleMappingsAction(mock(ActionFilters.class), transportService, store); + action = new TransportGetRoleMappingsAction(mock(ActionFilters.class), transportService, store, mock()); namesRef = new AtomicReference<>(null); result = Collections.emptyList(); From ba07fd228c0a2301a8df650d9f2161723665030d Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 10:26:30 +0200 Subject: [PATCH 11/34] Tests --- .../TransportGetRoleMappingsAction.java | 12 +- .../mapper/ClusterStateRoleMapper.java | 8 +- .../TransportGetRoleMappingsActionTests.java | 190 +++++++++++++----- 3 files changed, 153 insertions(+), 57 deletions(-) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java index 95a15d8a245f7..6835b3374e161 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java @@ -35,8 +35,8 @@ public class TransportGetRoleMappingsAction extends HandledTransportAction { private static final Logger logger = LogManager.getLogger(TransportGetRoleMappingsAction.class); - private static final String READ_ONLY_ROLE_MAPPING_SUFFIX = " (read only)"; - private static final String READ_ONLY_METADATA_FLAG = "_read_only"; + static final String READ_ONLY_ROLE_MAPPING_SUFFIX = " (read only)"; + static final String READ_ONLY_METADATA_FLAG = "_read_only"; private final NativeRoleMappingStore roleMappingStore; private final ClusterStateRoleMapper clusterStateRoleMapper; @@ -73,21 +73,21 @@ protected void doExecute(Task task, final GetRoleMappingsRequest request, final // stored without it in cluster-state removeReservedSuffix(names) ); - listener.onResponse(toResponse(clusterStateRoleMappings, nativeRoleMappings)); + listener.onResponse(buildResponse(clusterStateRoleMappings, nativeRoleMappings)); }, listener::onFailure)); } - private GetRoleMappingsResponse toResponse( + private GetRoleMappingsResponse buildResponse( Collection clusterStateRoleMappings, Collection nativeRoleMappings ) { return new GetRoleMappingsResponse( - Stream.concat(nativeRoleMappings.stream(), clusterStateRoleMappings.stream().map(this::toResponse)) + Stream.concat(nativeRoleMappings.stream(), clusterStateRoleMappings.stream().map(this::toResponseModel)) .toArray(ExpressionRoleMapping[]::new) ); } - private ExpressionRoleMapping toResponse(ExpressionRoleMapping mapping) { + private ExpressionRoleMapping toResponseModel(ExpressionRoleMapping mapping) { Map metadata = new HashMap<>(mapping.getMetadata()); metadata.remove(ReservedRoleMappingXContentNameFieldHelper.METADATA_NAME_FIELD); if (metadata.put(READ_ONLY_METADATA_FLAG, true) != null) { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java index e871d3b404285..ed18f5c218fd7 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java @@ -20,7 +20,6 @@ import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; -import java.util.Arrays; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @@ -98,15 +97,12 @@ public Set getMappings(@Nullable Set names) { return mappings.stream().filter(it -> names.contains(it.getName())).collect(Collectors.toSet()); } - private Set getMappings() { + public Set getMappings() { if (enabled == false) { return Set.of(); } else { final Set mappings = RoleMappingMetadata.getFromClusterState(clusterService.state()).getRoleMappings(); - logger.trace( - "Retrieved mapping(s) {} from cluster state", - Arrays.toString(mappings.stream().map(ExpressionRoleMapping::getName).toArray(String[]::new)) - ); + logger.trace("Retrieved [{}] mapping(s) from cluster state", mappings.size()); return mappings; } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index b98fa5432c258..57a8b7f0c0fe3 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -9,7 +9,6 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.PlainActionFuture; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.tasks.Task; import org.elasticsearch.test.ESTestCase; @@ -19,21 +18,26 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.GetRoleMappingsRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.GetRoleMappingsResponse; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; +import org.elasticsearch.xpack.security.authc.support.mapper.ClusterStateRoleMapper; import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; -import org.hamcrest.Matchers; import org.junit.Before; -import java.util.Arrays; +import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; -import static org.hamcrest.Matchers.arrayContaining; +import static org.elasticsearch.xpack.security.action.rolemapping.TransportGetRoleMappingsAction.READ_ONLY_METADATA_FLAG; +import static org.elasticsearch.xpack.security.action.rolemapping.TransportGetRoleMappingsAction.READ_ONLY_ROLE_MAPPING_SUFFIX; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.notNullValue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anySet; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; @@ -42,8 +46,10 @@ public class TransportGetRoleMappingsActionTests extends ESTestCase { private NativeRoleMappingStore store; private TransportGetRoleMappingsAction action; - private AtomicReference> namesRef; - private List result; + private AtomicReference> nativeNamesRef; + private AtomicReference> clusterStateNamesRef; + private List nativeMappings; + private Set clusterStateMappings; @SuppressWarnings("unchecked") @Before @@ -58,68 +64,162 @@ public void setupMocks() { null, Collections.emptySet() ); - action = new TransportGetRoleMappingsAction(mock(ActionFilters.class), transportService, store, mock()); + ClusterStateRoleMapper clusterStateRoleMapper = mock(); + action = new TransportGetRoleMappingsAction(mock(ActionFilters.class), transportService, store, clusterStateRoleMapper); - namesRef = new AtomicReference<>(null); - result = Collections.emptyList(); + nativeNamesRef = new AtomicReference<>(null); + clusterStateNamesRef = new AtomicReference<>(null); + nativeMappings = Collections.emptyList(); + clusterStateMappings = Collections.emptySet(); + + doAnswer(invocation -> { + Object[] args = invocation.getArguments(); + assert args.length == 1; + clusterStateNamesRef.set((Set) args[0]); + return clusterStateMappings; + }).when(clusterStateRoleMapper).getMappings(anySet()); doAnswer(invocation -> { Object[] args = invocation.getArguments(); assert args.length == 2; - namesRef.set((Set) args[0]); + nativeNamesRef.set((Set) args[0]); ActionListener> listener = (ActionListener>) args[1]; - listener.onResponse(result); + listener.onResponse(nativeMappings); return null; }).when(store).getRoleMappings(nullable(Set.class), any(ActionListener.class)); } - public void testGetSingleRole() throws Exception { - final PlainActionFuture future = new PlainActionFuture<>(); - final GetRoleMappingsRequest request = new GetRoleMappingsRequest(); - request.setNames("everyone"); + public void testGetSingleRoleMappingNativeOnly() throws Exception { + testGetMappings(List.of(mapping("everyone")), Collections.emptySet(), Set.of("everyone"), Set.of("everyone"), "everyone"); + } - final ExpressionRoleMapping mapping = mock(ExpressionRoleMapping.class); - result = Collections.singletonList(mapping); - action.doExecute(mock(Task.class), request, future); - assertThat(future.get(), notNullValue()); - assertThat(future.get().mappings(), arrayContaining(mapping)); - assertThat(namesRef.get(), containsInAnyOrder("everyone")); + public void testGetMultipleNamedRoleMappingsNativeOnly() throws Exception { + testGetMappings( + List.of(mapping("admin"), mapping("engineering"), mapping("sales"), mapping("finance")), + Collections.emptySet(), + Set.of("admin", "engineering", "sales", "finance"), + Set.of("admin", "engineering", "sales", "finance"), + "admin", + "engineering", + "sales", + "finance" + ); } - public void testGetMultipleNamedRoles() throws Exception { - final PlainActionFuture future = new PlainActionFuture<>(); - final GetRoleMappingsRequest request = new GetRoleMappingsRequest(); - request.setNames("admin", "engineering", "sales", "finance"); + public void testGetAllRoleMappingsNativeOnly() throws Exception { + testGetMappings( + List.of(mapping("admin"), mapping("engineering"), mapping("sales"), mapping("finance")), + Collections.emptySet(), + Set.of(), + Set.of() + ); + } - final ExpressionRoleMapping mapping1 = mock(ExpressionRoleMapping.class); - final ExpressionRoleMapping mapping2 = mock(ExpressionRoleMapping.class); - final ExpressionRoleMapping mapping3 = mock(ExpressionRoleMapping.class); - result = Arrays.asList(mapping1, mapping2, mapping3); + public void testGetSingleRoleMappingClusterStateOnly() throws Exception { + testGetMappings(List.of(), Set.of(mapping("everyone")), Set.of("everyone"), Set.of("everyone"), "everyone"); + } - action.doExecute(mock(Task.class), request, future); + public void testGetMultipleNamedRoleMappingsClusterStateOnly() throws Exception { + testGetMappings( + List.of(), + Set.of(mapping("admin"), mapping("engineering"), mapping("sales"), mapping("finance")), + Set.of("admin", "engineering", "sales", "finance"), + Set.of("admin", "engineering", "sales", "finance"), + "admin", + "engineering", + "sales", + "finance" + ); + } + + public void testGetAllRoleMappingsClusterStateOnly() throws Exception { + testGetMappings( + List.of(), + Set.of(mapping("admin"), mapping("engineering"), mapping("sales"), mapping("finance")), + Set.of(), + Set.of() + ); + } + + public void testGetSingleRoleMappingBoth() throws Exception { + testGetMappings(List.of(mapping("everyone")), Set.of(mapping("everyone")), Set.of("everyone"), Set.of("everyone"), "everyone"); + } + + public void testGetMultipleNamedRoleMappingsBoth() throws Exception { + testGetMappings( + List.of(mapping("admin"), mapping("engineering")), + Set.of(mapping("sales"), mapping("finance")), + Set.of("admin", "engineering", "sales", "finance"), + Set.of("admin", "engineering", "sales", "finance"), + "admin", + "engineering", + "sales", + "finance" + ); + } - final GetRoleMappingsResponse response = future.get(); - assertThat(response, notNullValue()); - assertThat(response.mappings(), arrayContainingInAnyOrder(mapping1, mapping2, mapping3)); - assertThat(namesRef.get(), containsInAnyOrder("admin", "engineering", "sales", "finance")); + public void testGetAllRoleMappingsClusterBoth() throws Exception { + testGetMappings(List.of(mapping("admin"), mapping("engineering")), Set.of(mapping("admin"), mapping("sales")), Set.of(), Set.of()); } - public void testGetAllRoles() throws Exception { + public void testGetSingleRoleMappingQueryWithReadOnlySuffix() throws Exception { + testGetMappings( + List.of(), + Set.of(mapping("everyone")), + // suffix not stripped for native store query + Set.of("everyone" + READ_ONLY_ROLE_MAPPING_SUFFIX), + // suffix is stripped for cluster state store + Set.of("everyone"), + "everyone" + READ_ONLY_ROLE_MAPPING_SUFFIX + ); + + testGetMappings( + List.of(mapping("everyone")), + Set.of(mapping("everyone")), + // suffix not stripped for native store query + Set.of("everyone" + READ_ONLY_ROLE_MAPPING_SUFFIX, "everyone"), + // suffix is stripped for cluster state store + Set.of("everyone"), + "everyone" + READ_ONLY_ROLE_MAPPING_SUFFIX, + "everyone" + ); + } + + private void testGetMappings( + List expectedNativeMappings, + Set expectedClusterStateMappings, + Set expectedNativeNames, + Set expectedClusterStateNames, + String... names + ) throws InterruptedException, ExecutionException { final PlainActionFuture future = new PlainActionFuture<>(); final GetRoleMappingsRequest request = new GetRoleMappingsRequest(); - request.setNames(Strings.EMPTY_ARRAY); - - final ExpressionRoleMapping mapping1 = mock(ExpressionRoleMapping.class); - final ExpressionRoleMapping mapping2 = mock(ExpressionRoleMapping.class); - final ExpressionRoleMapping mapping3 = mock(ExpressionRoleMapping.class); - result = Arrays.asList(mapping1, mapping2, mapping3); + request.setNames(names); + nativeMappings = expectedNativeMappings; + clusterStateMappings = expectedClusterStateMappings; action.doExecute(mock(Task.class), request, future); + assertThat(future.get(), notNullValue()); + List combined = new ArrayList<>(expectedNativeMappings); + combined.addAll(expectedClusterStateMappings.stream().map(this::expectedClusterStateMapping).collect(Collectors.toSet())); + ExpressionRoleMapping[] actualMappings = future.get().mappings(); + assertThat(actualMappings, arrayContainingInAnyOrder(combined.toArray(new ExpressionRoleMapping[0]))); + assertThat(nativeNamesRef.get(), containsInAnyOrder(expectedNativeNames.toArray(new String[0]))); + assertThat(clusterStateNamesRef.get(), containsInAnyOrder(expectedClusterStateNames.toArray(new String[0]))); + } - final GetRoleMappingsResponse response = future.get(); - assertThat(response, notNullValue()); - assertThat(response.mappings(), arrayContainingInAnyOrder(mapping1, mapping2, mapping3)); - assertThat(namesRef.get(), Matchers.nullValue(Set.class)); + private ExpressionRoleMapping mapping(String name) { + return new ExpressionRoleMapping(name, null, null, null, Map.of(), true); } + private ExpressionRoleMapping expectedClusterStateMapping(ExpressionRoleMapping mapping) { + return new ExpressionRoleMapping( + mapping.getName() + READ_ONLY_ROLE_MAPPING_SUFFIX, + null, + null, + null, + Map.of(READ_ONLY_METADATA_FLAG, true), + true + ); + } } From 08f88662b33bfc41e5adf3a6dd4283e91602ce82 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 11:10:11 +0200 Subject: [PATCH 12/34] Tests and more clean up --- ...vedRoleMappingXContentNameFieldHelper.java | 9 + .../RoleMappingFileSettingsIT.java | 179 +++++++++++++----- .../ClusterStateRoleMappingTranslator.java | 64 +++++++ .../TransportGetRoleMappingsAction.java | 60 ++---- .../TransportGetRoleMappingsActionTests.java | 16 +- 5 files changed, 235 insertions(+), 93 deletions(-) create mode 100644 x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ClusterStateRoleMappingTranslator.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index df45078418c36..653832e7946d3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -43,6 +43,15 @@ public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping ); } + public static boolean hasFallbackName(ExpressionRoleMapping expressionRoleMapping) { + return expressionRoleMapping.getName().equals(FALLBACK_NAME); + } + + public static boolean removeNameFromMetadata(Map metadata) { + assert metadata instanceof HashMap; + return metadata.remove(METADATA_NAME_FIELD) != null; + } + public static ExpressionRoleMapping parseWithNameFromMetadata(XContentParser parser) throws IOException { ExpressionRoleMapping roleMapping = ExpressionRoleMapping.parse(FALLBACK_NAME, parser); return new ExpressionRoleMapping( diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java index 778d88d832887..a15b6ba2f29d1 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java @@ -34,9 +34,11 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingAction; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequestBuilder; +import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingResponse; import org.elasticsearch.xpack.core.security.authc.RealmConfig; import org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; +import org.elasticsearch.xpack.security.action.rolemapping.ClusterStateRoleMappingTranslator; import org.elasticsearch.xpack.security.action.rolemapping.ReservedRoleMappingAction; import org.junit.After; @@ -59,11 +61,9 @@ import static org.elasticsearch.xcontent.XContentType.JSON; import static org.elasticsearch.xpack.core.security.test.TestRestrictedIndices.INTERNAL_SECURITY_MAIN_INDEX_7; import static org.hamcrest.Matchers.allOf; -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.emptyArray; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.notNullValue; @@ -148,6 +148,15 @@ public class RoleMappingFileSettingsIT extends NativeRealmIntegTestCase { } }"""; + @Override + protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { + Settings.Builder builder = Settings.builder() + .put(super.nodeSettings(nodeOrdinal, otherSettings)) + // some tests make use of cluster-state based role mappings + .put("xpack.security.authc.cluster_state_role_mappings.enabled", true); + return builder.build(); + } + @After public void cleanUp() { updateClusterSettings(Settings.builder().putNull("indices.recovery.max_bytes_per_sec")); @@ -261,21 +270,28 @@ private void assertRoleMappingsSaveOK(CountDownLatch savedClusterState, AtomicLo assertThat(resolveRolesFuture.get(), containsInAnyOrder("kibana_user", "fleet_user")); } - // the role mappings are not retrievable by the role mapping action (which only accesses "native" i.e. index-based role mappings) - var request = new GetRoleMappingsRequest(); - request.setNames("everyone_kibana", "everyone_fleet"); - var response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); - assertFalse(response.hasMappings()); - assertThat(response.mappings(), emptyArray()); - - // role mappings (with the same names) can also be stored in the "native" store - var putRoleMappingResponse = client().execute(PutRoleMappingAction.INSTANCE, sampleRestRequest("everyone_kibana")).actionGet(); - assertTrue(putRoleMappingResponse.isCreated()); - putRoleMappingResponse = client().execute(PutRoleMappingAction.INSTANCE, sampleRestRequest("everyone_fleet")).actionGet(); - assertTrue(putRoleMappingResponse.isCreated()); + // the role mappings are retrievable by the role mapping action for BWC + assertGetResponseHasMappings(true, "everyone_kibana", "everyone_fleet"); + + // role mappings (with the same names) can be stored in the "native" store + { + PutRoleMappingResponse response = client().execute(PutRoleMappingAction.INSTANCE, sampleRestRequest("everyone_kibana")) + .actionGet(); + assertTrue(response.isCreated()); + response = client().execute(PutRoleMappingAction.INSTANCE, sampleRestRequest("everyone_fleet")).actionGet(); + assertTrue(response.isCreated()); + } + { + // deleting role mappings that exist in the native store and in cluster-state should result in success + var response = client().execute(DeleteRoleMappingAction.INSTANCE, deleteRequest("everyone_kibana")).actionGet(); + assertTrue(response.isFound()); + response = client().execute(DeleteRoleMappingAction.INSTANCE, deleteRequest("everyone_fleet")).actionGet(); + assertTrue(response.isFound()); + } + } - public void testRoleMappingsApplied() throws Exception { + public void testClusterStateRoleMappingsAddedThenDeleted() throws Exception { ensureGreen(); var savedClusterState = setupClusterStateListener(internalCluster().getMasterName(), "everyone_kibana"); @@ -284,6 +300,12 @@ public void testRoleMappingsApplied() throws Exception { assertRoleMappingsSaveOK(savedClusterState.v1(), savedClusterState.v2()); logger.info("---> cleanup cluster settings..."); + { + // Deleting non-existent native role mappings returns not found even if they exist in config file + var response = client().execute(DeleteRoleMappingAction.INSTANCE, deleteRequest("everyone_kibana")).get(); + assertFalse(response.isFound()); + } + savedClusterState = setupClusterStateListenerForCleanup(internalCluster().getMasterName()); writeJSONFile(internalCluster().getMasterName(), emptyJSON, logger, versionCounter); @@ -298,48 +320,97 @@ public void testRoleMappingsApplied() throws Exception { clusterStateResponse.getState().metadata().persistentSettings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()) ); - // native role mappings are not affected by the removal of the cluster-state based ones + // cluster-state role mapping was removed and is not returned in the API anymore { var request = new GetRoleMappingsRequest(); request.setNames("everyone_kibana", "everyone_fleet"); var response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); - assertTrue(response.hasMappings()); - assertThat( - Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), - containsInAnyOrder("everyone_kibana", "everyone_fleet") - ); + assertFalse(response.hasMappings()); } - // and roles are resolved based on the native role mappings + // no role mappings means no roles are resolved for (UserRoleMapper userRoleMapper : internalCluster().getInstances(UserRoleMapper.class)) { PlainActionFuture> resolveRolesFuture = new PlainActionFuture<>(); userRoleMapper.resolveRoles( new UserRoleMapper.UserData("anyUsername", null, List.of(), Map.of(), mock(RealmConfig.class)), resolveRolesFuture ); - assertThat(resolveRolesFuture.get(), contains("kibana_user_native")); + assertThat(resolveRolesFuture.get(), empty()); } + } - { - var request = new DeleteRoleMappingRequest(); - request.setName("everyone_kibana"); - var response = client().execute(DeleteRoleMappingAction.INSTANCE, request).get(); - assertTrue(response.isFound()); - request = new DeleteRoleMappingRequest(); - request.setName("everyone_fleet"); - response = client().execute(DeleteRoleMappingAction.INSTANCE, request).get(); - assertTrue(response.isFound()); + public void testGetRoleMappings() throws Exception { + ensureGreen(); + + final List nativeMappings = List.of("everyone_kibana", "_everyone_kibana", "zzz_mapping", "123_mapping"); + for (var mapping : nativeMappings) { + client().execute(PutRoleMappingAction.INSTANCE, sampleRestRequest(mapping)).actionGet(); } - // no roles are resolved now, because both native and cluster-state based stores have been cleared - for (UserRoleMapper userRoleMapper : internalCluster().getInstances(UserRoleMapper.class)) { - PlainActionFuture> resolveRolesFuture = new PlainActionFuture<>(); - userRoleMapper.resolveRoles( - new UserRoleMapper.UserData("anyUsername", null, List.of(), Map.of(), mock(RealmConfig.class)), - resolveRolesFuture - ); - assertThat(resolveRolesFuture.get(), empty()); + var savedClusterState = setupClusterStateListener(internalCluster().getMasterName(), "everyone_kibana"); + writeJSONFile(internalCluster().getMasterName(), testJSON, logger, versionCounter); + boolean awaitSuccessful = savedClusterState.v1().await(20, TimeUnit.SECONDS); + assertTrue(awaitSuccessful); + + var request = new GetRoleMappingsRequest(); + var response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); + assertTrue(response.hasMappings()); + assertThat( + Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), + containsInAnyOrder( + "everyone_kibana", + ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana"), + "_everyone_kibana", + ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_fleet"), + "zzz_mapping", + "123_mapping" + ) + ); + + int readOnlyCount = 0; + // assert that cluster-state role mappings come last + for (ExpressionRoleMapping mapping : response.mappings()) { + readOnlyCount = ClusterStateRoleMappingTranslator.hasReservedReadOnlySuffix(mapping.getName()) + ? readOnlyCount + 1 + : readOnlyCount; } + // Two sourced from cluster-state + assertEquals(readOnlyCount, 2); + + // it's possible to delete overlapping native role mapping + assertTrue(client().execute(DeleteRoleMappingAction.INSTANCE, deleteRequest("everyone_kibana")).actionGet().isFound()); + + // Fetch a specific file based role + request = new GetRoleMappingsRequest(); + request.setNames(ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")); + response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); + assertTrue(response.hasMappings()); + assertThat( + Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), + containsInAnyOrder(ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")) + ); + + savedClusterState = setupClusterStateListenerForCleanup(internalCluster().getMasterName()); + writeJSONFile(internalCluster().getMasterName(), emptyJSON, logger, versionCounter); + awaitSuccessful = savedClusterState.v1().await(20, TimeUnit.SECONDS); + assertTrue(awaitSuccessful); + + final ClusterStateResponse clusterStateResponse = clusterAdmin().state( + new ClusterStateRequest(TEST_REQUEST_TIMEOUT).waitForMetadataVersion(savedClusterState.v2().get()) + ).get(); + + assertNull( + clusterStateResponse.getState().metadata().persistentSettings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()) + ); + + // Make sure remaining native mappings can still be fetched + request = new GetRoleMappingsRequest(); + response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); + assertTrue(response.hasMappings()); + assertThat( + Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), + containsInAnyOrder("_everyone_kibana", "zzz_mapping", "123_mapping") + ); } public static Tuple setupClusterStateListenerForError( @@ -424,11 +495,8 @@ public void testRoleMappingApplyWithSecurityIndexClosed() throws Exception { boolean awaitSuccessful = savedClusterState.v1().await(20, TimeUnit.SECONDS); assertTrue(awaitSuccessful); - // no native role mappings exist - var request = new GetRoleMappingsRequest(); - request.setNames("everyone_kibana", "everyone_fleet"); - var response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); - assertFalse(response.hasMappings()); + // even if index is closed, cluster-state role mappings are still returned + assertGetResponseHasMappings(true, "everyone_kibana", "everyone_fleet"); // cluster state settings are also applied var clusterStateResponse = clusterAdmin().state( @@ -467,6 +535,12 @@ public void testRoleMappingApplyWithSecurityIndexClosed() throws Exception { } } + private DeleteRoleMappingRequest deleteRequest(String name) { + var request = new DeleteRoleMappingRequest(); + request.setName(name); + return request; + } + private PutRoleMappingRequest sampleRestRequest(String name) throws Exception { var json = """ { @@ -485,4 +559,19 @@ private PutRoleMappingRequest sampleRestRequest(String name) throws Exception { return new PutRoleMappingRequestBuilder(null).source(name, parser).request(); } } + + private static void assertGetResponseHasMappings(boolean readOnly, String... mappings) throws InterruptedException, ExecutionException { + var request = new GetRoleMappingsRequest(); + request.setNames(mappings); + var response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); + assertTrue(response.hasMappings()); + assertThat( + Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), + containsInAnyOrder( + Arrays.stream(mappings) + .map(mapping -> readOnly ? ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix(mapping) : mapping) + .toArray(String[]::new) + ) + ); + } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ClusterStateRoleMappingTranslator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ClusterStateRoleMappingTranslator.java new file mode 100644 index 0000000000000..597d0df921d61 --- /dev/null +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ClusterStateRoleMappingTranslator.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.security.action.rolemapping; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class ClusterStateRoleMappingTranslator { + private static final Logger logger = LogManager.getLogger(ClusterStateRoleMappingTranslator.class); + + static final String READ_ONLY_ROLE_MAPPING_SUFFIX = " (read only)"; + static final String READ_ONLY_METADATA_FLAG = "_read_only"; + + static ExpressionRoleMapping translate(ExpressionRoleMapping mapping) { + Map metadata = new HashMap<>(mapping.getMetadata()); + if (metadata.put(READ_ONLY_METADATA_FLAG, true) != null) { + logger.error( + "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + + "Please rename this field in your role mapping configuration.", + READ_ONLY_METADATA_FLAG + ); + } + ReservedRoleMappingXContentNameFieldHelper.removeNameFromMetadata(metadata); + return new ExpressionRoleMapping( + withReservedReadOnlySuffix(mapping.getName()), + mapping.getExpression(), + mapping.getRoles(), + mapping.getRoleTemplates(), + metadata, + mapping.isEnabled() + ); + } + + public static boolean hasReservedReadOnlySuffix(String name) { + return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX); + } + + public static String withReservedReadOnlySuffix(String name) { + return name + READ_ONLY_ROLE_MAPPING_SUFFIX; + } + + public static Set removeReservedReadOnlySuffix(Set names) { + return names.stream().map(ClusterStateRoleMappingTranslator::removeReservedReadOnlySuffix).collect(Collectors.toSet()); + } + + public static String removeReservedReadOnlySuffix(String name) { + if (name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX)) { + return name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()); + } + return name; + } +} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java index 6835b3374e161..efb8a25f65d56 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java @@ -25,19 +25,13 @@ import java.util.Arrays; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; -import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; import java.util.stream.Stream; public class TransportGetRoleMappingsAction extends HandledTransportAction { private static final Logger logger = LogManager.getLogger(TransportGetRoleMappingsAction.class); - static final String READ_ONLY_ROLE_MAPPING_SUFFIX = " (read only)"; - static final String READ_ONLY_METADATA_FLAG = "_read_only"; - private final NativeRoleMappingStore roleMappingStore; private final ClusterStateRoleMapper clusterStateRoleMapper; @@ -71,54 +65,28 @@ protected void doExecute(Task task, final GetRoleMappingsRequest request, final final Collection clusterStateRoleMappings = clusterStateRoleMapper.getMappings( // if the API was queried with a reserved suffix for any of the names, we need to remove it because role mappings are // stored without it in cluster-state - removeReservedSuffix(names) + ClusterStateRoleMappingTranslator.removeReservedReadOnlySuffix(names) ); listener.onResponse(buildResponse(clusterStateRoleMappings, nativeRoleMappings)); }, listener::onFailure)); } private GetRoleMappingsResponse buildResponse( - Collection clusterStateRoleMappings, - Collection nativeRoleMappings + Collection clusterStateMappings, + Collection nativeMappings ) { + Stream translatedClusterStateMappings = clusterStateMappings.stream().filter(roleMapping -> { + if (ReservedRoleMappingXContentNameFieldHelper.hasFallbackName(roleMapping)) { + logger.warn( + "Role mapping retrieved from cluster-state with an ambiguous name. It will be omitted from the API response." + + "This is likely a transient issue during node start-up." + ); + return false; + } + return true; + }).map(ClusterStateRoleMappingTranslator::translate); return new GetRoleMappingsResponse( - Stream.concat(nativeRoleMappings.stream(), clusterStateRoleMappings.stream().map(this::toResponseModel)) - .toArray(ExpressionRoleMapping[]::new) + Stream.concat(nativeMappings.stream(), translatedClusterStateMappings).toArray(ExpressionRoleMapping[]::new) ); } - - private ExpressionRoleMapping toResponseModel(ExpressionRoleMapping mapping) { - Map metadata = new HashMap<>(mapping.getMetadata()); - metadata.remove(ReservedRoleMappingXContentNameFieldHelper.METADATA_NAME_FIELD); - if (metadata.put(READ_ONLY_METADATA_FLAG, true) != null) { - logger.error( - "Metadata field [{}] is reserved and will be overwritten with an internal system value. " - + "Please rename this field in your role mapping configuration.", - READ_ONLY_METADATA_FLAG - ); - } - return new ExpressionRoleMapping( - addReservedSuffix(mapping), - mapping.getExpression(), - mapping.getRoles(), - mapping.getRoleTemplates(), - metadata, - mapping.isEnabled() - ); - } - - private String addReservedSuffix(ExpressionRoleMapping mapping) { - return mapping.getName() + READ_ONLY_ROLE_MAPPING_SUFFIX; - } - - private Set removeReservedSuffix(Set names) { - return names.stream().map(this::removeReservedSuffix).collect(Collectors.toSet()); - } - - private String removeReservedSuffix(String name) { - if (name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX)) { - return name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()); - } - return name; - } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index 57a8b7f0c0fe3..393fb0f673505 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -31,8 +31,8 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.security.action.rolemapping.TransportGetRoleMappingsAction.READ_ONLY_METADATA_FLAG; -import static org.elasticsearch.xpack.security.action.rolemapping.TransportGetRoleMappingsAction.READ_ONLY_ROLE_MAPPING_SUFFIX; +import static org.elasticsearch.xpack.security.action.rolemapping.ClusterStateRoleMappingTranslator.READ_ONLY_METADATA_FLAG; +import static org.elasticsearch.xpack.security.action.rolemapping.ClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_SUFFIX; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.notNullValue; @@ -173,6 +173,18 @@ public void testGetSingleRoleMappingQueryWithReadOnlySuffix() throws Exception { "everyone" + READ_ONLY_ROLE_MAPPING_SUFFIX ); + testGetMappings( + List.of(), + Set.of(mapping("everyone(read only)")), + // suffix not stripped for native store query + Set.of("everyone(read only)", "everyone(read only)more", "everyone(read only) "), + // suffix that is similar but not the same is not stripped + Set.of("everyone(read only)", "everyone(read only)more", "everyone(read only) "), + "everyone(read only)", + "everyone(read only)more", + "everyone(read only) " + ); + testGetMappings( List.of(mapping("everyone")), Set.of(mapping("everyone")), From 7ea2c1bc93603a3f7dfddfcde9bf9ff4b8eca7e3 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 11:13:38 +0200 Subject: [PATCH 13/34] More --- .../security/authc/support/mapper/ClusterStateRoleMapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java index ed18f5c218fd7..ab5a6e096dd64 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java @@ -32,9 +32,9 @@ */ public class ClusterStateRoleMapper extends AbstractRoleMapperClearRealmCache implements ClusterStateListener { /** - * This setting is never registered by the xpack security plugin - in order to enable the + * This setting is never registered by the xpack security plugin - in order to disable the * cluster-state based role mapper another plugin must register it as a boolean setting - * and set it to `true`. + * and set it to `false`. * If this setting is set to true then: *
      *
    • Realms that make use role mappings (all realms but file and native) will, From 0242b70861e431e3b0e0fa6f4769149168068384 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 11:48:50 +0200 Subject: [PATCH 14/34] More --- .../RoleMappingFileSettingsIT.java | 14 +++---- ...ortClusterStateRoleMappingTranslator.java} | 39 ++++++++++++++----- .../TransportGetRoleMappingsAction.java | 4 +- .../TransportGetRoleMappingsActionTests.java | 6 +-- 4 files changed, 41 insertions(+), 22 deletions(-) rename x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/{ClusterStateRoleMappingTranslator.java => TransportClusterStateRoleMappingTranslator.java} (53%) diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java index a15b6ba2f29d1..0d2762894c568 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java @@ -38,8 +38,8 @@ import org.elasticsearch.xpack.core.security.authc.RealmConfig; import org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; -import org.elasticsearch.xpack.security.action.rolemapping.ClusterStateRoleMappingTranslator; import org.elasticsearch.xpack.security.action.rolemapping.ReservedRoleMappingAction; +import org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator; import org.junit.After; import java.io.ByteArrayInputStream; @@ -359,9 +359,9 @@ public void testGetRoleMappings() throws Exception { Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), containsInAnyOrder( "everyone_kibana", - ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana"), + TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana"), "_everyone_kibana", - ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_fleet"), + TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_fleet"), "zzz_mapping", "123_mapping" ) @@ -370,7 +370,7 @@ public void testGetRoleMappings() throws Exception { int readOnlyCount = 0; // assert that cluster-state role mappings come last for (ExpressionRoleMapping mapping : response.mappings()) { - readOnlyCount = ClusterStateRoleMappingTranslator.hasReservedReadOnlySuffix(mapping.getName()) + readOnlyCount = TransportClusterStateRoleMappingTranslator.hasReservedReadOnlySuffix(mapping.getName()) ? readOnlyCount + 1 : readOnlyCount; } @@ -382,12 +382,12 @@ public void testGetRoleMappings() throws Exception { // Fetch a specific file based role request = new GetRoleMappingsRequest(); - request.setNames(ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")); + request.setNames(TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")); response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); assertTrue(response.hasMappings()); assertThat( Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), - containsInAnyOrder(ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")) + containsInAnyOrder(TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")) ); savedClusterState = setupClusterStateListenerForCleanup(internalCluster().getMasterName()); @@ -569,7 +569,7 @@ private static void assertGetResponseHasMappings(boolean readOnly, String... map Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), containsInAnyOrder( Arrays.stream(mappings) - .map(mapping -> readOnly ? ClusterStateRoleMappingTranslator.withReservedReadOnlySuffix(mapping) : mapping) + .map(mapping -> readOnly ? TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix(mapping) : mapping) .toArray(String[]::new) ) ); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ClusterStateRoleMappingTranslator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java similarity index 53% rename from x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ClusterStateRoleMappingTranslator.java rename to x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java index 597d0df921d61..404ceb1be8093 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ClusterStateRoleMappingTranslator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java @@ -17,19 +17,39 @@ import java.util.Set; import java.util.stream.Collectors; -public class ClusterStateRoleMappingTranslator { - private static final Logger logger = LogManager.getLogger(ClusterStateRoleMappingTranslator.class); +/** + * Translator class for ensuring unique API names and marking cluster-state role mappings as read-only. + * Role mappings retrieved from cluster-state are surfaced through both the transport and REST layers, + * along with native role mappings. Unlike native role mappings, cluster-state role mappings are + * read-only and cannot be modified via APIs. It is possible for cluster-state and native role mappings + * to have overlapping names. + *

      + * + *

      + * This class handles the following responsibilities to ensure correct processing of cluster-state role mappings: + *

      + * + *
        + *
      1. Appends a reserved suffix to cluster-state role mapping names to avoid conflicts with native role mappings.
      2. + *
      3. Marks the metadata of cluster-state role mappings with a reserved read-only flag.
      4. + *
      5. Removes internal metadata flags used in processing (see {@link ReservedRoleMappingXContentNameFieldHelper}).
      6. + *
      + */ +public final class TransportClusterStateRoleMappingTranslator { + private static final Logger logger = LogManager.getLogger(TransportClusterStateRoleMappingTranslator.class); static final String READ_ONLY_ROLE_MAPPING_SUFFIX = " (read only)"; - static final String READ_ONLY_METADATA_FLAG = "_read_only"; + static final String READ_ONLY_ROLE_MAPPING_METADATA_FLAG = "_read_only"; + + private TransportClusterStateRoleMappingTranslator() {} static ExpressionRoleMapping translate(ExpressionRoleMapping mapping) { Map metadata = new HashMap<>(mapping.getMetadata()); - if (metadata.put(READ_ONLY_METADATA_FLAG, true) != null) { + if (metadata.put(READ_ONLY_ROLE_MAPPING_METADATA_FLAG, true) != null) { logger.error( "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + "Please rename this field in your role mapping configuration.", - READ_ONLY_METADATA_FLAG + READ_ONLY_ROLE_MAPPING_METADATA_FLAG ); } ReservedRoleMappingXContentNameFieldHelper.removeNameFromMetadata(metadata); @@ -52,13 +72,12 @@ public static String withReservedReadOnlySuffix(String name) { } public static Set removeReservedReadOnlySuffix(Set names) { - return names.stream().map(ClusterStateRoleMappingTranslator::removeReservedReadOnlySuffix).collect(Collectors.toSet()); + return names.stream().map(TransportClusterStateRoleMappingTranslator::removeReservedReadOnlySuffix).collect(Collectors.toSet()); } public static String removeReservedReadOnlySuffix(String name) { - if (name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX)) { - return name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()); - } - return name; + return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX) + ? name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()) + : name; } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java index efb8a25f65d56..e54586b1b594e 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java @@ -65,7 +65,7 @@ protected void doExecute(Task task, final GetRoleMappingsRequest request, final final Collection clusterStateRoleMappings = clusterStateRoleMapper.getMappings( // if the API was queried with a reserved suffix for any of the names, we need to remove it because role mappings are // stored without it in cluster-state - ClusterStateRoleMappingTranslator.removeReservedReadOnlySuffix(names) + TransportClusterStateRoleMappingTranslator.removeReservedReadOnlySuffix(names) ); listener.onResponse(buildResponse(clusterStateRoleMappings, nativeRoleMappings)); }, listener::onFailure)); @@ -84,7 +84,7 @@ private GetRoleMappingsResponse buildResponse( return false; } return true; - }).map(ClusterStateRoleMappingTranslator::translate); + }).map(TransportClusterStateRoleMappingTranslator::translate); return new GetRoleMappingsResponse( Stream.concat(nativeMappings.stream(), translatedClusterStateMappings).toArray(ExpressionRoleMapping[]::new) ); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index 393fb0f673505..263fdff5755be 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -31,8 +31,8 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.security.action.rolemapping.ClusterStateRoleMappingTranslator.READ_ONLY_METADATA_FLAG; -import static org.elasticsearch.xpack.security.action.rolemapping.ClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_SUFFIX; +import static org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_METADATA_FLAG; +import static org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_SUFFIX; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.notNullValue; @@ -230,7 +230,7 @@ private ExpressionRoleMapping expectedClusterStateMapping(ExpressionRoleMapping null, null, null, - Map.of(READ_ONLY_METADATA_FLAG, true), + Map.of(READ_ONLY_ROLE_MAPPING_METADATA_FLAG, true), true ); } From 4519ddd586ba06696dc999d2b3217e3f70348594 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 12:00:29 +0200 Subject: [PATCH 15/34] Javadoc --- .../rolemapping/TransportClusterStateRoleMappingTranslator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java index 404ceb1be8093..71d706b2f15e8 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java @@ -23,7 +23,6 @@ * along with native role mappings. Unlike native role mappings, cluster-state role mappings are * read-only and cannot be modified via APIs. It is possible for cluster-state and native role mappings * to have overlapping names. - *

      * *

      * This class handles the following responsibilities to ensure correct processing of cluster-state role mappings: From 5fb90deb5d25f02b1d385a2e56687dbade12b8f1 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 12:11:43 +0200 Subject: [PATCH 16/34] Test fallback --- ...vedRoleMappingXContentNameFieldHelper.java | 4 +- .../TransportGetRoleMappingsActionTests.java | 48 +++++++++++++++++-- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index 653832e7946d3..958f4e5360c3c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -47,9 +47,9 @@ public static boolean hasFallbackName(ExpressionRoleMapping expressionRoleMappin return expressionRoleMapping.getName().equals(FALLBACK_NAME); } - public static boolean removeNameFromMetadata(Map metadata) { + public static void removeNameFromMetadata(Map metadata) { assert metadata instanceof HashMap; - return metadata.remove(METADATA_NAME_FIELD) != null; + metadata.remove(METADATA_NAME_FIELD); } public static ExpressionRoleMapping parseWithNameFromMetadata(XContentParser parser) throws IOException { diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index 263fdff5755be..3ba3fd12198f2 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -197,8 +197,46 @@ public void testGetSingleRoleMappingQueryWithReadOnlySuffix() throws Exception { ); } + public void testClusterStateRoleMappingWithFallbackNameOmitted() throws ExecutionException, InterruptedException { + testGetMappings( + List.of(), + Set.of(mapping("name_not_available_after_deserialization")), + Set.of(), + Set.of("name_not_available_after_deserialization"), + Set.of("name_not_available_after_deserialization"), + "name_not_available_after_deserialization" + ); + + testGetMappings( + List.of(mapping("name_not_available_after_deserialization")), + Set.of(mapping("name_not_available_after_deserialization")), + Set.of(), + Set.of("name_not_available_after_deserialization"), + Set.of("name_not_available_after_deserialization"), + "name_not_available_after_deserialization" + ); + } + + private void testGetMappings( + List returnedNativeMappings, + Set returnedClusterStateMappings, + Set expectedNativeNames, + Set expectedClusterStateNames, + String... names + ) throws InterruptedException, ExecutionException { + testGetMappings( + returnedNativeMappings, + returnedClusterStateMappings, + returnedClusterStateMappings.stream().map(this::expectedClusterStateMapping).collect(Collectors.toSet()), + expectedNativeNames, + expectedClusterStateNames, + names + ); + } + private void testGetMappings( - List expectedNativeMappings, + List returnedNativeMappings, + Set returnedClusterStateMappings, Set expectedClusterStateMappings, Set expectedNativeNames, Set expectedClusterStateNames, @@ -208,12 +246,12 @@ private void testGetMappings( final GetRoleMappingsRequest request = new GetRoleMappingsRequest(); request.setNames(names); - nativeMappings = expectedNativeMappings; - clusterStateMappings = expectedClusterStateMappings; + nativeMappings = returnedNativeMappings; + clusterStateMappings = returnedClusterStateMappings; action.doExecute(mock(Task.class), request, future); assertThat(future.get(), notNullValue()); - List combined = new ArrayList<>(expectedNativeMappings); - combined.addAll(expectedClusterStateMappings.stream().map(this::expectedClusterStateMapping).collect(Collectors.toSet())); + List combined = new ArrayList<>(returnedNativeMappings); + combined.addAll(expectedClusterStateMappings); ExpressionRoleMapping[] actualMappings = future.get().mappings(); assertThat(actualMappings, arrayContainingInAnyOrder(combined.toArray(new ExpressionRoleMapping[0]))); assertThat(nativeNamesRef.get(), containsInAnyOrder(expectedNativeNames.toArray(new String[0]))); From fd3cb5a63d2a40c884d443f61191f935fac23160 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 12:50:33 +0200 Subject: [PATCH 17/34] Header warnings --- .../RoleMappingFileSettingsIT.java | 12 +++--- ...portClusterStateRoleMappingTranslator.java | 20 ++++++--- .../TransportDeleteRoleMappingAction.java | 25 ++++++++++- .../TransportGetRoleMappingsAction.java | 2 +- .../TransportPutRoleMappingAction.java | 20 ++++++++- .../TransportPutRoleMappingActionTests.java | 43 ++++++++++++++++++- 6 files changed, 105 insertions(+), 17 deletions(-) diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java index 0d2762894c568..9312f74bc5e6a 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java @@ -359,9 +359,9 @@ public void testGetRoleMappings() throws Exception { Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), containsInAnyOrder( "everyone_kibana", - TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana"), + TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_kibana"), "_everyone_kibana", - TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_fleet"), + TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_fleet"), "zzz_mapping", "123_mapping" ) @@ -370,7 +370,7 @@ public void testGetRoleMappings() throws Exception { int readOnlyCount = 0; // assert that cluster-state role mappings come last for (ExpressionRoleMapping mapping : response.mappings()) { - readOnlyCount = TransportClusterStateRoleMappingTranslator.hasReservedReadOnlySuffix(mapping.getName()) + readOnlyCount = TransportClusterStateRoleMappingTranslator.hasReadOnlySuffix(mapping.getName()) ? readOnlyCount + 1 : readOnlyCount; } @@ -382,12 +382,12 @@ public void testGetRoleMappings() throws Exception { // Fetch a specific file based role request = new GetRoleMappingsRequest(); - request.setNames(TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")); + request.setNames(TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_kibana")); response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); assertTrue(response.hasMappings()); assertThat( Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), - containsInAnyOrder(TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix("everyone_kibana")) + containsInAnyOrder(TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_kibana")) ); savedClusterState = setupClusterStateListenerForCleanup(internalCluster().getMasterName()); @@ -569,7 +569,7 @@ private static void assertGetResponseHasMappings(boolean readOnly, String... map Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), containsInAnyOrder( Arrays.stream(mappings) - .map(mapping -> readOnly ? TransportClusterStateRoleMappingTranslator.withReservedReadOnlySuffix(mapping) : mapping) + .map(mapping -> readOnly ? TransportClusterStateRoleMappingTranslator.addReadOnlySuffix(mapping) : mapping) .toArray(String[]::new) ) ); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java index 71d706b2f15e8..579cbf5384577 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java @@ -53,7 +53,7 @@ static ExpressionRoleMapping translate(ExpressionRoleMapping mapping) { } ReservedRoleMappingXContentNameFieldHelper.removeNameFromMetadata(metadata); return new ExpressionRoleMapping( - withReservedReadOnlySuffix(mapping.getName()), + addReadOnlySuffix(mapping.getName()), mapping.getExpression(), mapping.getRoles(), mapping.getRoleTemplates(), @@ -62,19 +62,27 @@ static ExpressionRoleMapping translate(ExpressionRoleMapping mapping) { ); } - public static boolean hasReservedReadOnlySuffix(String name) { + public static boolean hasReadOnlySuffix(String name) { return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX); } - public static String withReservedReadOnlySuffix(String name) { + public static void validateNoReadOnlySuffix(String name) { + if (hasReadOnlySuffix(name)) { + throw new IllegalArgumentException( + "Invalid mapping name [" + name + "]. [" + READ_ONLY_ROLE_MAPPING_SUFFIX + "] is not an allowed suffix" + ); + } + } + + public static String addReadOnlySuffix(String name) { return name + READ_ONLY_ROLE_MAPPING_SUFFIX; } - public static Set removeReservedReadOnlySuffix(Set names) { - return names.stream().map(TransportClusterStateRoleMappingTranslator::removeReservedReadOnlySuffix).collect(Collectors.toSet()); + public static Set removeReadOnlySuffixIfPresent(Set names) { + return names.stream().map(TransportClusterStateRoleMappingTranslator::removeReadOnlySuffixIfPresent).collect(Collectors.toSet()); } - public static String removeReservedReadOnlySuffix(String name) { + public static String removeReadOnlySuffixIfPresent(String name) { return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX) ? name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()) : name; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java index 74129facae70a..f7d527e088f41 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java @@ -9,6 +9,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; +import org.elasticsearch.common.logging.HeaderWarning; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.injection.guice.Inject; import org.elasticsearch.tasks.Task; @@ -16,17 +17,20 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.DeleteRoleMappingAction; import org.elasticsearch.xpack.core.security.action.rolemapping.DeleteRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.DeleteRoleMappingResponse; +import org.elasticsearch.xpack.security.authc.support.mapper.ClusterStateRoleMapper; import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; public class TransportDeleteRoleMappingAction extends HandledTransportAction { private final NativeRoleMappingStore roleMappingStore; + private final ClusterStateRoleMapper clusterStateRoleMapper; @Inject public TransportDeleteRoleMappingAction( ActionFilters actionFilters, TransportService transportService, - NativeRoleMappingStore roleMappingStore + NativeRoleMappingStore roleMappingStore, + ClusterStateRoleMapper clusterStateRoleMapper ) { super( DeleteRoleMappingAction.NAME, @@ -36,10 +40,27 @@ public TransportDeleteRoleMappingAction( EsExecutors.DIRECT_EXECUTOR_SERVICE ); this.roleMappingStore = roleMappingStore; + this.clusterStateRoleMapper = clusterStateRoleMapper; } @Override protected void doExecute(Task task, DeleteRoleMappingRequest request, ActionListener listener) { - roleMappingStore.deleteRoleMapping(request, listener.safeMap(DeleteRoleMappingResponse::new)); + roleMappingStore.deleteRoleMapping(request, listener.safeMap(found -> { + if (found && hasClusterStateMappingWithSameName(request.getName())) { + // Allow to delete a mapping with the same name in the native role mapping store as the file_settings namespace, but + // add a warning header to signal to the caller that this could be a problem. + HeaderWarning.addWarning( + "A read only role mapping with the same name [" + + request.getName() + + "] has previously been defined in a configuration file. " + + "The read only role mapping will not be deleted and will remain active." + ); + } + return new DeleteRoleMappingResponse(found); + })); + } + + private boolean hasClusterStateMappingWithSameName(String name) { + return clusterStateRoleMapper.hasMapping(TransportClusterStateRoleMappingTranslator.removeReadOnlySuffixIfPresent(name)); } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java index e54586b1b594e..641a68dc1c83f 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java @@ -65,7 +65,7 @@ protected void doExecute(Task task, final GetRoleMappingsRequest request, final final Collection clusterStateRoleMappings = clusterStateRoleMapper.getMappings( // if the API was queried with a reserved suffix for any of the names, we need to remove it because role mappings are // stored without it in cluster-state - TransportClusterStateRoleMappingTranslator.removeReservedReadOnlySuffix(names) + TransportClusterStateRoleMappingTranslator.removeReadOnlySuffixIfPresent(names) ); listener.onResponse(buildResponse(clusterStateRoleMappings, nativeRoleMappings)); }, listener::onFailure)); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java index 82a3b4f000064..0961ecad325db 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java @@ -9,6 +9,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; +import org.elasticsearch.common.logging.HeaderWarning; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.injection.guice.Inject; import org.elasticsearch.tasks.Task; @@ -16,24 +17,41 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingAction; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingResponse; +import org.elasticsearch.xpack.security.authc.support.mapper.ClusterStateRoleMapper; import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; +import static org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator.validateNoReadOnlySuffix; + public class TransportPutRoleMappingAction extends HandledTransportAction { private final NativeRoleMappingStore roleMappingStore; + private final ClusterStateRoleMapper clusterStateRoleMapper; @Inject public TransportPutRoleMappingAction( ActionFilters actionFilters, TransportService transportService, - NativeRoleMappingStore roleMappingStore + NativeRoleMappingStore roleMappingStore, + ClusterStateRoleMapper clusterStateRoleMapper ) { super(PutRoleMappingAction.NAME, transportService, actionFilters, PutRoleMappingRequest::new, EsExecutors.DIRECT_EXECUTOR_SERVICE); this.roleMappingStore = roleMappingStore; + this.clusterStateRoleMapper = clusterStateRoleMapper; } @Override protected void doExecute(Task task, final PutRoleMappingRequest request, final ActionListener listener) { + validateNoReadOnlySuffix(request.getName()); + if (clusterStateRoleMapper.hasMapping(request.getName())) { + // Allow to define a mapping with the same name in the native role mapping store as the file_settings namespace, but add a + // warning header to signal to the caller that this could be a problem. + HeaderWarning.addWarning( + "A read only role mapping with the same name [" + + request.getName() + + "] has been previously defined in a configuration file. " + + "Both role mappings will be used to determine role assignments." + ); + } roleMappingStore.putRoleMapping( request, ActionListener.wrap(created -> listener.onResponse(new PutRoleMappingResponse(created)), listener::onFailure) diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java index 6f789a10a3a6c..cb830887d102b 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java @@ -19,6 +19,7 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingResponse; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.FieldExpression; +import org.elasticsearch.xpack.security.authc.support.mapper.ClusterStateRoleMapper; import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; import org.junit.Before; @@ -29,18 +30,21 @@ import static org.hamcrest.Matchers.aMapWithSize; import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.iterableWithSize; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class TransportPutRoleMappingActionTests extends ESTestCase { private NativeRoleMappingStore store; private TransportPutRoleMappingAction action; private AtomicReference requestRef; + private ClusterStateRoleMapper clusterStateRoleMapper; @SuppressWarnings("unchecked") @Before @@ -55,7 +59,9 @@ public void setupMocks() { null, Collections.emptySet() ); - action = new TransportPutRoleMappingAction(mock(ActionFilters.class), transportService, store); + clusterStateRoleMapper = mock(); + when(clusterStateRoleMapper.hasMapping(any())).thenReturn(false); + action = new TransportPutRoleMappingAction(mock(ActionFilters.class), transportService, store, clusterStateRoleMapper); requestRef = new AtomicReference<>(null); @@ -85,6 +91,41 @@ public void testPutValidMapping() throws Exception { assertThat(mapping.getMetadata().get("dumb"), equalTo(true)); } + public void testValidMappingClashingClusterStateMapping() throws Exception { + final FieldExpression expression = new FieldExpression("username", Collections.singletonList(new FieldExpression.FieldValue("*"))); + final PutRoleMappingResponse response = put("anarchy", expression, "superuser", Collections.singletonMap("dumb", true)); + when(clusterStateRoleMapper.hasMapping(any())).thenReturn(true); + + assertThat(response.isCreated(), equalTo(true)); + + final ExpressionRoleMapping mapping = requestRef.get().getMapping(); + assertThat(mapping.getExpression(), is(expression)); + assertThat(mapping.isEnabled(), equalTo(true)); + assertThat(mapping.getName(), equalTo("anarchy")); + assertThat(mapping.getRoles(), iterableWithSize(1)); + assertThat(mapping.getRoles(), contains("superuser")); + assertThat(mapping.getMetadata(), aMapWithSize(1)); + assertThat(mapping.getMetadata().get("dumb"), equalTo(true)); + } + + public void testInvalidSuffix() { + final FieldExpression expression = new FieldExpression("username", Collections.singletonList(new FieldExpression.FieldValue("*"))); + String name = TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("anarchy"); + final var ex = expectThrows(IllegalArgumentException.class, () -> { + put(name, expression, "superuser", Collections.singletonMap("dumb", true)); + }); + assertThat( + ex.getMessage(), + containsString( + "Invalid mapping name [" + + name + + "]. [" + + TransportClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_SUFFIX + + "] is not an allowed suffix" + ) + ); + } + private PutRoleMappingResponse put(String name, FieldExpression expression, String role, Map metadata) throws Exception { final PutRoleMappingRequest request = new PutRoleMappingRequest(); From d79f473c612baa8f7cb1a950b41db2cba933ffe7 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 17:28:12 +0200 Subject: [PATCH 18/34] WIP --- .../SecurityOnTrialLicenseRestTestCase.java | 15 ++++++++----- .../rolemapping/RoleMappingRestIT.java | 22 +++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java index 1abb9bbb067dc..a9a3d67f3d269 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java @@ -19,6 +19,7 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.test.TestSecurityClient; import org.elasticsearch.test.cluster.ElasticsearchCluster; +import org.elasticsearch.test.cluster.local.LocalClusterConfigProvider; import org.elasticsearch.test.cluster.local.distribution.DistributionType; import org.elasticsearch.test.cluster.util.resource.Resource; import org.elasticsearch.test.rest.ESRestTestCase; @@ -41,9 +42,7 @@ public abstract class SecurityOnTrialLicenseRestTestCase extends ESRestTestCase { private TestSecurityClient securityClient; - @ClassRule - public static ElasticsearchCluster cluster = ElasticsearchCluster.local() - .nodes(2) + protected static LocalClusterConfigProvider commonClusterConfig = cluster -> cluster.nodes(2) .distribution(DistributionType.DEFAULT) .setting("xpack.ml.enabled", "false") .setting("xpack.license.self_generated.type", "trial") @@ -62,8 +61,14 @@ public abstract class SecurityOnTrialLicenseRestTestCase extends ESRestTestCase .user("admin_user", "admin-password", ROOT_USER_ROLE, true) .user("security_test_user", "security-test-password", "security_test_role", false) .user("x_pack_rest_user", "x-pack-test-password", ROOT_USER_ROLE, true) - .user("cat_test_user", "cat-test-password", "cat_test_role", false) - .build(); + .user("cat_test_user", "cat-test-password", "cat_test_role", false); + + protected static LocalClusterConfigProvider additionalConfig() { + return cluster -> {}; + } + + @ClassRule + public static ElasticsearchCluster cluster = ElasticsearchCluster.local().apply(commonClusterConfig).apply(additionalConfig()).build(); @Override protected String getTestRestCluster() { diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java new file mode 100644 index 0000000000000..dfe4c3cf05ad2 --- /dev/null +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -0,0 +1,22 @@ +/* + * 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.rolemapping; + +import org.elasticsearch.test.cluster.local.LocalClusterConfigProvider; +import org.elasticsearch.test.cluster.util.resource.Resource; +import org.elasticsearch.xpack.security.SecurityOnTrialLicenseRestTestCase; + +public class RoleMappingRestIT extends SecurityOnTrialLicenseRestTestCase { + + private static final String settingsJson = "{}"; + + protected static LocalClusterConfigProvider additionalConfig() { + return cluster -> cluster.configFile("operator/settings.json", Resource.fromString(settingsJson)); + } + +} From 8ae84922269192dcfbd6e4268859ef28cf5f585c Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Fri, 18 Oct 2024 18:03:22 +0200 Subject: [PATCH 19/34] Spaces too painful --- .../SecurityOnTrialLicenseRestTestCase.java | 8 +- .../rolemapping/RoleMappingRestIT.java | 94 ++++++++++++++++++- ...portClusterStateRoleMappingTranslator.java | 2 +- .../TransportGetRoleMappingsActionTests.java | 13 ++- 4 files changed, 98 insertions(+), 19 deletions(-) diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java index a9a3d67f3d269..523f04fb436f4 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/SecurityOnTrialLicenseRestTestCase.java @@ -42,7 +42,7 @@ public abstract class SecurityOnTrialLicenseRestTestCase extends ESRestTestCase { private TestSecurityClient securityClient; - protected static LocalClusterConfigProvider commonClusterConfig = cluster -> cluster.nodes(2) + public static LocalClusterConfigProvider commonTrialSecurityClusterConfig = cluster -> cluster.nodes(2) .distribution(DistributionType.DEFAULT) .setting("xpack.ml.enabled", "false") .setting("xpack.license.self_generated.type", "trial") @@ -63,12 +63,8 @@ public abstract class SecurityOnTrialLicenseRestTestCase extends ESRestTestCase .user("x_pack_rest_user", "x-pack-test-password", ROOT_USER_ROLE, true) .user("cat_test_user", "cat-test-password", "cat_test_role", false); - protected static LocalClusterConfigProvider additionalConfig() { - return cluster -> {}; - } - @ClassRule - public static ElasticsearchCluster cluster = ElasticsearchCluster.local().apply(commonClusterConfig).apply(additionalConfig()).build(); + public static ElasticsearchCluster cluster = ElasticsearchCluster.local().apply(commonTrialSecurityClusterConfig).build(); @Override protected String getTestRestCluster() { diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index dfe4c3cf05ad2..73919085cf528 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -7,16 +7,100 @@ package org.elasticsearch.xpack.security.rolemapping; -import org.elasticsearch.test.cluster.local.LocalClusterConfigProvider; +import org.elasticsearch.client.Request; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.test.cluster.ElasticsearchCluster; import org.elasticsearch.test.cluster.util.resource.Resource; +import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.security.SecurityOnTrialLicenseRestTestCase; +import org.junit.ClassRule; -public class RoleMappingRestIT extends SecurityOnTrialLicenseRestTestCase { +import java.io.IOException; +import java.util.Map; - private static final String settingsJson = "{}"; +import static org.hamcrest.Matchers.containsInAnyOrder; - protected static LocalClusterConfigProvider additionalConfig() { - return cluster -> cluster.configFile("operator/settings.json", Resource.fromString(settingsJson)); +public class RoleMappingRestIT extends ESRestTestCase { + + private static final String settingsJson = """ + { + "metadata": { + "version": "1", + "compatibility": "8.4.0" + }, + "state": { + "role_mappings": { + "role_mapping_1": { + "enabled": true, + "roles": [ "role_1" ], + "rules": { "field": { "username": "no_user" } }, + "metadata": { + "uuid" : "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", + "_foo": "something" + } + }, + "role_mapping_2": { + "enabled": true, + "roles": [ "role_2" ], + "rules": { "field": { "username": "no_user" } }, + "metadata": { + "uuid" : "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", + "_foo": "something_else" + } + } + } + } + }"""; + + @ClassRule + public static ElasticsearchCluster cluster = ElasticsearchCluster.local() + .apply(SecurityOnTrialLicenseRestTestCase.commonTrialSecurityClusterConfig) + .configFile("operator/settings.json", Resource.fromString(settingsJson)) + .build(); + + @Override + protected String getTestRestCluster() { + return cluster.getHttpAddresses(); + } + + public void testGetRoleMappings() throws IOException { + { + final Map mappings = responseAsMap(client().performRequest(new Request("GET", "/_security/role_mapping"))); + assertThat( + mappings.keySet(), + containsInAnyOrder("role_mapping_1-read-only-operator-config", "role_mapping_2-read-only-operator-config") + ); + } + + { + final Map mappings = responseAsMap( + client().performRequest(new Request("GET", "/_security/role_mapping/role_mapping_1-read-only-operator-config")) + ); + assertThat(mappings.keySet(), containsInAnyOrder("role_mapping_1-read-only-operator-config")); + } + + { + final Map mappings = responseAsMap( + client().performRequest( + new Request("GET", "/_security/role_mapping/role_mapping_1-read-only-operator-config,role_mapping_1") + ) + ); + assertThat(mappings.keySet(), containsInAnyOrder("role_mapping_1-read-only-operator-config")); + } + } + + @Override + protected Settings restAdminSettings() { + String token = basicAuthHeaderValue("admin_user", new SecureString("admin-password".toCharArray())); + return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", token).build(); + } + + @Override + protected Settings restClientSettings() { + String token = basicAuthHeaderValue("admin_user", new SecureString("admin-password".toCharArray())); + return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", token).build(); } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java index 579cbf5384577..13952417e336e 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java @@ -37,7 +37,7 @@ public final class TransportClusterStateRoleMappingTranslator { private static final Logger logger = LogManager.getLogger(TransportClusterStateRoleMappingTranslator.class); - static final String READ_ONLY_ROLE_MAPPING_SUFFIX = " (read only)"; + static final String READ_ONLY_ROLE_MAPPING_SUFFIX = "-read-only-operator-config"; static final String READ_ONLY_ROLE_MAPPING_METADATA_FLAG = "_read_only"; private TransportClusterStateRoleMappingTranslator() {} diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index 3ba3fd12198f2..4c72b9577c3e8 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -175,14 +175,13 @@ public void testGetSingleRoleMappingQueryWithReadOnlySuffix() throws Exception { testGetMappings( List.of(), - Set.of(mapping("everyone(read only)")), - // suffix not stripped for native store query - Set.of("everyone(read only)", "everyone(read only)more", "everyone(read only) "), + Set.of(mapping("everyoneread-only-operator-config")), + Set.of("everyoneread-only-operator-config", "everyone-read-only-operator-config-", "everyone-read-only-operator-config-more"), // suffix that is similar but not the same is not stripped - Set.of("everyone(read only)", "everyone(read only)more", "everyone(read only) "), - "everyone(read only)", - "everyone(read only)more", - "everyone(read only) " + Set.of("everyoneread-only-operator-config", "everyone-read-only-operator-config-", "everyone-read-only-operator-config-more"), + "everyoneread-only-operator-config", + "everyone-read-only-operator-config-", + "everyone-read-only-operator-config-more" ); testGetMappings( From 9c2cba5d5f3ba7fe7da1a47c490c765ae9ffcf2f Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Sat, 19 Oct 2024 22:51:21 +0200 Subject: [PATCH 20/34] Tests --- ...vedRoleMappingXContentNameFieldHelper.java | 2 +- .../rolemapping/RoleMappingRestIT.java | 90 +++++++++++++------ ...portClusterStateRoleMappingTranslator.java | 4 +- 3 files changed, 66 insertions(+), 30 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index 958f4e5360c3c..8647c6bf54fdb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -29,7 +29,7 @@ public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping if (metadata.put(METADATA_NAME_FIELD, roleMapping.getName()) != null) { logger.error( "Metadata field [{}] is reserved and will be overwritten with an internal system value. " - + "Please rename this field in your role mapping configuration.", + + "Rename this field in your role mapping configuration.", METADATA_NAME_FIELD ); } diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index 73919085cf528..5e25ba15f0f7a 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -11,19 +11,25 @@ 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.test.cluster.ElasticsearchCluster; import org.elasticsearch.test.cluster.util.resource.Resource; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParserConfiguration; +import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; +import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.FieldExpression; import org.elasticsearch.xpack.security.SecurityOnTrialLicenseRestTestCase; import org.junit.ClassRule; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import static org.hamcrest.Matchers.containsInAnyOrder; public class RoleMappingRestIT extends ESRestTestCase { - private static final String settingsJson = """ { "metadata": { @@ -32,27 +38,57 @@ public class RoleMappingRestIT extends ESRestTestCase { }, "state": { "role_mappings": { - "role_mapping_1": { + "role-mapping-1": { "enabled": true, "roles": [ "role_1" ], "rules": { "field": { "username": "no_user" } }, "metadata": { "uuid" : "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", - "_foo": "something" + "_foo": "something", + "_es_reserved_role_mapping_name": "ignored" } }, - "role_mapping_2": { + "role-mapping-2": { "enabled": true, "roles": [ "role_2" ], + "rules": { "field": { "username": "no_user" } } + }, + "role-mapping-3": { + "enabled": true, + "roles": [ "role_3" ], "rules": { "field": { "username": "no_user" } }, "metadata": { - "uuid" : "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", - "_foo": "something_else" + "_read_only" : { "field": 1 }, + "_es_reserved_role_mapping_name": { "still_ignored": true } } } } } }"""; + private static final ExpressionRoleMapping clusterStateMapping1 = new ExpressionRoleMapping( + "role-mapping-1-read-only-operator-mapping", + new FieldExpression("username", List.of(new FieldExpression.FieldValue("no_user"))), + List.of("role_1"), + null, + Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something", "_read_only", true), + true + ); + private static final ExpressionRoleMapping clusterStateMapping2 = new ExpressionRoleMapping( + "role-mapping-2-read-only-operator-mapping", + new FieldExpression("username", List.of(new FieldExpression.FieldValue("no_user"))), + List.of("role_2"), + null, + Map.of("_read_only", true), + true + ); + private static final ExpressionRoleMapping clusterStateMapping3 = new ExpressionRoleMapping( + "role-mapping-3-read-only-operator-mapping", + new FieldExpression("username", List.of(new FieldExpression.FieldValue("no_user"))), + List.of("role_3"), + null, + Map.of("_read_only", true), + true + ); @ClassRule public static ElasticsearchCluster cluster = ElasticsearchCluster.local() @@ -66,29 +102,29 @@ protected String getTestRestCluster() { } public void testGetRoleMappings() throws IOException { - { - final Map mappings = responseAsMap(client().performRequest(new Request("GET", "/_security/role_mapping"))); - assertThat( - mappings.keySet(), - containsInAnyOrder("role_mapping_1-read-only-operator-config", "role_mapping_2-read-only-operator-config") - ); - } - - { - final Map mappings = responseAsMap( - client().performRequest(new Request("GET", "/_security/role_mapping/role_mapping_1-read-only-operator-config")) - ); - assertThat(mappings.keySet(), containsInAnyOrder("role_mapping_1-read-only-operator-config")); - } + expectMappings(List.of(clusterStateMapping1, clusterStateMapping2, clusterStateMapping3)); + expectMappings(List.of(clusterStateMapping1), "role-mapping-1"); + expectMappings(List.of(clusterStateMapping1, clusterStateMapping3), "role-mapping-1", "role-mapping-3"); + expectMappings(List.of(clusterStateMapping1), clusterStateMapping1.getName()); + expectMappings(List.of(clusterStateMapping1), clusterStateMapping1.getName(), "role-mapping-1"); + } - { - final Map mappings = responseAsMap( - client().performRequest( - new Request("GET", "/_security/role_mapping/role_mapping_1-read-only-operator-config,role_mapping_1") - ) - ); - assertThat(mappings.keySet(), containsInAnyOrder("role_mapping_1-read-only-operator-config")); + @SuppressWarnings("unchecked") + private static void expectMappings(List expectedMappings, String... requestedMappingNames) throws IOException { + Map map = responseAsMap( + client().performRequest(new Request("GET", "/_security/role_mapping/" + String.join(",", requestedMappingNames))) + ); + assertThat( + map.keySet(), + containsInAnyOrder(expectedMappings.stream().map(ExpressionRoleMapping::getName).toList().toArray(new String[0])) + ); + List actualMappings = new ArrayList<>(); + for (Map.Entry entry : map.entrySet()) { + XContentParser body = XContentHelper.mapToXContentParser(XContentParserConfiguration.EMPTY, (Map) entry.getValue()); + ExpressionRoleMapping actual = ExpressionRoleMapping.parse(entry.getKey(), body); + actualMappings.add(actual); } + assertThat(actualMappings, containsInAnyOrder(expectedMappings.toArray(new ExpressionRoleMapping[0]))); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java index 13952417e336e..216d5d0c520f2 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java @@ -37,7 +37,7 @@ public final class TransportClusterStateRoleMappingTranslator { private static final Logger logger = LogManager.getLogger(TransportClusterStateRoleMappingTranslator.class); - static final String READ_ONLY_ROLE_MAPPING_SUFFIX = "-read-only-operator-config"; + static final String READ_ONLY_ROLE_MAPPING_SUFFIX = "-read-only-operator-mapping"; static final String READ_ONLY_ROLE_MAPPING_METADATA_FLAG = "_read_only"; private TransportClusterStateRoleMappingTranslator() {} @@ -47,7 +47,7 @@ static ExpressionRoleMapping translate(ExpressionRoleMapping mapping) { if (metadata.put(READ_ONLY_ROLE_MAPPING_METADATA_FLAG, true) != null) { logger.error( "Metadata field [{}] is reserved and will be overwritten with an internal system value. " - + "Please rename this field in your role mapping configuration.", + + "Rename this field in your role mapping configuration.", READ_ONLY_ROLE_MAPPING_METADATA_FLAG ); } From 74c5674c08ad8f1d719281b75ea334809c97b26a Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Sat, 19 Oct 2024 22:57:08 +0200 Subject: [PATCH 21/34] Rename --- .../action/rolemapping/TransportDeleteRoleMappingAction.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java index f7d527e088f41..0f46a204d6fde 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java @@ -21,7 +21,6 @@ import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; public class TransportDeleteRoleMappingAction extends HandledTransportAction { - private final NativeRoleMappingStore roleMappingStore; private final ClusterStateRoleMapper clusterStateRoleMapper; @@ -46,7 +45,7 @@ public TransportDeleteRoleMappingAction( @Override protected void doExecute(Task task, DeleteRoleMappingRequest request, ActionListener listener) { roleMappingStore.deleteRoleMapping(request, listener.safeMap(found -> { - if (found && hasClusterStateMappingWithSameName(request.getName())) { + if (found && clusterStateMappingWithSameNameExists(request.getName())) { // Allow to delete a mapping with the same name in the native role mapping store as the file_settings namespace, but // add a warning header to signal to the caller that this could be a problem. HeaderWarning.addWarning( @@ -60,7 +59,7 @@ protected void doExecute(Task task, DeleteRoleMappingRequest request, ActionList })); } - private boolean hasClusterStateMappingWithSameName(String name) { + private boolean clusterStateMappingWithSameNameExists(String name) { return clusterStateRoleMapper.hasMapping(TransportClusterStateRoleMappingTranslator.removeReadOnlySuffixIfPresent(name)); } } From c4c3a48ada5eca362cb604e1269709b1273515b3 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 11:21:30 +0200 Subject: [PATCH 22/34] REST its --- .../rolemapping/RoleMappingRestIT.java | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index 5e25ba15f0f7a..1d042dfa9552b 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -8,13 +8,21 @@ package org.elasticsearch.xpack.security.rolemapping; import org.elasticsearch.client.Request; +import org.elasticsearch.client.RequestOptions; +import org.elasticsearch.client.Response; +import org.elasticsearch.client.ResponseException; +import org.elasticsearch.common.bytes.BytesReference; 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.core.Nullable; import org.elasticsearch.test.cluster.ElasticsearchCluster; import org.elasticsearch.test.cluster.util.resource.Resource; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentParserConfiguration; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; @@ -28,6 +36,8 @@ import java.util.Map; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; public class RoleMappingRestIT extends ESRestTestCase { private static final String settingsJson = """ @@ -109,6 +119,89 @@ public void testGetRoleMappings() throws IOException { expectMappings(List.of(clusterStateMapping1), clusterStateMapping1.getName(), "role-mapping-1"); } + public void testPutAndDeleteRoleMappings() throws IOException { + { + var ex = expectThrows( + ResponseException.class, + () -> putMapping(expressionRoleMapping("role-mapping-4-read-only-operator-mapping")) + ); + assertThat( + ex.getMessage(), + containsString( + "Invalid mapping name [role-mapping-4-read-only-operator-mapping]. " + + "[-read-only-operator-mapping] is not an allowed suffix" + ) + ); + } + + assertOK( + putMapping( + expressionRoleMapping("role-mapping-1"), + "A read only role mapping with the same name [" + + "role-mapping-1" + + "] has been previously defined in a configuration file. " + + "Both role mappings will be used to determine role assignments." + ) + ); + + assertOK( + deleteMapping( + "role-mapping-1", + "A read only role mapping with the same name [" + + "role-mapping-1" + + "] has previously been defined in a configuration file. " + + "The read only role mapping will not be deleted and will remain active." + ) + ); + + { + // 404 without warnings if no native mapping exists + var ex = expectThrows(ResponseException.class, () -> deleteMapping("role-mapping-1")); + assertThat(ex.getResponse().getStatusLine().getStatusCode(), equalTo(404)); + } + } + + private static Response putMapping(ExpressionRoleMapping roleMapping) throws IOException { + return putMapping(roleMapping, null); + } + + private static Response putMapping(ExpressionRoleMapping roleMapping, @Nullable String warning) throws IOException { + Request request = new Request("PUT", "/_security/role_mapping/" + roleMapping.getName()); + XContentBuilder xContent = roleMapping.toXContent(XContentFactory.jsonBuilder(), ToXContent.EMPTY_PARAMS); + request.setJsonEntity(BytesReference.bytes(xContent).utf8ToString()); + if (warning != null) { + request.setOptions( + RequestOptions.DEFAULT.toBuilder().setWarningsHandler(warnings -> warnings.equals(List.of(warning)) == false).build() + ); + } + return client().performRequest(request); + } + + private static Response deleteMapping(String name) throws IOException { + return deleteMapping(name, null); + } + + private static Response deleteMapping(String name, @Nullable String warning) throws IOException { + Request request = new Request("DELETE", "/_security/role_mapping/" + name); + if (warning != null) { + request.setOptions( + RequestOptions.DEFAULT.toBuilder().setWarningsHandler(warnings -> warnings.equals(List.of(warning)) == false).build() + ); + } + return client().performRequest(request); + } + + private static ExpressionRoleMapping expressionRoleMapping(String name) { + return new ExpressionRoleMapping( + name, + new FieldExpression("username", List.of(new FieldExpression.FieldValue(randomAlphaOfLength(10)))), + List.of(randomAlphaOfLength(5)), + null, + Map.of(), + true + ); + } + @SuppressWarnings("unchecked") private static void expectMappings(List expectedMappings, String... requestedMappingNames) throws IOException { Map map = responseAsMap( From b7a676f2d0fc8e17c7b1891ce1a5cd1eaf03b114 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 12:10:53 +0200 Subject: [PATCH 23/34] More clean up --- .../integration/RoleMappingFileSettingsIT.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java index 940d89dd59667..dc699e141d99a 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java @@ -148,15 +148,6 @@ public class RoleMappingFileSettingsIT extends NativeRealmIntegTestCase { } }"""; - @Override - protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { - Settings.Builder builder = Settings.builder() - .put(super.nodeSettings(nodeOrdinal, otherSettings)) - // some tests make use of cluster-state based role mappings - .put("xpack.security.authc.cluster_state_role_mappings.enabled", true); - return builder.build(); - } - @After public void cleanUp() { updateClusterSettings(Settings.builder().putNull("indices.recovery.max_bytes_per_sec")); From 3c1064fbc3243c79df966b10c81a71e2d6e80f11 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 12:22:24 +0200 Subject: [PATCH 24/34] More tests --- .../rolemapping/RoleMappingRestIT.java | 23 ++++++++++++------- .../TransportDeleteRoleMappingAction.java | 7 ++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index 1d042dfa9552b..29b75a19c6cd5 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -117,6 +117,9 @@ public void testGetRoleMappings() throws IOException { expectMappings(List.of(clusterStateMapping1, clusterStateMapping3), "role-mapping-1", "role-mapping-3"); expectMappings(List.of(clusterStateMapping1), clusterStateMapping1.getName()); expectMappings(List.of(clusterStateMapping1), clusterStateMapping1.getName(), "role-mapping-1"); + + expect404(() -> getMappings("role-mapping-4")); + expect404(() -> getMappings("role-mapping-4-read-only-operator-mapping")); } public void testPutAndDeleteRoleMappings() throws IOException { @@ -154,11 +157,13 @@ public void testPutAndDeleteRoleMappings() throws IOException { ) ); - { - // 404 without warnings if no native mapping exists - var ex = expectThrows(ResponseException.class, () -> deleteMapping("role-mapping-1")); - assertThat(ex.getResponse().getStatusLine().getStatusCode(), equalTo(404)); - } + // 404 without warnings if no native mapping exists + expect404(() -> deleteMapping("role-mapping-1")); + } + + private static void expect404(ThrowingRunnable clientCall) { + var ex = expectThrows(ResponseException.class, clientCall); + assertThat(ex.getResponse().getStatusLine().getStatusCode(), equalTo(404)); } private static Response putMapping(ExpressionRoleMapping roleMapping) throws IOException { @@ -204,9 +209,7 @@ private static ExpressionRoleMapping expressionRoleMapping(String name) { @SuppressWarnings("unchecked") private static void expectMappings(List expectedMappings, String... requestedMappingNames) throws IOException { - Map map = responseAsMap( - client().performRequest(new Request("GET", "/_security/role_mapping/" + String.join(",", requestedMappingNames))) - ); + Map map = responseAsMap(getMappings(requestedMappingNames)); assertThat( map.keySet(), containsInAnyOrder(expectedMappings.stream().map(ExpressionRoleMapping::getName).toList().toArray(new String[0])) @@ -220,6 +223,10 @@ private static void expectMappings(List expectedMappings, assertThat(actualMappings, containsInAnyOrder(expectedMappings.toArray(new ExpressionRoleMapping[0]))); } + private static Response getMappings(String... requestedMappingNames) throws IOException { + return client().performRequest(new Request("GET", "/_security/role_mapping/" + String.join(",", requestedMappingNames))); + } + @Override protected Settings restAdminSettings() { String token = basicAuthHeaderValue("admin_user", new SecureString("admin-password".toCharArray())); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java index 0f46a204d6fde..6b4a592e64ab4 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java @@ -44,8 +44,9 @@ public TransportDeleteRoleMappingAction( @Override protected void doExecute(Task task, DeleteRoleMappingRequest request, ActionListener listener) { + String name = request.getName(); roleMappingStore.deleteRoleMapping(request, listener.safeMap(found -> { - if (found && clusterStateMappingWithSameNameExists(request.getName())) { + if (found && clusterStateRoleMapper.hasMapping(name)) { // Allow to delete a mapping with the same name in the native role mapping store as the file_settings namespace, but // add a warning header to signal to the caller that this could be a problem. HeaderWarning.addWarning( @@ -58,8 +59,4 @@ protected void doExecute(Task task, DeleteRoleMappingRequest request, ActionList return new DeleteRoleMappingResponse(found); })); } - - private boolean clusterStateMappingWithSameNameExists(String name) { - return clusterStateRoleMapper.hasMapping(TransportClusterStateRoleMappingTranslator.removeReadOnlySuffixIfPresent(name)); - } } From d9f15c40144de688e7333460df0ddeaf4f207ccc Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 12:23:00 +0200 Subject: [PATCH 25/34] Nit --- .../action/rolemapping/TransportDeleteRoleMappingAction.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java index 6b4a592e64ab4..578ff23009ff6 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java @@ -44,9 +44,8 @@ public TransportDeleteRoleMappingAction( @Override protected void doExecute(Task task, DeleteRoleMappingRequest request, ActionListener listener) { - String name = request.getName(); roleMappingStore.deleteRoleMapping(request, listener.safeMap(found -> { - if (found && clusterStateRoleMapper.hasMapping(name)) { + if (found && clusterStateRoleMapper.hasMapping(request.getName())) { // Allow to delete a mapping with the same name in the native role mapping store as the file_settings namespace, but // add a warning header to signal to the caller that this could be a problem. HeaderWarning.addWarning( From eb8a9c56154315d301e3d251045425cd5c765deb Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 12:30:51 +0200 Subject: [PATCH 26/34] Moar tests --- .../security/rolemapping/RoleMappingRestIT.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index 29b75a19c6cd5..3351f8354dfa9 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -123,6 +123,21 @@ public void testGetRoleMappings() throws IOException { } public void testPutAndDeleteRoleMappings() throws IOException { + { + var ex = expectThrows( + ResponseException.class, + () -> putMapping(expressionRoleMapping("role-mapping-1-read-only-operator-mapping")) + ); + assertThat( + ex.getMessage(), + containsString( + "Invalid mapping name [role-mapping-4-read-only-operator-mapping]. " + + "[-read-only-operator-mapping] is not an allowed suffix" + ) + ); + } + + // Also fails even if a CS role mapping with that name does not exist { var ex = expectThrows( ResponseException.class, From d5be5a1cf954773e838e9ee28a227296cf783dcf Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 13:18:22 +0200 Subject: [PATCH 27/34] Fix test --- .../FileSettingsRoleMappingsRestartIT.java | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java index beaf8c96979dc..a4e42dc6fb1a8 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java @@ -208,7 +208,7 @@ public void testFileSettingsReprocessedOnRestartWithoutVersionChange() throws Ex new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("kibana_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something"), + Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something", METADATA_NAME_FIELD, "everyone_kibana_alone"), true ), new ExpressionRoleMapping( @@ -216,7 +216,14 @@ public void testFileSettingsReprocessedOnRestartWithoutVersionChange() throws Ex new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("fleet_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else"), + Map.of( + "uuid", + "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", + "_foo", + "something_else", + METADATA_NAME_FIELD, + "everyone_fleet_alone" + ), false ) ); @@ -236,7 +243,7 @@ public void testFileSettingsReprocessedOnRestartWithoutVersionChange() throws Ex new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("kibana_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something"), + Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something", METADATA_NAME_FIELD, "everyone_kibana_alone"), true ), new ExpressionRoleMapping( @@ -244,7 +251,14 @@ public void testFileSettingsReprocessedOnRestartWithoutVersionChange() throws Ex new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("fleet_user"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", "_foo", "something_else"), + Map.of( + "uuid", + "b9a59ba9-6b92-4be3-bb8d-02bb270cb3a7", + "_foo", + "something_else", + METADATA_NAME_FIELD, + "everyone_fleet_alone" + ), false ) ); @@ -262,7 +276,14 @@ public void testFileSettingsReprocessedOnRestartWithoutVersionChange() throws Ex new FieldExpression("username", List.of(new FieldExpression.FieldValue("*"))), List.of("kibana_user", "kibana_admin"), List.of(), - Map.of("uuid", "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", "_foo", "something"), + Map.of( + "uuid", + "b9a59ba9-6b92-4be2-bb8d-02bb270cb3a7", + "_foo", + "something", + METADATA_NAME_FIELD, + "everyone_kibana_together" + ), true ) ) From fc11ea19bcc5831b414358c923c95c647f149af0 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 13:28:25 +0200 Subject: [PATCH 28/34] Get tests --- .../rolemapping/RoleMappingRestIT.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index 3351f8354dfa9..53e2aaaf96a19 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -120,6 +120,25 @@ public void testGetRoleMappings() throws IOException { expect404(() -> getMappings("role-mapping-4")); expect404(() -> getMappings("role-mapping-4-read-only-operator-mapping")); + + ExpressionRoleMapping nativeMapping1 = expressionRoleMapping("role-mapping-1"); + putMapping( + nativeMapping1, + "A read only role mapping with the same name [" + + "role-mapping-1" + + "] has been previously defined in a configuration file. " + + "Both role mappings will be used to determine role assignments." + ); + + ExpressionRoleMapping nativeMapping4 = expressionRoleMapping("role-mapping-4"); + putMapping(nativeMapping4); + + expectMappings(List.of(clusterStateMapping1, clusterStateMapping2, clusterStateMapping3, nativeMapping1, nativeMapping4)); + expectMappings(List.of(clusterStateMapping1, nativeMapping1), "role-mapping-1"); + expectMappings(List.of(clusterStateMapping1, nativeMapping1), "role-mapping-1", clusterStateMapping1.getName()); + expectMappings(List.of(clusterStateMapping1), clusterStateMapping1.getName()); + expectMappings(List.of(nativeMapping4), "role-mapping-4"); + expectMappings(List.of(nativeMapping4), "role-mapping-4", "role-mapping-4-read-only-operator-mapping"); } public void testPutAndDeleteRoleMappings() throws IOException { From 01213ff17acce0cb974a60028bc34e5bd1d05b27 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 13:38:04 +0200 Subject: [PATCH 29/34] Tests and javadoc --- ...eservedRoleMappingXContentNameFieldHelper.java | 15 +++++++++++++++ .../security/rolemapping/RoleMappingRestIT.java | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java index 8647c6bf54fdb..18d3fe34c4d3b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java @@ -15,6 +15,21 @@ import java.util.HashMap; import java.util.Map; +/** + * Helper class to avoid name erasure when cluster-state role mappings on disk. + * When cluster-state role mappings are written to disk, their XContent format is used. + * This format omits the role mapping's name. + * This means that if CS role mappings are ever recovered from disk (e.g., during a master-node restart), their names are erased. + * To address this, this class augments CS role mapping serialization to persist the name of a mapping in a reserved metadata field, + * and recover it from metadata during de-serialization. + * Storing the name in metadata allows us to persist the name without BWC-breaks in role mapping `XContent` format (as opposed to changing + * XContent serialization to persist the top-level name field). + * It also ensures that role mappings are re-written to cluster state in the new, + * name-preserving format the first time operator file settings are processed. + * {@link #copyWithNameInMetadata(ExpressionRoleMapping)}} is used to copy the name of a role mapping into its metadata field. + * This is called when the role mappings are read from operator file settings (at which point the correct name is still available). + * {@link #parseWithNameFromMetadata(XContentParser)} is used to parse a role mapping from XContent restoring the name from metadata. + */ public final class ReservedRoleMappingXContentNameFieldHelper { private static final Logger logger = LogManager.getLogger(ReservedRoleMappingXContentNameFieldHelper.class); diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index 53e2aaaf96a19..fec01efbcce79 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -150,7 +150,7 @@ public void testPutAndDeleteRoleMappings() throws IOException { assertThat( ex.getMessage(), containsString( - "Invalid mapping name [role-mapping-4-read-only-operator-mapping]. " + "Invalid mapping name [role-mapping-1-read-only-operator-mapping]. " + "[-read-only-operator-mapping] is not an allowed suffix" ) ); From 4be17a8de81eb744b8034b5e80e489e7b7035cdb Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 13:43:46 +0200 Subject: [PATCH 30/34] Upgrade --- .../upgrades/FileSettingsRoleMappingUpgradeIT.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java b/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java index 3275f3e0e136f..a77216eeff5ed 100644 --- a/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java +++ b/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java @@ -25,9 +25,12 @@ import java.io.IOException; import java.util.List; +import java.util.Map; import java.util.function.Supplier; +import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullValue; @@ -106,6 +109,10 @@ public void testRoleMappingsAppliedOnUpgrade() throws IOException { ); assertThat(roleMappings, is(not(nullValue()))); assertThat(roleMappings.size(), equalTo(1)); + assertThat(roleMappings, is(instanceOf(Map.class))); + @SuppressWarnings("unchecked") + Map roleMapping = (Map) roleMappings; + assertThat(roleMapping.keySet(), contains("everyone_kibana")); } } } From f0f2f9830091e7abd9ffc33f9f4781fdd1b0f43b Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Mon, 21 Oct 2024 15:15:53 +0200 Subject: [PATCH 31/34] Test nit --- .../TransportGetRoleMappingsActionTests.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index 4c72b9577c3e8..569029b813ef9 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -175,13 +175,21 @@ public void testGetSingleRoleMappingQueryWithReadOnlySuffix() throws Exception { testGetMappings( List.of(), - Set.of(mapping("everyoneread-only-operator-config")), - Set.of("everyoneread-only-operator-config", "everyone-read-only-operator-config-", "everyone-read-only-operator-config-more"), + Set.of(mapping("everyoneread-only-operator-mapping")), + Set.of( + "everyoneread-only-operator-mapping", + "everyone-read-only-operator-mapping-", + "everyone-read-only-operator-mapping-more" + ), // suffix that is similar but not the same is not stripped - Set.of("everyoneread-only-operator-config", "everyone-read-only-operator-config-", "everyone-read-only-operator-config-more"), - "everyoneread-only-operator-config", - "everyone-read-only-operator-config-", - "everyone-read-only-operator-config-more" + Set.of( + "everyoneread-only-operator-mapping", + "everyone-read-only-operator-mapping-", + "everyone-read-only-operator-mapping-more" + ), + "everyoneread-only-operator-mapping", + "everyone-read-only-operator-mapping-", + "everyone-read-only-operator-mapping-more" ); testGetMappings( From de5cf692c1b662e85cf0925fa9b71586b1c1b206 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Tue, 22 Oct 2024 13:11:24 +0200 Subject: [PATCH 32/34] WIP address review feedback --- .../FileSettingsRoleMappingUpgradeIT.java | 2 +- .../support/mapper/ExpressionRoleMapping.java | 34 +++++++ ...vedRoleMappingXContentNameFieldHelper.java | 91 ------------------- .../security/authz/RoleMappingMetadata.java | 75 +++++++++++++-- .../rolemapping/RoleMappingRestIT.java | 42 ++++----- .../RoleMappingFileSettingsIT.java | 15 ++- .../FileSettingsRoleMappingsRestartIT.java | 2 +- .../ReservedRoleMappingAction.java | 3 +- ...portClusterStateRoleMappingTranslator.java | 90 ------------------ .../TransportDeleteRoleMappingAction.java | 5 +- .../TransportGetRoleMappingsAction.java | 52 ++++++++++- .../TransportPutRoleMappingAction.java | 4 +- .../mapper/ClusterStateRoleMapper.java | 24 +++-- .../TransportGetRoleMappingsActionTests.java | 4 +- .../TransportPutRoleMappingActionTests.java | 4 +- 15 files changed, 197 insertions(+), 250 deletions(-) delete mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java delete mode 100644 x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java diff --git a/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java b/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java index a77216eeff5ed..b3d4dfc68d399 100644 --- a/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java +++ b/qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/FileSettingsRoleMappingUpgradeIT.java @@ -112,7 +112,7 @@ public void testRoleMappingsAppliedOnUpgrade() throws IOException { assertThat(roleMappings, is(instanceOf(Map.class))); @SuppressWarnings("unchecked") Map roleMapping = (Map) roleMappings; - assertThat(roleMapping.keySet(), contains("everyone_kibana")); + assertThat(roleMapping.keySet(), contains("everyone_kibana-read-only-operator-mapping")); } } } 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 17088cff8718b..c504ebe56ed45 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 @@ -54,6 +54,18 @@ */ public class ExpressionRoleMapping implements ToXContentObject, Writeable { + /** + * Reserved suffix for read-only operator-defined role mappings. + * This suffix is added to the name of all cluster-state role mappings returned via + * the {@code TransportGetRoleMappingsAction} action. + */ + public static final String READ_ONLY_ROLE_MAPPING_SUFFIX = "-read-only-operator-mapping"; + /** + * Reserved metadata field to mark role mappings as read-only. + * This field is added to the metadata of all cluster-state role mappings returned via + * the {@code TransportGetRoleMappingsAction} action. + */ + public static final String READ_ONLY_ROLE_MAPPING_METADATA_FLAG = "_read_only"; private static final ObjectParser PARSER = new ObjectParser<>("role-mapping", Builder::new); /** @@ -136,6 +148,28 @@ public ExpressionRoleMapping(StreamInput in) throws IOException { this.metadata = in.readGenericMap(); } + public static boolean hasReadOnlySuffix(String name) { + return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX); + } + + public static void validateNoReadOnlySuffix(String name) { + if (hasReadOnlySuffix(name)) { + throw new IllegalArgumentException( + "Invalid mapping name [" + name + "]. [" + READ_ONLY_ROLE_MAPPING_SUFFIX + "] is not an allowed suffix" + ); + } + } + + public static String addReadOnlySuffix(String name) { + return name + READ_ONLY_ROLE_MAPPING_SUFFIX; + } + + public static String removeReadOnlySuffixIfPresent(String name) { + return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX) + ? name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()) + : name; + } + @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(name); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java deleted file mode 100644 index 18d3fe34c4d3b..0000000000000 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ReservedRoleMappingXContentNameFieldHelper.java +++ /dev/null @@ -1,91 +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.security.authc.support.mapper; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.elasticsearch.xcontent.XContentParser; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * Helper class to avoid name erasure when cluster-state role mappings on disk. - * When cluster-state role mappings are written to disk, their XContent format is used. - * This format omits the role mapping's name. - * This means that if CS role mappings are ever recovered from disk (e.g., during a master-node restart), their names are erased. - * To address this, this class augments CS role mapping serialization to persist the name of a mapping in a reserved metadata field, - * and recover it from metadata during de-serialization. - * Storing the name in metadata allows us to persist the name without BWC-breaks in role mapping `XContent` format (as opposed to changing - * XContent serialization to persist the top-level name field). - * It also ensures that role mappings are re-written to cluster state in the new, - * name-preserving format the first time operator file settings are processed. - * {@link #copyWithNameInMetadata(ExpressionRoleMapping)}} is used to copy the name of a role mapping into its metadata field. - * This is called when the role mappings are read from operator file settings (at which point the correct name is still available). - * {@link #parseWithNameFromMetadata(XContentParser)} is used to parse a role mapping from XContent restoring the name from metadata. - */ -public final class ReservedRoleMappingXContentNameFieldHelper { - private static final Logger logger = LogManager.getLogger(ReservedRoleMappingXContentNameFieldHelper.class); - - public static final String METADATA_NAME_FIELD = "_es_reserved_role_mapping_name"; - public static final String FALLBACK_NAME = "name_not_available_after_deserialization"; - - private ReservedRoleMappingXContentNameFieldHelper() {} - - public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { - Map metadata = new HashMap<>(roleMapping.getMetadata()); - // note: can't use Maps.copyWith... since these create maps that don't support `null` values in map entries - if (metadata.put(METADATA_NAME_FIELD, roleMapping.getName()) != null) { - logger.error( - "Metadata field [{}] is reserved and will be overwritten with an internal system value. " - + "Rename this field in your role mapping configuration.", - METADATA_NAME_FIELD - ); - } - return new ExpressionRoleMapping( - roleMapping.getName(), - roleMapping.getExpression(), - roleMapping.getRoles(), - roleMapping.getRoleTemplates(), - metadata, - roleMapping.isEnabled() - ); - } - - public static boolean hasFallbackName(ExpressionRoleMapping expressionRoleMapping) { - return expressionRoleMapping.getName().equals(FALLBACK_NAME); - } - - public static void removeNameFromMetadata(Map metadata) { - assert metadata instanceof HashMap; - metadata.remove(METADATA_NAME_FIELD); - } - - public static ExpressionRoleMapping parseWithNameFromMetadata(XContentParser parser) throws IOException { - ExpressionRoleMapping roleMapping = ExpressionRoleMapping.parse(FALLBACK_NAME, parser); - return new ExpressionRoleMapping( - getNameFromMetadata(roleMapping), - roleMapping.getExpression(), - roleMapping.getRoles(), - roleMapping.getRoleTemplates(), - roleMapping.getMetadata(), - roleMapping.isEnabled() - ); - } - - private static String getNameFromMetadata(ExpressionRoleMapping roleMapping) { - Map metadata = roleMapping.getMetadata(); - if (metadata.containsKey(METADATA_NAME_FIELD) && metadata.get(METADATA_NAME_FIELD) instanceof String name) { - return name; - } else { - // This is valid the first time we recover from cluster-state: the old format metadata won't have a name stored in metadata yet - return FALLBACK_NAME; - } - } -} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index f8f4ea9698a84..74c6223b1ebdd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -7,6 +7,8 @@ package org.elasticsearch.xpack.core.security.authz; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.TransportVersion; import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; @@ -22,13 +24,14 @@ import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; import java.io.IOException; import java.util.Collection; import java.util.EnumSet; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashSet; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -37,7 +40,11 @@ public final class RoleMappingMetadata extends AbstractNamedDiffable implements Metadata.Custom { + private static final Logger logger = LogManager.getLogger(RoleMappingMetadata.class); + public static final String TYPE = "role_mappings"; + public static final String METADATA_NAME_FIELD = "_es_reserved_role_mapping_name"; + public static final String FALLBACK_NAME = "name_not_available_after_deserialization"; @SuppressWarnings("unchecked") private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( @@ -47,11 +54,7 @@ public final class RoleMappingMetadata extends AbstractNamedDiffable ReservedRoleMappingXContentNameFieldHelper.parseWithNameFromMetadata(p), - new ParseField(TYPE) - ); + PARSER.declareObjectArray(constructorArg(), (p, c) -> parseWithNameFromMetadata(p), new ParseField(TYPE)); } private static final RoleMappingMetadata EMPTY = new RoleMappingMetadata(Set.of()); @@ -153,4 +156,64 @@ public EnumSet context() { // are not persisted. return ALL_CONTEXTS; } + + /** + * Ensures role mapping names are preserved when stored on disk using XContent format, + * which omits names. This method copies the role mapping's name into a reserved metadata field + * during serialization, allowing recovery during deserialization (e.g., after a master-node restart). + * {@link #parseWithNameFromMetadata(XContentParser)} restores the name during parsing. + */ + public static ExpressionRoleMapping copyWithNameInMetadata(ExpressionRoleMapping roleMapping) { + Map metadata = new HashMap<>(roleMapping.getMetadata()); + // note: can't use Maps.copyWith... since these create maps that don't support `null` values in map entries + if (metadata.put(METADATA_NAME_FIELD, roleMapping.getName()) != null) { + logger.error( + "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + + "Rename this field in your role mapping configuration.", + METADATA_NAME_FIELD + ); + } + return new ExpressionRoleMapping( + roleMapping.getName(), + roleMapping.getExpression(), + roleMapping.getRoles(), + roleMapping.getRoleTemplates(), + metadata, + roleMapping.isEnabled() + ); + } + + /** + * If a role mapping does not yet have a name persisted in metadata, it will use a constant fallback name. This method checks if a + * role mapping has the fallback name. + */ + public static boolean hasFallbackName(ExpressionRoleMapping expressionRoleMapping) { + return expressionRoleMapping.getName().equals(FALLBACK_NAME); + } + + /** + * Parse a role mapping from XContent, restoring the name from a reserved metadata field. + * Used to parse a role mapping annotated with its name in metadata via @see {@link #copyWithNameInMetadata(ExpressionRoleMapping)}. + */ + public static ExpressionRoleMapping parseWithNameFromMetadata(XContentParser parser) throws IOException { + ExpressionRoleMapping roleMapping = ExpressionRoleMapping.parse(FALLBACK_NAME, parser); + return new ExpressionRoleMapping( + getNameFromMetadata(roleMapping), + roleMapping.getExpression(), + roleMapping.getRoles(), + roleMapping.getRoleTemplates(), + roleMapping.getMetadata(), + roleMapping.isEnabled() + ); + } + + private static String getNameFromMetadata(ExpressionRoleMapping roleMapping) { + Map metadata = roleMapping.getMetadata(); + if (metadata.containsKey(METADATA_NAME_FIELD) && metadata.get(METADATA_NAME_FIELD) instanceof String name) { + return name; + } else { + // This is valid the first time we recover from cluster-state: the old format metadata won't have a name stored in metadata yet + return FALLBACK_NAME; + } + } } diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java index fec01efbcce79..51970af4b88a0 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/rolemapping/RoleMappingRestIT.java @@ -122,13 +122,7 @@ public void testGetRoleMappings() throws IOException { expect404(() -> getMappings("role-mapping-4-read-only-operator-mapping")); ExpressionRoleMapping nativeMapping1 = expressionRoleMapping("role-mapping-1"); - putMapping( - nativeMapping1, - "A read only role mapping with the same name [" - + "role-mapping-1" - + "] has been previously defined in a configuration file. " - + "Both role mappings will be used to determine role assignments." - ); + putMapping(nativeMapping1, createOrUpdateWarning(nativeMapping1.getName())); ExpressionRoleMapping nativeMapping4 = expressionRoleMapping("role-mapping-4"); putMapping(nativeMapping4); @@ -171,25 +165,9 @@ public void testPutAndDeleteRoleMappings() throws IOException { ); } - assertOK( - putMapping( - expressionRoleMapping("role-mapping-1"), - "A read only role mapping with the same name [" - + "role-mapping-1" - + "] has been previously defined in a configuration file. " - + "Both role mappings will be used to determine role assignments." - ) - ); + assertOK(putMapping(expressionRoleMapping("role-mapping-1"), createOrUpdateWarning("role-mapping-1"))); - assertOK( - deleteMapping( - "role-mapping-1", - "A read only role mapping with the same name [" - + "role-mapping-1" - + "] has previously been defined in a configuration file. " - + "The read only role mapping will not be deleted and will remain active." - ) - ); + assertOK(deleteMapping("role-mapping-1", deletionWarning("role-mapping-1"))); // 404 without warnings if no native mapping exists expect404(() -> deleteMapping("role-mapping-1")); @@ -273,4 +251,18 @@ protected Settings restClientSettings() { return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", token).build(); } + private static String createOrUpdateWarning(String mappingName) { + return "A read-only role mapping with the same name [" + + mappingName + + "] has been previously defined in a configuration file. " + + "Both role mappings will be used to determine role assignments."; + } + + private static String deletionWarning(String mappingName) { + return "A read-only role mapping with the same name [" + + mappingName + + "] has previously been defined in a configuration file. " + + "The native role mapping was deleted, but the read-only mapping will remain active " + + "and will be used to determine role assignments."; + }; } diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java index dc699e141d99a..8550a92f21960 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java @@ -39,7 +39,6 @@ import org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import org.elasticsearch.xpack.security.action.rolemapping.ReservedRoleMappingAction; -import org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator; import org.junit.After; import java.io.ByteArrayInputStream; @@ -360,9 +359,9 @@ public void testGetRoleMappings() throws Exception { Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), containsInAnyOrder( "everyone_kibana", - TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_kibana"), + ExpressionRoleMapping.addReadOnlySuffix("everyone_kibana"), "_everyone_kibana", - TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_fleet"), + ExpressionRoleMapping.addReadOnlySuffix("everyone_fleet"), "zzz_mapping", "123_mapping" ) @@ -371,9 +370,7 @@ public void testGetRoleMappings() throws Exception { int readOnlyCount = 0; // assert that cluster-state role mappings come last for (ExpressionRoleMapping mapping : response.mappings()) { - readOnlyCount = TransportClusterStateRoleMappingTranslator.hasReadOnlySuffix(mapping.getName()) - ? readOnlyCount + 1 - : readOnlyCount; + readOnlyCount = ExpressionRoleMapping.hasReadOnlySuffix(mapping.getName()) ? readOnlyCount + 1 : readOnlyCount; } // Two sourced from cluster-state assertEquals(readOnlyCount, 2); @@ -383,12 +380,12 @@ public void testGetRoleMappings() throws Exception { // Fetch a specific file based role request = new GetRoleMappingsRequest(); - request.setNames(TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_kibana")); + request.setNames(ExpressionRoleMapping.addReadOnlySuffix("everyone_kibana")); response = client().execute(GetRoleMappingsAction.INSTANCE, request).get(); assertTrue(response.hasMappings()); assertThat( Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), - containsInAnyOrder(TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("everyone_kibana")) + containsInAnyOrder(ExpressionRoleMapping.addReadOnlySuffix("everyone_kibana")) ); savedClusterState = setupClusterStateListenerForCleanup(internalCluster().getMasterName()); @@ -570,7 +567,7 @@ private static void assertGetResponseHasMappings(boolean readOnly, String... map Arrays.stream(response.mappings()).map(ExpressionRoleMapping::getName).toList(), containsInAnyOrder( Arrays.stream(mappings) - .map(mapping -> readOnly ? TransportClusterStateRoleMappingTranslator.addReadOnlySuffix(mapping) : mapping) + .map(mapping -> readOnly ? ExpressionRoleMapping.addReadOnlySuffix(mapping) : mapping) .toArray(String[]::new) ) ); diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java index a4e42dc6fb1a8..97a5f080cee4e 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/FileSettingsRoleMappingsRestartIT.java @@ -30,7 +30,7 @@ import static org.elasticsearch.integration.RoleMappingFileSettingsIT.setupClusterStateListenerForCleanup; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.writeJSONFile; import static org.elasticsearch.integration.RoleMappingFileSettingsIT.writeJSONFileWithoutVersionIncrement; -import static org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper.METADATA_NAME_FIELD; +import static org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata.METADATA_NAME_FIELD; import static org.hamcrest.Matchers.containsInAnyOrder; @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java index daa5f65604da4..837b475dea68f 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/ReservedRoleMappingAction.java @@ -15,7 +15,6 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequestBuilder; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; import java.io.IOException; @@ -87,7 +86,7 @@ private Set validateAndTranslate(List ReservedRoleMappingXContentNameFieldHelper.copyWithNameInMetadata(r.getMapping())) + .map(r -> RoleMappingMetadata.copyWithNameInMetadata(r.getMapping())) .collect(Collectors.toUnmodifiableSet()); } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.java deleted file mode 100644 index 216d5d0c520f2..0000000000000 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportClusterStateRoleMappingTranslator.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.security.action.rolemapping; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * Translator class for ensuring unique API names and marking cluster-state role mappings as read-only. - * Role mappings retrieved from cluster-state are surfaced through both the transport and REST layers, - * along with native role mappings. Unlike native role mappings, cluster-state role mappings are - * read-only and cannot be modified via APIs. It is possible for cluster-state and native role mappings - * to have overlapping names. - * - *

      - * This class handles the following responsibilities to ensure correct processing of cluster-state role mappings: - *

      - * - *
        - *
      1. Appends a reserved suffix to cluster-state role mapping names to avoid conflicts with native role mappings.
      2. - *
      3. Marks the metadata of cluster-state role mappings with a reserved read-only flag.
      4. - *
      5. Removes internal metadata flags used in processing (see {@link ReservedRoleMappingXContentNameFieldHelper}).
      6. - *
      - */ -public final class TransportClusterStateRoleMappingTranslator { - private static final Logger logger = LogManager.getLogger(TransportClusterStateRoleMappingTranslator.class); - - static final String READ_ONLY_ROLE_MAPPING_SUFFIX = "-read-only-operator-mapping"; - static final String READ_ONLY_ROLE_MAPPING_METADATA_FLAG = "_read_only"; - - private TransportClusterStateRoleMappingTranslator() {} - - static ExpressionRoleMapping translate(ExpressionRoleMapping mapping) { - Map metadata = new HashMap<>(mapping.getMetadata()); - if (metadata.put(READ_ONLY_ROLE_MAPPING_METADATA_FLAG, true) != null) { - logger.error( - "Metadata field [{}] is reserved and will be overwritten with an internal system value. " - + "Rename this field in your role mapping configuration.", - READ_ONLY_ROLE_MAPPING_METADATA_FLAG - ); - } - ReservedRoleMappingXContentNameFieldHelper.removeNameFromMetadata(metadata); - return new ExpressionRoleMapping( - addReadOnlySuffix(mapping.getName()), - mapping.getExpression(), - mapping.getRoles(), - mapping.getRoleTemplates(), - metadata, - mapping.isEnabled() - ); - } - - public static boolean hasReadOnlySuffix(String name) { - return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX); - } - - public static void validateNoReadOnlySuffix(String name) { - if (hasReadOnlySuffix(name)) { - throw new IllegalArgumentException( - "Invalid mapping name [" + name + "]. [" + READ_ONLY_ROLE_MAPPING_SUFFIX + "] is not an allowed suffix" - ); - } - } - - public static String addReadOnlySuffix(String name) { - return name + READ_ONLY_ROLE_MAPPING_SUFFIX; - } - - public static Set removeReadOnlySuffixIfPresent(Set names) { - return names.stream().map(TransportClusterStateRoleMappingTranslator::removeReadOnlySuffixIfPresent).collect(Collectors.toSet()); - } - - public static String removeReadOnlySuffixIfPresent(String name) { - return name.endsWith(READ_ONLY_ROLE_MAPPING_SUFFIX) - ? name.substring(0, name.length() - READ_ONLY_ROLE_MAPPING_SUFFIX.length()) - : name; - } -} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java index 578ff23009ff6..b1fdf2e90dd46 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportDeleteRoleMappingAction.java @@ -49,10 +49,11 @@ protected void doExecute(Task task, DeleteRoleMappingRequest request, ActionList // Allow to delete a mapping with the same name in the native role mapping store as the file_settings namespace, but // add a warning header to signal to the caller that this could be a problem. HeaderWarning.addWarning( - "A read only role mapping with the same name [" + "A read-only role mapping with the same name [" + request.getName() + "] has previously been defined in a configuration file. " - + "The read only role mapping will not be deleted and will remain active." + + "The native role mapping was deleted, but the read-only mapping will remain active " + + "and will be used to determine role assignments." ); } return new DeleteRoleMappingResponse(found); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java index 641a68dc1c83f..5f16b095db0ef 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsAction.java @@ -19,14 +19,17 @@ import org.elasticsearch.xpack.core.security.action.rolemapping.GetRoleMappingsRequest; import org.elasticsearch.xpack.core.security.action.rolemapping.GetRoleMappingsResponse; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; -import org.elasticsearch.xpack.core.security.authc.support.mapper.ReservedRoleMappingXContentNameFieldHelper; +import org.elasticsearch.xpack.core.security.authz.RoleMappingMetadata; import org.elasticsearch.xpack.security.authc.support.mapper.ClusterStateRoleMapper; import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; import java.util.stream.Stream; public class TransportGetRoleMappingsAction extends HandledTransportAction { @@ -65,7 +68,7 @@ protected void doExecute(Task task, final GetRoleMappingsRequest request, final final Collection clusterStateRoleMappings = clusterStateRoleMapper.getMappings( // if the API was queried with a reserved suffix for any of the names, we need to remove it because role mappings are // stored without it in cluster-state - TransportClusterStateRoleMappingTranslator.removeReadOnlySuffixIfPresent(names) + removeReadOnlySuffixIfPresent(names) ); listener.onResponse(buildResponse(clusterStateRoleMappings, nativeRoleMappings)); }, listener::onFailure)); @@ -76,7 +79,7 @@ private GetRoleMappingsResponse buildResponse( Collection nativeMappings ) { Stream translatedClusterStateMappings = clusterStateMappings.stream().filter(roleMapping -> { - if (ReservedRoleMappingXContentNameFieldHelper.hasFallbackName(roleMapping)) { + if (RoleMappingMetadata.hasFallbackName(roleMapping)) { logger.warn( "Role mapping retrieved from cluster-state with an ambiguous name. It will be omitted from the API response." + "This is likely a transient issue during node start-up." @@ -84,9 +87,50 @@ private GetRoleMappingsResponse buildResponse( return false; } return true; - }).map(TransportClusterStateRoleMappingTranslator::translate); + }).map(this::translateClusterStateMapping); return new GetRoleMappingsResponse( Stream.concat(nativeMappings.stream(), translatedClusterStateMappings).toArray(ExpressionRoleMapping[]::new) ); } + + private Set removeReadOnlySuffixIfPresent(Set names) { + return names.stream().map(ExpressionRoleMapping::removeReadOnlySuffixIfPresent).collect(Collectors.toSet()); + } + + /** + * Translator method for ensuring unique API names and marking cluster-state role mappings as read-only. + * Role mappings retrieved from cluster-state are surfaced through both the transport and REST layers, + * along with native role mappings. Unlike native role mappings, cluster-state role mappings are + * read-only and cannot be modified via APIs. It is possible for cluster-state and native role mappings + * to have overlapping names. + * + *

      + * This does the following: + *

      + * + *
        + *
      1. Appends a reserved suffix to cluster-state role mapping names to avoid conflicts with native role mappings.
      2. + *
      3. Marks the metadata of cluster-state role mappings with a reserved read-only flag.
      4. + *
      5. Removes internal metadata flag used in processing (see {@link RoleMappingMetadata#METADATA_NAME_FIELD}).
      6. + *
      + */ + private ExpressionRoleMapping translateClusterStateMapping(ExpressionRoleMapping mapping) { + Map metadata = new HashMap<>(mapping.getMetadata()); + if (metadata.put(ExpressionRoleMapping.READ_ONLY_ROLE_MAPPING_METADATA_FLAG, true) != null) { + logger.error( + "Metadata field [{}] is reserved and will be overwritten with an internal system value. " + + "Rename this field in your role mapping configuration.", + ExpressionRoleMapping.READ_ONLY_ROLE_MAPPING_METADATA_FLAG + ); + } + metadata.remove(RoleMappingMetadata.METADATA_NAME_FIELD); + return new ExpressionRoleMapping( + ExpressionRoleMapping.addReadOnlySuffix(mapping.getName()), + mapping.getExpression(), + mapping.getRoles(), + mapping.getRoleTemplates(), + metadata, + mapping.isEnabled() + ); + } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java index 0961ecad325db..682ade925d2ec 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingAction.java @@ -20,7 +20,7 @@ import org.elasticsearch.xpack.security.authc.support.mapper.ClusterStateRoleMapper; import org.elasticsearch.xpack.security.authc.support.mapper.NativeRoleMappingStore; -import static org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator.validateNoReadOnlySuffix; +import static org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping.validateNoReadOnlySuffix; public class TransportPutRoleMappingAction extends HandledTransportAction { @@ -46,7 +46,7 @@ protected void doExecute(Task task, final PutRoleMappingRequest request, final A // Allow to define a mapping with the same name in the native role mapping store as the file_settings namespace, but add a // warning header to signal to the caller that this could be a problem. HeaderWarning.addWarning( - "A read only role mapping with the same name [" + "A read-only role mapping with the same name [" + request.getName() + "] has been previously defined in a configuration file. " + "Both role mappings will be used to determine role assignments." diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java index ab5a6e096dd64..99e3311283920 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/ClusterStateRoleMapper.java @@ -83,27 +83,25 @@ public void clusterChanged(ClusterChangedEvent event) { } public boolean hasMapping(String name) { - return getMappings().stream().map(ExpressionRoleMapping::getName).anyMatch(name::equals); - } - - public Set getMappings(@Nullable Set names) { if (enabled == false) { - return Set.of(); - } - final Set mappings = getMappings(); - if (names == null || names.isEmpty()) { - return mappings; + return false; } - return mappings.stream().filter(it -> names.contains(it.getName())).collect(Collectors.toSet()); + return false == getMappings(Set.of(name)).isEmpty(); } public Set getMappings() { + return getMappings(null); + } + + public Set getMappings(@Nullable Set names) { if (enabled == false) { return Set.of(); - } else { - final Set mappings = RoleMappingMetadata.getFromClusterState(clusterService.state()).getRoleMappings(); - logger.trace("Retrieved [{}] mapping(s) from cluster state", mappings.size()); + } + final Set mappings = RoleMappingMetadata.getFromClusterState(clusterService.state()).getRoleMappings(); + logger.trace("Retrieved [{}] mapping(s) from cluster state", mappings.size()); + if (names == null || names.isEmpty()) { return mappings; } + return mappings.stream().filter(roleMapping -> names.contains(roleMapping.getName())).collect(Collectors.toSet()); } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java index 569029b813ef9..010c19e8cc1b1 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportGetRoleMappingsActionTests.java @@ -31,8 +31,8 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_METADATA_FLAG; -import static org.elasticsearch.xpack.security.action.rolemapping.TransportClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_SUFFIX; +import static org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping.READ_ONLY_ROLE_MAPPING_METADATA_FLAG; +import static org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping.READ_ONLY_ROLE_MAPPING_SUFFIX; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.notNullValue; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java index cb830887d102b..6d1ac864d20fd 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/rolemapping/TransportPutRoleMappingActionTests.java @@ -110,7 +110,7 @@ public void testValidMappingClashingClusterStateMapping() throws Exception { public void testInvalidSuffix() { final FieldExpression expression = new FieldExpression("username", Collections.singletonList(new FieldExpression.FieldValue("*"))); - String name = TransportClusterStateRoleMappingTranslator.addReadOnlySuffix("anarchy"); + String name = ExpressionRoleMapping.addReadOnlySuffix("anarchy"); final var ex = expectThrows(IllegalArgumentException.class, () -> { put(name, expression, "superuser", Collections.singletonMap("dumb", true)); }); @@ -120,7 +120,7 @@ public void testInvalidSuffix() { "Invalid mapping name [" + name + "]. [" - + TransportClusterStateRoleMappingTranslator.READ_ONLY_ROLE_MAPPING_SUFFIX + + ExpressionRoleMapping.READ_ONLY_ROLE_MAPPING_SUFFIX + "] is not an allowed suffix" ) ); From 57f53aa7a381d37ec13de2c7446e7500ea4b9e8f Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Tue, 22 Oct 2024 13:47:16 +0200 Subject: [PATCH 33/34] Fix test --- .../integration/RoleMappingFileSettingsIT.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java index 8550a92f21960..fdd854e7a9673 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java @@ -46,6 +46,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -60,6 +61,7 @@ import static org.elasticsearch.xcontent.XContentType.JSON; import static org.elasticsearch.xpack.core.security.test.TestRestrictedIndices.INTERNAL_SECURITY_MAIN_INDEX_7; import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; @@ -367,13 +369,14 @@ public void testGetRoleMappings() throws Exception { ) ); - int readOnlyCount = 0; - // assert that cluster-state role mappings come last + List readOnlyFlags = new ArrayList<>(); for (ExpressionRoleMapping mapping : response.mappings()) { - readOnlyCount = ExpressionRoleMapping.hasReadOnlySuffix(mapping.getName()) ? readOnlyCount + 1 : readOnlyCount; + boolean isReadOnly = ExpressionRoleMapping.hasReadOnlySuffix(mapping.getName()) + && mapping.getMetadata().get("_read_only") != null; + readOnlyFlags.add(isReadOnly); } - // Two sourced from cluster-state - assertEquals(readOnlyCount, 2); + // assert that cluster-state role mappings come last + assertThat(readOnlyFlags, contains(false, false, false, false, true, true)); // it's possible to delete overlapping native role mapping assertTrue(client().execute(DeleteRoleMappingAction.INSTANCE, deleteRequest("everyone_kibana")).actionGet().isFound()); From e7cd5a870bea4259126f49b7d99c573f43b3c392 Mon Sep 17 00:00:00 2001 From: Nikolaj Volgushev Date: Tue, 22 Oct 2024 15:26:21 +0200 Subject: [PATCH 34/34] Update docs/changelog/114951.yaml --- docs/changelog/114951.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/changelog/114951.yaml diff --git a/docs/changelog/114951.yaml b/docs/changelog/114951.yaml new file mode 100644 index 0000000000000..4d40a063e2b02 --- /dev/null +++ b/docs/changelog/114951.yaml @@ -0,0 +1,5 @@ +pr: 114951 +summary: Expose cluster-state role mappings in APIs +area: Authentication +type: bug +issues: []