Skip to content

Commit c27dc5f

Browse files
authored
Remove data stream feature flag, (#59504)
so that it can used in the next minor release (7.9.0). Closes #53100
1 parent d1e8a47 commit c27dc5f

File tree

10 files changed

+12
-79
lines changed

10 files changed

+12
-79
lines changed

build.gradle

-11
Original file line numberDiff line numberDiff line change
@@ -475,17 +475,6 @@ allprojects {
475475
}
476476
}
477477

478-
// TODO: remove this once 7.7 is released and the 7.x branch is 7.8
479-
subprojects {
480-
pluginManager.withPlugin('elasticsearch.testclusters') {
481-
testClusters.all {
482-
if (org.elasticsearch.gradle.info.BuildParams.isSnapshotBuild() == false) {
483-
systemProperty 'es.datastreams_feature_enabled', 'true'
484-
}
485-
}
486-
}
487-
}
488-
489478
subprojects {
490479
project.ext.disableTasks = { String... tasknames ->
491480
for (String taskname : tasknames) {

server/build.gradle

-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.elasticsearch.gradle.info.BuildParams
2-
31
/*
42
* Licensed to Elasticsearch under one or more contributor
53
* license agreements. See the NOTICE file distributed with
@@ -296,9 +294,3 @@ licenseHeaders {
296294
// Ignore our vendored version of Google Guice
297295
excludes << 'org/elasticsearch/common/inject/**/*'
298296
}
299-
300-
tasks.named('internalClusterTest').configure {
301-
if (org.elasticsearch.gradle.info.BuildParams.isSnapshotBuild() == false) {
302-
systemProperty 'es.datastreams_feature_enabled', 'true'
303-
}
304-
}

server/src/main/java/org/elasticsearch/action/ActionModule.java

+10-30
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import org.apache.logging.log4j.LogManager;
2323
import org.apache.logging.log4j.Logger;
24-
import org.elasticsearch.Build;
2524
import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainAction;
2625
import org.elasticsearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction;
2726
import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsAction;
@@ -415,21 +414,6 @@ public class ActionModule extends AbstractModule {
415414

416415
private static final Logger logger = LogManager.getLogger(ActionModule.class);
417416

418-
public static final boolean DATASTREAMS_FEATURE_ENABLED;
419-
420-
static {
421-
final String property = System.getProperty("es.datastreams_feature_enabled");
422-
if (Build.CURRENT.isSnapshot() || "true".equals(property)) {
423-
DATASTREAMS_FEATURE_ENABLED = true;
424-
} else if ("false".equals(property) || property == null) {
425-
DATASTREAMS_FEATURE_ENABLED = false;
426-
} else {
427-
throw new IllegalArgumentException(
428-
"expected es.datastreams_feature_enabled to be unset or [true|false] but was [" + property + "]"
429-
);
430-
}
431-
}
432-
433417
private final Settings settings;
434418
private final IndexNameExpressionResolver indexNameExpressionResolver;
435419
private final IndexScopedSettings indexScopedSettings;
@@ -616,13 +600,11 @@ public <Request extends ActionRequest, Response extends ActionResponse> void reg
616600
actionPlugins.stream().flatMap(p -> p.getActions().stream()).forEach(actions::register);
617601

618602
// Data streams:
619-
if (DATASTREAMS_FEATURE_ENABLED) {
620-
actions.register(CreateDataStreamAction.INSTANCE, CreateDataStreamAction.TransportAction.class);
621-
actions.register(DeleteDataStreamAction.INSTANCE, DeleteDataStreamAction.TransportAction.class);
622-
actions.register(GetDataStreamAction.INSTANCE, GetDataStreamAction.TransportAction.class);
623-
actions.register(ResolveIndexAction.INSTANCE, ResolveIndexAction.TransportAction.class);
624-
actions.register(DataStreamsStatsAction.INSTANCE, DataStreamsStatsAction.TransportAction.class);
625-
}
603+
actions.register(CreateDataStreamAction.INSTANCE, CreateDataStreamAction.TransportAction.class);
604+
actions.register(DeleteDataStreamAction.INSTANCE, DeleteDataStreamAction.TransportAction.class);
605+
actions.register(GetDataStreamAction.INSTANCE, GetDataStreamAction.TransportAction.class);
606+
actions.register(ResolveIndexAction.INSTANCE, ResolveIndexAction.TransportAction.class);
607+
actions.register(DataStreamsStatsAction.INSTANCE, DataStreamsStatsAction.TransportAction.class);
626608

627609
// Persistent tasks:
628610
actions.register(StartPersistentTaskAction.INSTANCE, StartPersistentTaskAction.TransportAction.class);
@@ -793,13 +775,11 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {
793775
registerHandler.accept(new RestDeleteDanglingIndexAction());
794776

795777
// Data Stream API
796-
if (DATASTREAMS_FEATURE_ENABLED) {
797-
registerHandler.accept(new RestCreateDataStreamAction());
798-
registerHandler.accept(new RestDeleteDataStreamAction());
799-
registerHandler.accept(new RestGetDataStreamsAction());
800-
registerHandler.accept(new RestResolveIndexAction());
801-
registerHandler.accept(new RestDataStreamsStatsAction());
802-
}
778+
registerHandler.accept(new RestCreateDataStreamAction());
779+
registerHandler.accept(new RestDeleteDataStreamAction());
780+
registerHandler.accept(new RestGetDataStreamsAction());
781+
registerHandler.accept(new RestResolveIndexAction());
782+
registerHandler.accept(new RestDataStreamsStatsAction());
803783

804784
// CAT API
805785
registerHandler.accept(new RestAllocationAction());

test/framework/src/main/java/org/elasticsearch/test/TestCluster.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import org.apache.logging.log4j.LogManager;
2525
import org.apache.logging.log4j.Logger;
26-
import org.elasticsearch.action.ActionModule;
2726
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
2827
import org.elasticsearch.action.admin.indices.datastream.DeleteDataStreamAction;
2928
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
@@ -136,7 +135,7 @@ public void assertAfterTest() throws IOException {
136135
*/
137136
public void wipeAllDataStreams() {
138137
// Feature flag may not be enabled in all gradle modules that use ESIntegTestCase
139-
if (size() > 0 && ActionModule.DATASTREAMS_FEATURE_ENABLED) {
138+
if (size() > 0) {
140139
AcknowledgedResponse response =
141140
client().admin().indices().deleteDataStream(new DeleteDataStreamAction.Request(new String[]{"*"})).actionGet();
142141
assertAcked(response);

x-pack/plugin/data-streams/build.gradle

-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.elasticsearch.gradle.info.BuildParams
2-
31
evaluationDependsOn(xpackModule('core'))
42

53
apply plugin: 'elasticsearch.esplugin'
@@ -13,17 +11,6 @@ esplugin {
1311
archivesBaseName = 'x-pack-data-streams'
1412
integTest.enabled = false
1513

16-
tasks.named('internalClusterTest').configure {
17-
if (BuildParams.isSnapshotBuild() == false) {
18-
systemProperty 'es.datastreams_feature_enabled', 'true'
19-
}
20-
}
21-
tasks.named('test').configure {
22-
if (org.elasticsearch.gradle.info.BuildParams.isSnapshotBuild() == false) {
23-
systemProperty 'es.datastreams_feature_enabled', 'true'
24-
}
25-
}
26-
2714
dependencies {
2815
compileOnly project(path: xpackModule('core'), configuration: 'default')
2916
testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')

x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/DataStreamsPlugin.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,11 @@
2020
import java.util.List;
2121
import java.util.Map;
2222

23-
import static org.elasticsearch.action.ActionModule.DATASTREAMS_FEATURE_ENABLED;
24-
2523
public class DataStreamsPlugin extends Plugin implements ActionPlugin, MapperPlugin {
2624

2725
@Override
2826
public Map<String, MetadataFieldMapper.TypeParser> getMetadataMappers() {
29-
if (DATASTREAMS_FEATURE_ENABLED) {
30-
return Map.of(DataStreamTimestampFieldMapper.NAME, new DataStreamTimestampFieldMapper.TypeParser());
31-
} else {
32-
return Map.of();
33-
}
27+
return Map.of(DataStreamTimestampFieldMapper.NAME, new DataStreamTimestampFieldMapper.TypeParser());
3428
}
3529

3630
@Override

x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.apache.logging.log4j.message.ParameterizedMessage;
99
import org.elasticsearch.ElasticsearchException;
1010
import org.elasticsearch.ElasticsearchStatusException;
11-
import org.elasticsearch.action.ActionModule;
1211
import org.elasticsearch.action.DocWriteRequest;
1312
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
1413
import org.elasticsearch.action.bulk.BulkRequestBuilder;
@@ -145,7 +144,6 @@ public void testSingleNumericFeatureAndMixedTrainingAndNonTrainingRows() throws
145144
}
146145

147146
public void testWithDatastreams() throws Exception {
148-
assumeTrue("should only run if data streams are enabled", ActionModule.DATASTREAMS_FEATURE_ENABLED);
149147
initialize("classification_with_datastreams", true);
150148
String predictedClassField = KEYWORD_FIELD + "_prediction";
151149
indexData(sourceIndex, 300, 50, KEYWORD_FIELD);

x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsIT.java

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import org.elasticsearch.ResourceNotFoundException;
99
import org.elasticsearch.Version;
10-
import org.elasticsearch.action.ActionModule;
1110
import org.elasticsearch.action.admin.cluster.node.hotthreads.NodeHotThreads;
1211
import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsResponse;
1312
import org.elasticsearch.action.support.master.AcknowledgedResponse;
@@ -101,7 +100,6 @@ public void testLookbackOnly() throws Exception {
101100
}
102101

103102
public void testLookbackOnlyDataStream() throws Exception {
104-
assumeTrue("should only run if data streams are enabled", ActionModule.DATASTREAMS_FEATURE_ENABLED);
105103
String mapping = "{\n" +
106104
" \"properties\": {\n" +
107105
" \"time\": {\n" +

x-pack/plugin/ml/qa/native-multi-node-tests/src/test/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package org.elasticsearch.xpack.ml.integration;
77

88
import org.elasticsearch.ElasticsearchException;
9-
import org.elasticsearch.action.ActionModule;
109
import org.elasticsearch.action.DocWriteRequest;
1110
import org.elasticsearch.action.bulk.BulkRequestBuilder;
1211
import org.elasticsearch.action.bulk.BulkResponse;
@@ -397,7 +396,6 @@ public void testDependentVariableIsLong() throws Exception {
397396
}
398397

399398
public void testWithDatastream() throws Exception {
400-
assumeTrue("should only run if data streams are enabled", ActionModule.DATASTREAMS_FEATURE_ENABLED);
401399
initialize("regression_with_datastream");
402400
String predictedClassField = DEPENDENT_VARIABLE_FIELD + "_prediction";
403401
indexData(sourceIndex, 300, 50, true);

x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import org.apache.http.entity.ContentType;
1010
import org.apache.http.entity.StringEntity;
11-
import org.elasticsearch.action.ActionModule;
1211
import org.elasticsearch.client.Request;
1312
import org.elasticsearch.client.ResponseException;
1413
import org.elasticsearch.common.Strings;
@@ -97,7 +96,6 @@ public void testSimplePivot() throws Exception {
9796
}
9897

9998
public void testSimpleDataStreamPivot() throws Exception {
100-
assumeTrue("should only run if data streams are enabled", ActionModule.DATASTREAMS_FEATURE_ENABLED);
10199
String indexName = "reviews_data_stream";
102100
createReviewsIndex(indexName, 1000, "date", true);
103101
String transformId = "simple_data_stream_pivot";

0 commit comments

Comments
 (0)