- All Known Implementing Classes:
BulkFeatures
,ClusterRerouteFeatures
,ClusterStatsFeatures
,IndexFeatures
,InfrastructureFeatures
,MapperFeatures
,RetrieversFeatures
,RoutingFeatures
,ScriptFeatures
,SearchFeatures
,SynonymFeatures
Features are published as part of node information in cluster state.
Code can check if all nodes in a cluster support a feature using FeatureService.clusterHasFeature(org.elasticsearch.cluster.ClusterState, org.elasticsearch.features.NodeFeature)
.
Once all nodes in a cluster support a feature, other nodes are blocked from joining that cluster
unless they also support that feature (this is known as the 'feature ratchet').
So once a feature is supported by a cluster, it will always be supported by that cluster in the future.
The only situation where features can be removed is on a compatibility boundary (normally a new major version).
Because a new major version can only form a cluster with the highest minor of the previous major,
any features introduced before that point can be assumed to always be present on that cluster.
The feature itself can be removed by marking it as assumed by NodeFeature.assumedAfterNextCompatibilityBoundary()
,
in the last minor, and then removing it and associated conditions in the new major version.
The feature information in cluster state should not normally be directly accessed.
All feature checks should be done through FeatureService
to ensure that Elasticsearch's
guarantees on the introduction of new functionality are followed;
that is, new functionality is not enabled until all nodes in the cluster support it.
Note: FeatureSpecification
s are loaded as service providers, however tests are not fully modularized yet.
Make sure to also register new specifications in META-INF/services/org.elasticsearch.features.FeatureSpecification
,
so they are available in tests as well.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Set
<NodeFeature> Returns a set of features that this node supports.default Set
<NodeFeature> Returns a set of test features that this node supports.
-
Method Details
-
getFeatures
Returns a set of features that this node supports. -
getTestFeatures
Returns a set of test features that this node supports.These features will only be exposed if the
tests.testfeatures.enabled
system property is set. This should only be used when deploying test clusters.
-