Skip to content

Commit

Permalink
Rename master to cluster-manager in sever/src/test
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed May 24, 2022
1 parent 737843f commit a87cede
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void testEqualsAndHashCode() {
assertEquals(request, copy);
assertEquals(request.hashCode(), copy.hashCode());

// Changing clusterManagerNodeTime makes requests not equal
// Changing clusterManagerNodeTimeout makes requests not equal
copy.masterNodeTimeout(timeValueMillis(request.masterNodeTimeout().millis() + 1));
assertNotEquals(request, copy);
assertNotEquals(request.hashCode(), copy.hashCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ protected void masterOperation(Request request, ClusterState state, ActionListen
assertThat(listener.get(), equalTo(response));
}

// Validate TransportMasterNodeAction.testDelegateToMaster() works correctly on node with the deprecated MASTER_ROLE.
public void testDelegateToMasterOnNodeWithDeprecatedMasterRole() throws ExecutionException, InterruptedException {
// Validate TransportMasterNodeAction.testDelegateToClusterManager() works correctly on node with the deprecated MASTER_ROLE.
public void testDelegateToClusterManagerOnNodeWithDeprecatedMasterRole() throws ExecutionException, InterruptedException {
DiscoveryNode localNode = new DiscoveryNode(
"local_node",
buildNewFakeTransportAddress(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class TransportMasterNodeActionUtils {
* Allows to directly call {@link TransportMasterNodeAction#masterOperation(MasterNodeRequest, ClusterState, ActionListener)} which is
* a protected method.
*/
public static <Request extends MasterNodeRequest<Request>, Response extends ActionResponse> void runMasterOperation(
public static <Request extends MasterNodeRequest<Request>, Response extends ActionResponse> void runClusterManagerOperation(
TransportMasterNodeAction<Request, Response> clusterManagerNodeAction,
Request request,
ClusterState clusterState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ public void testChangedCustomMetadataSet() {
assertTrue(changedCustomMetadataTypeSet.contains(customMetadata1.getWriteableName()));
}

// Validate the above test case testLocalNodeIsMaster() passes when the deprecated 'master' role is assigned to the local node.
public void testLocalNodeIsMasterWithDeprecatedMasterRole() {
// Validate the above test case testLocalNodeIsClusterManager() passes when the deprecated 'master' role is assigned to the local node.
public void testLocalNodeIsClusterManagerWithDeprecatedMasterRole() {
final DiscoveryNodes.Builder builderLocalIsMaster = DiscoveryNodes.builder();
final DiscoveryNode node0 = newNode("node_0", Set.of(DiscoveryNodeRole.MASTER_ROLE));
final DiscoveryNode node1 = newNode("node_1", Set.of(DiscoveryNodeRole.DATA_ROLE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,12 @@ private <Request extends MasterNodeRequest<Request>, Response extends ActionResp
) {
return executeClusterStateUpdateTask(clusterState, () -> {
try {
TransportMasterNodeActionUtils.runMasterOperation(masterNodeAction, request, clusterState, new PlainActionFuture<>());
TransportMasterNodeActionUtils.runClusterManagerOperation(
masterNodeAction,
request,
clusterState,
new PlainActionFuture<>()
);
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit a87cede

Please sign in to comment.