Skip to content

Commit

Permalink
Remove xpack actions for vector field (#75017)
Browse files Browse the repository at this point in the history
We have already decided not to have xpack usage for field mappers
(see #53076). As mappings stats of all fields is already tracked
in cluster stats.
Moreover xpack usage for vector field is a quite expensive operation
(see #74974).

This removes xpack actions for vector field.
  • Loading branch information
mayya-sharipova authored Jul 13, 2021
1 parent c061964 commit 23781bb
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 385 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = true
boolean bwc_tests_enabled = false
// place a PR link here when committing bwc changes:
String bwc_tests_disabled_issue = ""
String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/75017"
/*
* FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a
* JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/rest-api/info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ Example response:
"available" : true,
"enabled" : true
},
"vectors" : {
"available" : true,
"enabled" : true
},
"voting_only" : {
"available" : true,
"enabled" : true
Expand Down
6 changes: 0 additions & 6 deletions docs/reference/rest-api/usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,6 @@ GET /_xpack/usage
"available" : true,
"enabled" : true
},
"vectors" : {
"available" : true,
"enabled" : true,
"dense_vector_fields_count" : 0,
"dense_vector_dims_avg_count" : 0
},
"voting_only" : {
"available" : true,
"enabled" : true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
import org.elasticsearch.xpack.core.transform.transforms.TimeSyncConfig;
import org.elasticsearch.xpack.core.transform.transforms.TransformState;
import org.elasticsearch.xpack.core.transform.transforms.TransformTaskParams;
import org.elasticsearch.xpack.core.vectors.VectorsFeatureSetUsage;
import org.elasticsearch.xpack.core.votingonly.VotingOnlyNodeFeatureSetUsage;
import org.elasticsearch.xpack.core.watcher.WatcherFeatureSetUsage;
import org.elasticsearch.xpack.core.watcher.WatcherMetadata;
Expand Down Expand Up @@ -516,8 +515,6 @@ public List<NamedWriteableRegistry.Entry> getNamedWriteables() {
TransformField.TIME.getPreferredName(),
TimeRetentionPolicyConfig::new
),
// Vectors
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.VECTORS, VectorsFeatureSetUsage::new),
// Voting Only Node
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.VOTING_ONLY, VotingOnlyNodeFeatureSetUsage::new),
// Frozen indices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public final class XPackField {
*/
@Deprecated
public static final String FLATTENED = "flattened";
@Deprecated
/** Name constant for the vectors feature. */
public static final String VECTORS = "vectors";
/** Name constant for the voting-only-node feature. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class XPackInfoFeatureAction extends ActionType<XPackInfoFeatureResponse>
public static final XPackInfoFeatureAction SNAPSHOT_LIFECYCLE = new XPackInfoFeatureAction(XPackField.SNAPSHOT_LIFECYCLE);
public static final XPackInfoFeatureAction CCR = new XPackInfoFeatureAction(XPackField.CCR);
public static final XPackInfoFeatureAction TRANSFORM = new XPackInfoFeatureAction(XPackField.TRANSFORM);
public static final XPackInfoFeatureAction VECTORS = new XPackInfoFeatureAction(XPackField.VECTORS);
public static final XPackInfoFeatureAction VOTING_ONLY = new XPackInfoFeatureAction(XPackField.VOTING_ONLY);
public static final XPackInfoFeatureAction FROZEN_INDICES = new XPackInfoFeatureAction(XPackField.FROZEN_INDICES);
public static final XPackInfoFeatureAction SPATIAL = new XPackInfoFeatureAction(XPackField.SPATIAL);
Expand All @@ -54,7 +53,7 @@ public class XPackInfoFeatureAction extends ActionType<XPackInfoFeatureResponse>
final List<XPackInfoFeatureAction> actions = new ArrayList<>();
actions.addAll(Arrays.asList(
SECURITY, MONITORING, WATCHER, GRAPH, MACHINE_LEARNING, LOGSTASH, EQL, SQL, ROLLUP, INDEX_LIFECYCLE, SNAPSHOT_LIFECYCLE, CCR,
TRANSFORM, VECTORS, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, ENRICH, DATA_STREAMS, SEARCHABLE_SNAPSHOTS, DATA_TIERS,
TRANSFORM, VOTING_ONLY, FROZEN_INDICES, SPATIAL, ANALYTICS, ENRICH, DATA_STREAMS, SEARCHABLE_SNAPSHOTS, DATA_TIERS,
AGGREGATE_METRIC
));
ALL = Collections.unmodifiableList(actions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class XPackUsageFeatureAction extends ActionType<XPackUsageFeatureRespons
public static final XPackUsageFeatureAction SNAPSHOT_LIFECYCLE = new XPackUsageFeatureAction(XPackField.SNAPSHOT_LIFECYCLE);
public static final XPackUsageFeatureAction CCR = new XPackUsageFeatureAction(XPackField.CCR);
public static final XPackUsageFeatureAction TRANSFORM = new XPackUsageFeatureAction(XPackField.TRANSFORM);
public static final XPackUsageFeatureAction VECTORS = new XPackUsageFeatureAction(XPackField.VECTORS);
public static final XPackUsageFeatureAction VOTING_ONLY = new XPackUsageFeatureAction(XPackField.VOTING_ONLY);
public static final XPackUsageFeatureAction FROZEN_INDICES = new XPackUsageFeatureAction(XPackField.FROZEN_INDICES);
public static final XPackUsageFeatureAction SPATIAL = new XPackUsageFeatureAction(XPackField.SPATIAL);
Expand Down Expand Up @@ -66,7 +65,6 @@ public class XPackUsageFeatureAction extends ActionType<XPackUsageFeatureRespons
SPATIAL,
SQL,
TRANSFORM,
VECTORS,
VOTING_ONLY,
WATCHER
);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ public class Constants {
"cluster:monitor/xpack/info/spatial",
"cluster:monitor/xpack/info/sql",
"cluster:monitor/xpack/info/transform",
"cluster:monitor/xpack/info/vectors",
"cluster:monitor/xpack/info/voting_only",
"cluster:monitor/xpack/info/watcher",
"cluster:monitor/xpack/license/get",
Expand Down Expand Up @@ -331,7 +330,6 @@ public class Constants {
"cluster:monitor/xpack/usage/spatial",
"cluster:monitor/xpack/usage/sql",
"cluster:monitor/xpack/usage/transform",
"cluster:monitor/xpack/usage/vectors",
"cluster:monitor/xpack/usage/voting_only",
"cluster:monitor/xpack/usage/watcher",
"cluster:monitor/xpack/watcher/stats/dist",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,20 @@

package org.elasticsearch.xpack.vectors;

import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
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.core.action.XPackInfoFeatureAction;
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
import org.elasticsearch.xpack.vectors.mapper.DenseVectorFieldMapper;
import org.elasticsearch.xpack.vectors.mapper.SparseVectorFieldMapper;

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

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

public Vectors() { }

@Override
public List<ActionPlugin.ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return Arrays.asList(
new ActionPlugin.ActionHandler<>(XPackUsageFeatureAction.VECTORS, VectorsUsageTransportAction.class),
new ActionPlugin.ActionHandler<>(XPackInfoFeatureAction.VECTORS, VectorsInfoTransportAction.class));
}

@Override
public Map<String, Mapper.TypeParser> getMappers() {
Map<String, Mapper.TypeParser> mappers = new LinkedHashMap<>();
Expand Down

This file was deleted.

Loading

0 comments on commit 23781bb

Please sign in to comment.