Skip to content

Commit

Permalink
Call the static method of ClusterManagerNodeChangePredicate in Master…
Browse files Browse the repository at this point in the history
…NodeChangePredicate instead of using inheritance

Signed-off-by: Tianli Feng <[email protected]>
  • Loading branch information
Tianli Feng committed Jul 14, 2022
1 parent c186bec commit d10fec2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@
*
* @opensearch.internal
*/
// TODO: add final keyword to the class and private keyword to the default constructor,
// after removing the deprecated class MasterNodeChangePredicate.
// Removed the final keyword temporarily only for making the class MasterNodeChangePredicate as a subclass,
// so that preserving the both class names by maintaining one class implementation for backwards compatibility.
public class ClusterManagerNodeChangePredicate {
public final class ClusterManagerNodeChangePredicate {

ClusterManagerNodeChangePredicate() {
private ClusterManagerNodeChangePredicate() {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,22 @@

package org.opensearch.cluster;

import java.util.function.Predicate;

/**
* Utility class to build a predicate that accepts cluster state changes
*
* @opensearch.internal
* @deprecated As of 2.2, because supporting inclusive language, replaced by {@link ClusterManagerNodeChangePredicate}
*/
@Deprecated
public final class MasterNodeChangePredicate extends ClusterManagerNodeChangePredicate {
public final class MasterNodeChangePredicate {

private MasterNodeChangePredicate() {

}

public static Predicate<ClusterState> build(ClusterState currentState) {
return ClusterManagerNodeChangePredicate.build(currentState);
}
}

0 comments on commit d10fec2

Please sign in to comment.