Skip to content

Commit 35ae3d1

Browse files
authored
Remove data stream feature flag (#59572)
so that it can used in the next minor release (7.9.0). Backport of #59504 to 7.x branch. Closes #53100
1 parent 3b688bf commit 35ae3d1

File tree

10 files changed

+13
-78
lines changed

10 files changed

+13
-78
lines changed

build.gradle

-11
Original file line numberDiff line numberDiff line change
@@ -484,17 +484,6 @@ allprojects {
484484
}
485485
}
486486

487-
// TODO: remove this once 7.7 is released and the 7.x branch is 7.8
488-
subprojects {
489-
pluginManager.withPlugin('elasticsearch.testclusters') {
490-
testClusters.all {
491-
if (org.elasticsearch.gradle.info.BuildParams.isSnapshotBuild() == false) {
492-
systemProperty 'es.datastreams_feature_enabled', 'true'
493-
}
494-
}
495-
}
496-
}
497-
498487
subprojects {
499488
project.ext.disableTasks = { String... tasknames ->
500489
for (String taskname : tasknames) {

server/build.gradle

+1-7
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ dependencies {
122122

123123
// repackaged jna with native bits linked against all elastic supported platforms
124124
api "org.elasticsearch:jna:${versions.jna}"
125-
125+
126126
testImplementation(project(":test:framework")) {
127127
// tests use the locally compiled version of server
128128
exclude group: 'org.elasticsearch', module: 'server'
@@ -333,12 +333,6 @@ licenseHeaders {
333333
excludes << 'org/elasticsearch/common/inject/**/*'
334334
}
335335

336-
tasks.named('internalClusterTest').configure {
337-
if (org.elasticsearch.gradle.info.BuildParams.isSnapshotBuild() == false) {
338-
systemProperty 'es.datastreams_feature_enabled', 'true'
339-
}
340-
}
341-
342336
licenseHeaders {
343337
excludes << 'org/elasticsearch/client/documentation/placeholder.txt'
344338
}

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;
@@ -416,21 +415,6 @@ public class ActionModule extends AbstractModule {
416415
private static final Logger logger = LogManager.getLogger(ActionModule.class);
417416

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

629613
// Data streams:
630-
if (DATASTREAMS_FEATURE_ENABLED) {
631-
actions.register(CreateDataStreamAction.INSTANCE, CreateDataStreamAction.TransportAction.class);
632-
actions.register(DeleteDataStreamAction.INSTANCE, DeleteDataStreamAction.TransportAction.class);
633-
actions.register(GetDataStreamAction.INSTANCE, GetDataStreamAction.TransportAction.class);
634-
actions.register(ResolveIndexAction.INSTANCE, ResolveIndexAction.TransportAction.class);
635-
actions.register(DataStreamsStatsAction.INSTANCE, DataStreamsStatsAction.TransportAction.class);
636-
}
614+
actions.register(CreateDataStreamAction.INSTANCE, CreateDataStreamAction.TransportAction.class);
615+
actions.register(DeleteDataStreamAction.INSTANCE, DeleteDataStreamAction.TransportAction.class);
616+
actions.register(GetDataStreamAction.INSTANCE, GetDataStreamAction.TransportAction.class);
617+
actions.register(ResolveIndexAction.INSTANCE, ResolveIndexAction.TransportAction.class);
618+
actions.register(DataStreamsStatsAction.INSTANCE, DataStreamsStatsAction.TransportAction.class);
637619

638620
// Persistent tasks:
639621
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;
@@ -141,7 +140,7 @@ public void assertAfterTest() throws IOException {
141140
*/
142141
public void wipeAllDataStreams() {
143142
// Feature flag may not be enabled in all gradle modules that use ESIntegTestCase
144-
if (size() > 0 && ActionModule.DATASTREAMS_FEATURE_ENABLED) {
143+
if (size() > 0) {
145144
AcknowledgedResponse response =
146145
client().admin().indices().deleteDataStream(new DeleteDataStreamAction.Request(new String[]{"*"})).actionGet();
147146
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
@@ -21,8 +21,6 @@
2121
import java.util.List;
2222
import java.util.Map;
2323

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

2826
private final boolean transportClientMode;
@@ -33,11 +31,7 @@ public DataStreamsPlugin(Settings settings) {
3331

3432
@Override
3533
public Map<String, MetadataFieldMapper.TypeParser> getMetadataMappers() {
36-
if (DATASTREAMS_FEATURE_ENABLED) {
37-
return Collections.singletonMap(DataStreamTimestampFieldMapper.NAME, new DataStreamTimestampFieldMapper.TypeParser());
38-
} else {
39-
return Collections.emptyMap();
40-
}
34+
return Collections.singletonMap(DataStreamTimestampFieldMapper.NAME, new DataStreamTimestampFieldMapper.TypeParser());
4135
}
4236

4337
public Collection<Module> createGuiceModules() {

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;
@@ -147,7 +146,6 @@ public void testSingleNumericFeatureAndMixedTrainingAndNonTrainingRows() throws
147146
}
148147

149148
public void testWithDatastreams() throws Exception {
150-
assumeTrue("should only run if data streams are enabled", ActionModule.DATASTREAMS_FEATURE_ENABLED);
151149
initialize("classification_with_datastreams", true);
152150
String predictedClassField = KEYWORD_FIELD + "_prediction";
153151
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;
@@ -103,7 +102,6 @@ public void testLookbackOnly() throws Exception {
103102
}
104103

105104
public void testLookbackOnlyDataStream() throws Exception {
106-
assumeTrue("should only run if data streams are enabled", ActionModule.DATASTREAMS_FEATURE_ENABLED);
107105
String mapping = "{\n" +
108106
" \"properties\": {\n" +
109107
" \"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;
@@ -399,7 +398,6 @@ public void testDependentVariableIsLong() throws Exception {
399398
}
400399

401400
public void testWithDatastream() throws Exception {
402-
assumeTrue("should only run if data streams are enabled", ActionModule.DATASTREAMS_FEATURE_ENABLED);
403401
initialize("regression_with_datastream");
404402
String predictedClassField = DEPENDENT_VARIABLE_FIELD + "_prediction";
405403
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)