Skip to content

Commit

Permalink
Fix test, and update javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoop committed Jan 8, 2025
1 parent 665222b commit 00f52b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
* 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.
* <p>
* 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 {@link NodeFeature#assumedAfterNextCompatibilityBoundary()},
* in the last minor, and then removing it and associated conditions in the new major version.
* <p>
* The feature information in cluster state should not normally be directly accessed.
* All feature checks should be done through {@code FeatureService} to ensure that Elasticsearch's
* All feature checks should be done through {@link 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.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ public Set<NodeFeature> getFeatures() {

{
// cluster doesn't have feature
ClusterState stateNoFeature = ClusterState.builder(ClusterName.DEFAULT).metadata(Metadata.builder()).build();
ClusterState stateNoFeature = ClusterState.builder(ClusterName.DEFAULT)
.nodes(DiscoveryNodes.builder().add(DiscoveryNodeUtils.create("n1")).add(DiscoveryNodeUtils.create("n2")))
.nodeFeatures(Map.of("n1", Set.of(), "n2", Set.of()))
.metadata(Metadata.builder())
.build();

Settings settings = Settings.builder().put(DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_ENABLED, true).build();
DataStreamAutoShardingService noFeatureService = new DataStreamAutoShardingService(
Expand Down

0 comments on commit 00f52b9

Please sign in to comment.