Skip to content

Commit 2336981

Browse files
committed
Remove pattern_text feature flag
1 parent 56e6660 commit 2336981

File tree

13 files changed

+11
-58
lines changed

13 files changed

+11
-58
lines changed

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/FeatureFlag.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public enum FeatureFlag {
2020
SUB_OBJECTS_AUTO_ENABLED("es.sub_objects_auto_feature_flag_enabled=true", Version.fromString("8.16.0"), null),
2121
DOC_VALUES_SKIPPER("es.doc_values_skipper_feature_flag_enabled=true", Version.fromString("8.18.1"), null),
2222
LOGS_STREAM("es.logs_stream_feature_flag_enabled=true", Version.fromString("9.1.0"), null),
23-
PATTERN_TEXT("es.pattern_text_feature_flag_enabled=true", Version.fromString("9.1.0"), null),
2423
SYNTHETIC_VECTORS("es.mapping_synthetic_vectors=true", Version.fromString("9.2.0"), null),
2524
INDEX_DIMENSIONS_TSID_OPTIMIZATION_FEATURE_FLAG(
2625
"es.index_dimensions_tsid_optimization_feature_flag_enabled=true",

x-pack/plugin/logsdb/src/javaRestTest/java/org/elasticsearch/xpack/logsdb/patterntext/PatternTextBasicRestIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public class PatternTextBasicRestIT extends ESRestTestCase {
3939
.distribution(DistributionType.DEFAULT)
4040
.setting("xpack.license.self_generated.type", "trial")
4141
.setting("xpack.security.enabled", "false")
42-
.feature(FeatureFlag.PATTERN_TEXT)
4342
.build();
4443

4544
@Override

x-pack/plugin/logsdb/src/javaRestTest/java/org/elasticsearch/xpack/logsdb/patterntext/PatternTextLicenseDowngradeIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class PatternTextLicenseDowngradeIT extends DataStreamLicenseChangeTestCa
2222
@Before
2323
public void checkClusterFeature() {
2424
assumeTrue("[patterned_text] must be available", clusterHasFeature("mapper.patterned_text"));
25-
assumeTrue("[patterned_text] is only available in snapshot builds", Build.current().isSnapshot());
2625
}
2726

2827
private static final String patternTextMapping = """

x-pack/plugin/logsdb/src/javaRestTest/java/org/elasticsearch/xpack/logsdb/patterntext/PatternTextLicenseUpgradeIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class PatternTextLicenseUpgradeIT extends DataStreamLicenseChangeTestCase
2222
@Before
2323
public void checkClusterFeature() {
2424
assumeTrue("[patterned_text] must be available", clusterHasFeature("mapper.patterned_text"));
25-
assumeTrue("[patterned_text] is only available in snapshot builds", Build.current().isSnapshot());
2625
}
2726

2827
private static final String patternTextMapping = """

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/LogsDBPlugin.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ public Collection<IndexSettingProvider> getAdditionalIndexSettingProviders(Index
9494

9595
@Override
9696
public List<Setting<?>> getSettings() {
97-
List<Setting<?>> settings = new ArrayList<>(List.of(FALLBACK_SETTING, CLUSTER_LOGSDB_ENABLED, LOGSDB_PRIOR_LOGS_USAGE));
98-
if (PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()) {
99-
settings.add(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING);
100-
}
101-
return Collections.unmodifiableList(settings);
97+
return List.of(FALLBACK_SETTING, CLUSTER_LOGSDB_ENABLED, LOGSDB_PRIOR_LOGS_USAGE, PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING);
10298
}
10399

104100
@Override
@@ -111,11 +107,7 @@ public List<ActionPlugin.ActionHandler> getActions() {
111107

112108
@Override
113109
public Map<String, Mapper.TypeParser> getMappers() {
114-
if (PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()) {
115110
return singletonMap(PatternTextFieldType.CONTENT_TYPE, PatternTextFieldMapper.PARSER);
116-
} else {
117-
return Map.of();
118-
}
119111
}
120112

121113
protected XPackLicenseState getLicenseState() {

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/LogsdbIndexModeSettingsProvider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ && matchesLogsPattern(dataStreamName)) {
192192
}
193193
}
194194

195-
if (PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()
196-
&& licenseService.allowPatternTextTemplating(isTemplateValidation) == false) {
195+
if (licenseService.allowPatternTextTemplating(isTemplateValidation) == false) {
197196
additionalSettings.put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true);
198197
}
199198
}

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/patterntext/PatternTextFieldMapper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
*/
5151
public class PatternTextFieldMapper extends FieldMapper {
5252

53-
public static final FeatureFlag PATTERN_TEXT_MAPPER = new FeatureFlag("pattern_text");
5453
private static final NamedAnalyzer STANDARD_ANALYZER = new NamedAnalyzer("standard", AnalyzerScope.GLOBAL, new StandardAnalyzer());
5554

5655
/**

x-pack/plugin/logsdb/src/test/java/org/elasticsearch/xpack/logsdb/LogsdbIndexModeSettingsProviderTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,6 @@ public void testExplicitRoutingPathNotAllowedByLicense() throws Exception {
960960
}
961961

962962
public void testPatternTextNotAllowedByLicense() throws Exception {
963-
assumeTrue("pattern_text feature must be enabled", PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled());
964-
965963
MockLicenseState licenseState = MockLicenseState.createMock();
966964
when(licenseState.copyCurrentLicenseState()).thenReturn(licenseState);
967965
when(licenseState.isAllowed(same(LogsdbLicenseService.PATTERN_TEXT_TEMPLATING_FEATURE))).thenReturn(false);

x-pack/plugin/logsdb/src/test/java/org/elasticsearch/xpack/logsdb/LogsdbIndexSettingsProviderLegacyLicenseTests.java

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ public void testGetAdditionalIndexSettingsDefault() {
7777
builder
7878
);
7979
var result = builder.build();
80-
var expectedBuilder = Settings.builder().put(IndexSettings.INDEX_MAPPER_SOURCE_MODE_SETTING.getKey(), "STORED");
81-
if (PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()) {
82-
expectedBuilder.put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true);
83-
}
84-
assertEquals(expectedBuilder.build(), result);
80+
var expected = Settings.builder().put(IndexSettings.INDEX_MAPPER_SOURCE_MODE_SETTING.getKey(), "STORED").put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build();
81+
assertEquals(expected, result);
8582
}
8683

8784
public void testGetAdditionalIndexSettingsApm() throws IOException {
@@ -101,17 +98,13 @@ public void testGetAdditionalIndexSettingsApm() throws IOException {
10198
builder
10299
);
103100
var result = builder.build();
104-
Settings expectedAdditionalSettings = PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()
105-
? Settings.builder().put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build()
106-
: Settings.EMPTY;
101+
Settings expectedAdditionalSettings = Settings.builder().put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build();
107102
assertEquals(expectedAdditionalSettings, result);
108103
}
109104

110105
public void testGetAdditionalIndexSettingsProfiling() throws IOException {
111106
Settings settings = Settings.builder().put(IndexSettings.INDEX_MAPPER_SOURCE_MODE_SETTING.getKey(), "SYNTHETIC").build();
112-
Settings expectedAdditionalSettings = PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()
113-
? Settings.builder().put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build()
114-
: Settings.EMPTY;
107+
Settings expectedAdditionalSettings = Settings.builder().put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build();
115108
for (String dataStreamName : new String[] { "profiling-metrics", "profiling-events" }) {
116109
String indexName = DataStream.getDefaultBackingIndexName(dataStreamName, 0);
117110
Settings.Builder builder = Settings.builder();
@@ -155,9 +148,7 @@ public void testGetAdditionalIndexSettingsTsdb() throws IOException {
155148
builder
156149
);
157150
var result = builder.build();
158-
Settings expectedAdditionalSettings = PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()
159-
? Settings.builder().put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build()
160-
: Settings.EMPTY;
151+
Settings expectedAdditionalSettings = Settings.builder().put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build();
161152
assertEquals(expectedAdditionalSettings, result);
162153
}
163154

@@ -200,13 +191,9 @@ public void testGetAdditionalIndexSettingsTsdbAfterCutoffDate() throws Exception
200191
IndexVersion.current(),
201192
builder
202193
);
203-
var result = builder.build();
204194

205-
var expectedBuilder = Settings.builder().put(IndexSettings.INDEX_MAPPER_SOURCE_MODE_SETTING.getKey(), "STORED");
206-
if (PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled()) {
207-
expectedBuilder.put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true);
208-
}
209-
210-
assertEquals(expectedBuilder.build(), result);
195+
var result = builder.build();
196+
var expected = Settings.builder().put(IndexSettings.INDEX_MAPPER_SOURCE_MODE_SETTING.getKey(), "STORED").put(PatternTextFieldMapper.DISABLE_TEMPLATING_SETTING.getKey(), true).build();
197+
assertEquals(expected, result);
211198
}
212199
}

x-pack/plugin/logsdb/src/test/java/org/elasticsearch/xpack/logsdb/patterntext/PatternTextFieldMapperTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ protected void assertExistsQuery(MappedFieldType fieldType, Query query, LuceneD
9191
assertNoFieldNamesField(fields);
9292
}
9393

94-
@Before
95-
public void setup() {
96-
assumeTrue("Only when pattern_text feature flag is enabled", PatternTextFieldMapper.PATTERN_TEXT_MAPPER.isEnabled());
97-
}
98-
9994
public void testExistsStandardSource() throws IOException {
10095
assertExistsQuery(createMapperService(fieldMapping(b -> b.field("type", "pattern_text"))));
10196
}

0 commit comments

Comments
 (0)