Skip to content

Commit 90b723b

Browse files
authored
Remove xpack actions for the flattened field. (#53076)
The current consensus is that we don't need info actions for smaller items like field mappers. We can also remove the usage action since the cluster stats API now tracks information about mappings, like what field types are defined.
1 parent 3265569 commit 90b723b

File tree

12 files changed

+4
-308
lines changed

12 files changed

+4
-308
lines changed

docs/reference/rest-api/info.asciidoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ Example response:
7575
"available" : true,
7676
"enabled" : true
7777
},
78-
"flattened" : {
79-
"available" : true,
80-
"enabled" : true
81-
},
8278
"frozen_indices" : {
8379
"available" : true,
8480
"enabled" : true

docs/reference/rest-api/usage.asciidoc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,6 @@ GET /_xpack/usage
242242
"available" : true,
243243
"enabled" : true
244244
},
245-
"flattened" : {
246-
"available" : true,
247-
"enabled" : true,
248-
"field_count" : 0
249-
},
250245
"vectors" : {
251246
"available" : true,
252247
"enabled" : true,
@@ -289,4 +284,4 @@ GET /_xpack/usage
289284
// 3. Ignore the contents of the `slm` object because it might contain policies
290285
// 4. All of the numbers and strings on the right hand side of *every* field in
291286
// the response are ignored. So we're really only asserting things about the
292-
// the shape of this response, not the values in it.
287+
// the shape of this response, not the values in it.

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata;
3939
import org.elasticsearch.xpack.core.deprecation.DeprecationInfoAction;
4040
import org.elasticsearch.xpack.core.eql.EqlFeatureSetUsage;
41-
import org.elasticsearch.xpack.core.flattened.FlattenedFeatureSetUsage;
4241
import org.elasticsearch.xpack.core.frozen.FrozenIndicesFeatureSetUsage;
4342
import org.elasticsearch.xpack.core.frozen.action.FreezeIndexAction;
4443
import org.elasticsearch.xpack.core.graph.GraphFeatureSetUsage;
@@ -556,7 +555,6 @@ public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
556555
new NamedWriteableRegistry.Entry(Task.Status.class, TransformField.TASK_NAME, TransformState::new),
557556
new NamedWriteableRegistry.Entry(PersistentTaskState.class, TransformField.TASK_NAME, TransformState::new),
558557
new NamedWriteableRegistry.Entry(SyncConfig.class, TransformField.TIME_BASED_SYNC.getPreferredName(), TimeSyncConfig::new),
559-
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.FLATTENED, FlattenedFeatureSetUsage::new),
560558
// Vectors
561559
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.VECTORS, VectorsFeatureSetUsage::new),
562560
// Voting Only Node

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackField.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public final class XPackField {
4242
/** Name constant for the transform feature. */
4343
public static final String TRANSFORM = "transform";
4444
/** Name constant for flattened fields. */
45-
public static final String FLATTENED = "flattened";
4645
/** Name constant for the vectors feature. */
4746
public static final String VECTORS = "vectors";
4847
/** Name constant for the voting-only-node feature. */

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackInfoFeatureAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class XPackInfoFeatureAction extends ActionType<XPackInfoFeatureResponse>
3535
public static final XPackInfoFeatureAction SNAPSHOT_LIFECYCLE = new XPackInfoFeatureAction(XPackField.SNAPSHOT_LIFECYCLE);
3636
public static final XPackInfoFeatureAction CCR = new XPackInfoFeatureAction(XPackField.CCR);
3737
public static final XPackInfoFeatureAction TRANSFORM = new XPackInfoFeatureAction(XPackField.TRANSFORM);
38-
public static final XPackInfoFeatureAction FLATTENED = new XPackInfoFeatureAction(XPackField.FLATTENED);
3938
public static final XPackInfoFeatureAction VECTORS = new XPackInfoFeatureAction(XPackField.VECTORS);
4039
public static final XPackInfoFeatureAction VOTING_ONLY = new XPackInfoFeatureAction(XPackField.VOTING_ONLY);
4140
public static final XPackInfoFeatureAction FROZEN_INDICES = new XPackInfoFeatureAction(XPackField.FROZEN_INDICES);
@@ -45,7 +44,7 @@ public class XPackInfoFeatureAction extends ActionType<XPackInfoFeatureResponse>
4544

4645
public static final List<XPackInfoFeatureAction> ALL = Arrays.asList(
4746
SECURITY, MONITORING, WATCHER, GRAPH, MACHINE_LEARNING, LOGSTASH, EQL, SQL, ROLLUP, INDEX_LIFECYCLE, SNAPSHOT_LIFECYCLE, CCR,
48-
TRANSFORM, FLATTENED, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, ENRICH
47+
TRANSFORM, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, ENRICH
4948
);
5049

5150
private XPackInfoFeatureAction(String name) {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/XPackUsageFeatureAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class XPackUsageFeatureAction extends ActionType<XPackUsageFeatureRespons
3535
public static final XPackUsageFeatureAction SNAPSHOT_LIFECYCLE = new XPackUsageFeatureAction(XPackField.SNAPSHOT_LIFECYCLE);
3636
public static final XPackUsageFeatureAction CCR = new XPackUsageFeatureAction(XPackField.CCR);
3737
public static final XPackUsageFeatureAction TRANSFORM = new XPackUsageFeatureAction(XPackField.TRANSFORM);
38-
public static final XPackUsageFeatureAction FLATTENED = new XPackUsageFeatureAction(XPackField.FLATTENED);
3938
public static final XPackUsageFeatureAction VECTORS = new XPackUsageFeatureAction(XPackField.VECTORS);
4039
public static final XPackUsageFeatureAction VOTING_ONLY = new XPackUsageFeatureAction(XPackField.VOTING_ONLY);
4140
public static final XPackUsageFeatureAction FROZEN_INDICES = new XPackUsageFeatureAction(XPackField.FROZEN_INDICES);
@@ -44,7 +43,7 @@ public class XPackUsageFeatureAction extends ActionType<XPackUsageFeatureRespons
4443

4544
public static final List<XPackUsageFeatureAction> ALL = Arrays.asList(
4645
SECURITY, MONITORING, WATCHER, GRAPH, MACHINE_LEARNING, LOGSTASH, EQL, SQL, ROLLUP, INDEX_LIFECYCLE, SNAPSHOT_LIFECYCLE, CCR,
47-
TRANSFORM, FLATTENED, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS
46+
TRANSFORM, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS
4847
);
4948

5049
private XPackUsageFeatureAction(String name) {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/flattened/FlattenedFeatureSetUsage.java

Lines changed: 0 additions & 62 deletions
This file was deleted.

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/flattened/FlattenedFeatureSetUsageTests.java

Lines changed: 0 additions & 47 deletions
This file was deleted.

x-pack/plugin/mapper-flattened/src/main/java/org/elasticsearch/xpack/flattened/FlattenedInfoTransportAction.java

Lines changed: 0 additions & 47 deletions
This file was deleted.

x-pack/plugin/mapper-flattened/src/main/java/org/elasticsearch/xpack/flattened/FlattenedMapperPlugin.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,19 @@
66

77
package org.elasticsearch.xpack.flattened;
88

9-
import org.elasticsearch.action.ActionRequest;
10-
import org.elasticsearch.action.ActionResponse;
119
import org.elasticsearch.common.settings.Settings;
1210
import org.elasticsearch.index.mapper.Mapper;
13-
import org.elasticsearch.plugins.ActionPlugin;
1411
import org.elasticsearch.plugins.MapperPlugin;
1512
import org.elasticsearch.plugins.Plugin;
1613
import org.elasticsearch.xpack.core.XPackSettings;
17-
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
18-
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
1914
import org.elasticsearch.xpack.flattened.mapper.FlatObjectFieldMapper;
2015

21-
import java.util.Arrays;
22-
import java.util.List;
2316
import java.util.Map;
2417

2518
import static java.util.Collections.emptyMap;
2619
import static java.util.Collections.singletonMap;
2720

28-
public class FlattenedMapperPlugin extends Plugin implements MapperPlugin, ActionPlugin {
21+
public class FlattenedMapperPlugin extends Plugin implements MapperPlugin {
2922

3023
protected final boolean enabled;
3124

@@ -40,11 +33,4 @@ public Map<String, Mapper.TypeParser> getMappers() {
4033
}
4134
return singletonMap(FlatObjectFieldMapper.CONTENT_TYPE, new FlatObjectFieldMapper.TypeParser());
4235
}
43-
44-
@Override
45-
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
46-
return Arrays.asList(
47-
new ActionHandler<>(XPackUsageFeatureAction.FLATTENED, FlattenedUsageTransportAction.class),
48-
new ActionHandler<>(XPackInfoFeatureAction.FLATTENED, FlattenedInfoTransportAction.class));
49-
}
5036
}

0 commit comments

Comments
 (0)