Skip to content

Commit

Permalink
Remove constant_keyword from the info API. (#53071)
Browse files Browse the repository at this point in the history
I discussed with @rjernst about what kind of functionality should be
reported in the info API, since it doesn't sound sensible to list every
single feature there. As a guideline, Ryan suggested that functionality
that needs to maintain state should definitely be in the info API, but
probably not field mappers like `constant_keyword`.
  • Loading branch information
jpountz authored Mar 4, 2020
1 parent 2a9c1f8 commit dbe6769
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 64 deletions.
4 changes: 0 additions & 4 deletions docs/reference/rest-api/info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ Example response:
"available" : true,
"enabled" : true
},
"constant_keyword" : {
"available" : true,
"enabled" : true
},
"enrich" : {
"available" : true,
"enabled" : true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public final class XPackField {
public static final String ANALYTICS = "analytics";
/** Name constant for the enrich plugin. */
public static final String ENRICH = "enrich";
/** Name constant for the constant-keyword plugin. */
public static final String CONSTANT_KEYWORD = "constant_keyword";

private XPackField() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ public class XPackInfoFeatureAction extends ActionType<XPackInfoFeatureResponse>
public static final XPackInfoFeatureAction SPATIAL = new XPackInfoFeatureAction(XPackField.SPATIAL);
public static final XPackInfoFeatureAction ANALYTICS = new XPackInfoFeatureAction(XPackField.ANALYTICS);
public static final XPackInfoFeatureAction ENRICH = new XPackInfoFeatureAction(XPackField.ENRICH);
public static final XPackInfoFeatureAction CONSTANT_KEYWORD = new XPackInfoFeatureAction(XPackField.CONSTANT_KEYWORD);

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

private XPackInfoFeatureAction(String name) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,17 @@

package org.elasticsearch.xpack.constantkeyword;

import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.MapperPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.constantkeyword.mapper.ConstantKeywordFieldMapper;
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import static java.util.Collections.singletonMap;

public class ConstantKeywordMapperPlugin extends Plugin implements MapperPlugin, ActionPlugin {
public class ConstantKeywordMapperPlugin extends Plugin implements MapperPlugin {

public ConstantKeywordMapperPlugin(Settings settings) {}

Expand All @@ -31,9 +25,4 @@ public Map<String, Mapper.TypeParser> getMappers() {
return singletonMap(ConstantKeywordFieldMapper.CONTENT_TYPE, new ConstantKeywordFieldMapper.TypeParser());
}

@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return Arrays.asList(
new ActionHandler<>(XPackInfoFeatureAction.CONSTANT_KEYWORD, ConstantKeywordInfoTransportAction.class));
}
}

0 comments on commit dbe6769

Please sign in to comment.