Skip to content

Commit

Permalink
Merge branch 'main' into ipinfo-database-configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Oct 11, 2024
2 parents 8b1953b + ddd576e commit c3c785f
Show file tree
Hide file tree
Showing 21 changed files with 468 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,26 @@ private DeleteDataStreamLifecycleAction() {/* no instances */}
public static final class Request extends AcknowledgedRequest<Request> implements IndicesRequest.Replaceable {

private String[] names;
private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false);
private IndicesOptions indicesOptions = IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(true)
.includeHidden(false)
.resolveAliases(false)
.allowEmptyExpressions(true)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(false)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(false)
.build()
)
.build();

public Request(StreamInput in) throws IOException {
super(in);
Expand Down
9 changes: 6 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ tests:
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
method: test {yaml=cluster.stats/30_ccs_stats/cross-cluster search stats search}
issue: https://github.com/elastic/elasticsearch/issues/114371
- class: org.elasticsearch.xpack.esql.qa.single_node.RestEsqlIT
method: testProfileOrdinalsGroupingOperator {SYNC}
issue: https://github.com/elastic/elasticsearch/issues/114380
- class: org.elasticsearch.xpack.inference.services.cohere.CohereServiceTests
method: testInfer_StreamRequest
issue: https://github.com/elastic/elasticsearch/issues/114385
Expand Down Expand Up @@ -384,6 +381,12 @@ tests:
- class: org.elasticsearch.datastreams.logsdb.qa.LogsDbVersusLogsDbReindexedIntoStandardModeChallengeRestIT
method: testMatchAllQuery
issue: https://github.com/elastic/elasticsearch/issues/114607
- class: org.elasticsearch.xpack.esql.optimizer.PhysicalPlanOptimizerTests
method: testPushSpatialIntersectsEvalToSource {default}
issue: https://github.com/elastic/elasticsearch/issues/114627
- class: org.elasticsearch.xpack.esql.optimizer.PhysicalPlanOptimizerTests
method: testPushWhereEvalToSource {default}
issue: https://github.com/elastic/elasticsearch/issues/114628

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ setup:
element_type: byte
index_options:
type: hnsw
m: 16
ef_construction: 100
vector2:
type: dense_vector
dims: 1024
index: true
similarity: dot_product
index_options:
type: int8_hnsw
vector3:
type: dense_vector
dims: 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ static TransportVersion def(int id) {
public static final TransportVersion SIMULATE_INDEX_TEMPLATES_SUBSTITUTIONS = def(8_764_00_0);
public static final TransportVersion RETRIEVERS_TELEMETRY_ADDED = def(8_765_00_0);
public static final TransportVersion ESQL_CACHED_STRING_SERIALIZATION = def(8_766_00_0);
public static final TransportVersion CHUNK_SENTENCE_OVERLAP_SETTING_ADDED = def(8_767_00_0);

/*
* STOP! READ THIS FIRST! No, really,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,26 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
// indices options that require every specified index to exist, expand wildcards only to open
// indices, don't allow that no indices are resolved from wildcard expressions and resolve the
// expressions only against indices
private static final IndicesOptions INDICES_OPTIONS = IndicesOptions.fromOptions(false, false, true, false, true, false, true, false);
private static final IndicesOptions INDICES_OPTIONS = IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(false)
.includeHidden(false)
.resolveAliases(false)
.allowEmptyExpressions(false)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(true)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(true)
.build()
)
.build();

public IndicesAliasesRequest(StreamInput in) throws IOException {
super(in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,25 @@
*/
public class DeleteIndexRequest extends AcknowledgedRequest<DeleteIndexRequest> implements IndicesRequest.Replaceable {

public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.fromOptions(
false,
true,
true,
true,
false,
false,
true,
false
);
public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(true)
.allowEmptyExpressions(true)
.resolveAliases(false)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(false)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(true)
.build()
)
.build();

private String[] indices;
// Delete index should work by default on both open and closed indices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,32 @@ public static class Request extends BroadcastRequest<Request> {
public Request() {
// this doesn't really matter since data stream name resolution isn't affected by IndicesOptions and
// a data stream's backing indices are retrieved from its metadata
super(null, IndicesOptions.fromOptions(false, true, true, true, true, false, true, false));
super(
null,
IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(true)
.includeHidden(false)
.resolveAliases(false)
.allowEmptyExpressions(true)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(true)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(true)
.build()
)
.failureStoreOptions(
IndicesOptions.FailureStoreOptions.builder().includeRegularIndices(true).includeFailureIndices(true).build()
)
.build()
);
}

public Request(StreamInput in) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,25 @@ public static class Request extends MasterNodeRequest<Request> implements Indice
// empty response can be returned in case wildcards were used or
// 404 status code returned in case no wildcard were used.
private final boolean wildcardExpressionsOriginallySpecified;
private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false);
private IndicesOptions indicesOptions = IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(true)
.resolveAliases(false)
.allowEmptyExpressions(true)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(false)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(true)
.build()
)
.build();

public Request(TimeValue masterNodeTimeout, String... names) {
super(masterNodeTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,26 @@ private GetDataStreamAction() {
public static class Request extends MasterNodeReadRequest<Request> implements IndicesRequest.Replaceable {

private String[] names;
private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false);
private IndicesOptions indicesOptions = IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(true)
.includeHidden(false)
.resolveAliases(false)
.allowEmptyExpressions(true)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(false)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(true)
.build()
)
.build();
private boolean includeDefaults = false;
private boolean verbose = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,26 @@ private GetDataStreamLifecycleAction() {/* no instances */}
public static class Request extends MasterNodeReadRequest<Request> implements IndicesRequest.Replaceable {

private String[] names;
private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false);
private IndicesOptions indicesOptions = IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(true)
.includeHidden(false)
.resolveAliases(false)
.allowEmptyExpressions(true)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(false)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(true)
.build()
)
.build();
private boolean includeDefaults = false;

public Request(TimeValue masterNodeTimeout, String[] names) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,26 @@ public static Request parseRequest(XContentParser parser, Factory factory) {
}

private String[] names;
private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false);
private IndicesOptions indicesOptions = IndicesOptions.builder()
.concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS)
.wildcardOptions(
IndicesOptions.WildcardOptions.builder()
.matchOpen(true)
.matchClosed(true)
.includeHidden(false)
.resolveAliases(false)
.allowEmptyExpressions(true)
.build()
)
.gatekeeperOptions(
IndicesOptions.GatekeeperOptions.builder()
.allowAliasToMultipleIndices(false)
.allowClosedIndices(true)
.ignoreThrottled(false)
.allowFailureIndices(false)
.build()
)
.build();
private final DataStreamLifecycle lifecycle;

public Request(StreamInput in) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.startsWith;
Expand Down Expand Up @@ -331,14 +332,13 @@ public void testProfile() throws IOException {
}

public void testProfileOrdinalsGroupingOperator() throws IOException {
assumeTrue("requires pragmas", Build.current().isSnapshot());
indexTimestampData(1);

RequestObjectBuilder builder = requestObjectBuilder().query(fromIndex() + " | STATS AVG(value) BY test.keyword");
builder.profile(true);
if (Build.current().isSnapshot()) {
// Lock to shard level partitioning, so we get consistent profile output
builder.pragmas(Settings.builder().put("data_partitioning", "shard").build());
}
// Lock to shard level partitioning, so we get consistent profile output
builder.pragmas(Settings.builder().put("data_partitioning", "shard").build());
Map<String, Object> result = runEsql(builder);

List<List<String>> signatures = new ArrayList<>();
Expand All @@ -356,7 +356,7 @@ public void testProfileOrdinalsGroupingOperator() throws IOException {
signatures.add(sig);
}

assertThat(signatures.get(0).get(2), equalTo("OrdinalsGroupingOperator[aggregators=[\"sum of longs\", \"count\"]]"));
assertThat(signatures, hasItem(hasItem("OrdinalsGroupingOperator[aggregators=[\"sum of longs\", \"count\"]]")));
}

public void testInlineStatsProfile() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
public enum ChunkingSettingsOptions {
STRATEGY("strategy"),
MAX_CHUNK_SIZE("max_chunk_size"),
OVERLAP("overlap");
OVERLAP("overlap"),
SENTENCE_OVERLAP("sentence_overlap");

private final String chunkingSettingsOption;

Expand Down
Loading

0 comments on commit c3c785f

Please sign in to comment.