Skip to content

Commit

Permalink
Replace terminology 'master' with 'cluster manager' (#521) (#522)
Browse files Browse the repository at this point in the history
Signed-off-by: Naveen Tatikonda <navtat@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] authored Aug 30, 2022
1 parent bab0790 commit cc9ca0f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void initialize(ThreadPool threadPool, ClusterService clusterService, Cli
}

// Leader node untriggers CB if all nodes have not reached their max capacity
if (KNNSettings.isCircuitBreakerTriggered() && clusterService.state().nodes().isLocalNodeElectedMaster()) {
if (KNNSettings.isCircuitBreakerTriggered() && clusterService.state().nodes().isLocalNodeElectedClusterManager()) {
KNNStatsRequest knnStatsRequest = new KNNStatsRequest(KNNStatsConfig.KNN_STATS.keySet());
knnStatsRequest.addStat(StatNames.CACHE_CAPACITY_REACHED.getName());
knnStatsRequest.timeout(new TimeValue(1000 * 10)); // 10 second timeout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static ModelGraveyard fromXContent(XContentParser xContentParser) throws

/**
* The ModelGraveyardDiff class compares the previous modelGraveyard object with the current updated modelGraveyard object
* and returns only the diff of those 2 objects. So that, whenever there is a change in cluster state, master node only
* and returns only the diff of those 2 objects. So that, whenever there is a change in cluster state, clusterManager node only
* sends the diff to all the data nodes instead of the full cluster state
*/
public static class ModelGraveyardDiff implements NamedDiff<Metadata.Custom> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.opensearch.action.ActionListener;
import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.master.AcknowledgedResponse;
import org.opensearch.action.support.master.TransportMasterNodeAction;
import org.opensearch.action.support.clustermanager.TransportClusterManagerNodeAction;
import org.opensearch.cluster.ClusterState;
import org.opensearch.cluster.ClusterStateTaskConfig;
import org.opensearch.cluster.ClusterStateTaskExecutor;
Expand Down Expand Up @@ -38,7 +38,9 @@
* Transport action used to update model graveyard on the cluster manager node.
*/
@Log4j2
public class UpdateModelGraveyardTransportAction extends TransportMasterNodeAction<UpdateModelGraveyardRequest, AcknowledgedResponse> {
public class UpdateModelGraveyardTransportAction extends TransportClusterManagerNodeAction<
UpdateModelGraveyardRequest,
AcknowledgedResponse> {
private UpdateModelGraveyardExecutor updateModelGraveyardExecutor;

@Inject
Expand Down Expand Up @@ -72,7 +74,7 @@ protected AcknowledgedResponse read(StreamInput streamInput) throws IOException
}

@Override
protected void masterOperation(
protected void clusterManagerOperation(
UpdateModelGraveyardRequest request,
ClusterState clusterState,
ActionListener<AcknowledgedResponse> actionListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.opensearch.action.ActionListener;
import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.master.AcknowledgedResponse;
import org.opensearch.action.support.master.TransportMasterNodeAction;
import org.opensearch.action.support.clustermanager.TransportClusterManagerNodeAction;
import org.opensearch.cluster.ClusterState;
import org.opensearch.cluster.ClusterStateTaskConfig;
import org.opensearch.cluster.ClusterStateTaskExecutor;
Expand Down Expand Up @@ -45,7 +45,9 @@
/**
* Transport action used to update metadata of model's on the cluster manager node.
*/
public class UpdateModelMetadataTransportAction extends TransportMasterNodeAction<UpdateModelMetadataRequest, AcknowledgedResponse> {
public class UpdateModelMetadataTransportAction extends TransportClusterManagerNodeAction<
UpdateModelMetadataRequest,
AcknowledgedResponse> {

public static Logger logger = LogManager.getLogger(UpdateModelMetadataTransportAction.class);

Expand Down Expand Up @@ -82,7 +84,7 @@ protected AcknowledgedResponse read(StreamInput streamInput) throws IOException
}

@Override
protected void masterOperation(
protected void clusterManagerOperation(
UpdateModelMetadataRequest request,
ClusterState clusterState,
ActionListener<AcknowledgedResponse> actionListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void testClusterManagerOperation() throws InterruptedException {
final CountDownLatch inProgressLatch1 = new CountDownLatch(1);
client().admin().cluster().prepareState().execute(ActionListener.wrap(stateResponse1 -> {
ClusterState clusterState1 = stateResponse1.getState();
updateModelGraveyardTransportAction.masterOperation(
updateModelGraveyardTransportAction.clusterManagerOperation(
addModelGraveyardRequest,
clusterState1,
ActionListener.wrap(acknowledgedResponse -> {
Expand Down Expand Up @@ -81,7 +81,7 @@ public void testClusterManagerOperation() throws InterruptedException {
final CountDownLatch inProgressLatch2 = new CountDownLatch(1);
client().admin().cluster().prepareState().execute(ActionListener.wrap(stateResponse1 -> {
ClusterState clusterState1 = stateResponse1.getState();
updateModelGraveyardTransportAction.masterOperation(
updateModelGraveyardTransportAction.clusterManagerOperation(
addModelGraveyardRequest1,
clusterState1,
ActionListener.wrap(acknowledgedResponse -> {
Expand Down Expand Up @@ -123,7 +123,7 @@ public void testClusterManagerOperation() throws InterruptedException {
final CountDownLatch inProgressLatch3 = new CountDownLatch(1);
client().admin().cluster().prepareState().execute(ActionListener.wrap(stateResponse1 -> {
ClusterState clusterState1 = stateResponse1.getState();
updateModelGraveyardTransportAction.masterOperation(
updateModelGraveyardTransportAction.clusterManagerOperation(
removeModelGraveyardRequest,
clusterState1,
ActionListener.wrap(acknowledgedResponse -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testClusterManagerOperation() throws InterruptedException {
final CountDownLatch inProgressLatch1 = new CountDownLatch(1);
client().admin().cluster().prepareState().execute(ActionListener.wrap(stateResponse1 -> {
ClusterState clusterState1 = stateResponse1.getState();
updateModelMetadataTransportAction.masterOperation(
updateModelMetadataTransportAction.clusterManagerOperation(
updateModelMetadataRequest,
clusterState1,
ActionListener.wrap(acknowledgedResponse -> {
Expand Down Expand Up @@ -114,7 +114,7 @@ public void testClusterManagerOperation() throws InterruptedException {
final CountDownLatch inProgressLatch2 = new CountDownLatch(1);
client().admin().cluster().prepareState().execute(ActionListener.wrap(stateResponse1 -> {
ClusterState clusterState1 = stateResponse1.getState();
updateModelMetadataTransportAction.masterOperation(
updateModelMetadataTransportAction.clusterManagerOperation(
removeModelMetadataRequest,
clusterState1,
ActionListener.wrap(acknowledgedResponse -> {
Expand Down

0 comments on commit cc9ca0f

Please sign in to comment.