Skip to content

Commit

Permalink
sendApplicationInfo -> registerApplicationInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
smallzhongfeng committed Nov 21, 2022
1 parent 36fb720 commit 25b4b78
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public void registerApplicationInfo(String appId, long timeoutMs, String user) {
coordinatorClients.forEach(coordinatorClient -> {
callableList.add(() -> {
try {
RssApplicationInfoResponse response = coordinatorClient.sendApplicationInfo(request);
RssApplicationInfoResponse response = coordinatorClient.registerApplicationInfo(request);
if (response.getStatusCode() != ResponseStatusCode.SUCCESS) {
LOG.error("Failed to send applicationInfo to " + coordinatorClient.getDesc());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testGrpcConnectionSize() throws Exception {
assertEquals(0, connSize);

CoordinatorGrpcClient coordinatorGrpcClient = new CoordinatorGrpcClient("localhost", 20001);
coordinatorGrpcClient.sendApplicationInfo(
coordinatorGrpcClient.registerApplicationInfo(
new RssApplicationInfoRequest("testGrpcConnectionSize", 10000, "user"));

connSize = grpcMetrics.getGaugeMap().get(GRCP_SERVER_CONNECTION_NUMBER_KEY).get();
Expand All @@ -78,8 +78,8 @@ public void testGrpcConnectionSize() throws Exception {
// case2: test the multiple connections
CoordinatorGrpcClient client1 = new CoordinatorGrpcClient("localhost", 20001);
CoordinatorGrpcClient client2 = new CoordinatorGrpcClient("localhost", 20001);
client1.sendApplicationInfo(new RssApplicationInfoRequest("testGrpcConnectionSize", 10000, "user"));
client2.sendApplicationInfo(new RssApplicationInfoRequest("testGrpcConnectionSize", 10000, "user"));
client1.registerApplicationInfo(new RssApplicationInfoRequest("testGrpcConnectionSize", 10000, "user"));
client2.registerApplicationInfo(new RssApplicationInfoRequest("testGrpcConnectionSize", 10000, "user"));

connSize = grpcMetrics.getGaugeMap().get(GRCP_SERVER_CONNECTION_NUMBER_KEY).get();
assertEquals(3, connSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,18 @@ public void getShuffleAssignmentsTest() throws Exception {
@Test
public void appHeartbeatTest() throws Exception {
RssApplicationInfoResponse response =
coordinatorClient.sendApplicationInfo(
coordinatorClient.registerApplicationInfo(
new RssApplicationInfoRequest("application_appHeartbeatTest1", 1000, "user"));
assertEquals(ResponseStatusCode.SUCCESS, response.getStatusCode());
assertEquals(Sets.newHashSet("application_appHeartbeatTest1"),
coordinators.get(0).getApplicationManager().getAppIds());
coordinatorClient.sendApplicationInfo(
coordinatorClient.registerApplicationInfo(
new RssApplicationInfoRequest("application_appHeartbeatTest2", 1000, "user"));
assertEquals(Sets.newHashSet("application_appHeartbeatTest1", "application_appHeartbeatTest2"),
coordinators.get(0).getApplicationManager().getAppIds());
int retry = 0;
while (retry < 5) {
coordinatorClient.sendApplicationInfo(
coordinatorClient.registerApplicationInfo(
new RssApplicationInfoRequest("application_appHeartbeatTest1", 1000, "user"));
retry++;
Thread.sleep(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface CoordinatorClient {

RssAppHeartBeatResponse sendAppHeartBeat(RssAppHeartBeatRequest request);

RssApplicationInfoResponse sendApplicationInfo(RssApplicationInfoRequest request);
RssApplicationInfoResponse registerApplicationInfo(RssApplicationInfoRequest request);

RssSendHeartBeatResponse sendHeartBeat(RssSendHeartBeatRequest request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public RssAppHeartBeatResponse sendAppHeartBeat(RssAppHeartBeatRequest request)
}

@Override
public RssApplicationInfoResponse sendApplicationInfo(RssApplicationInfoRequest request) {
public RssApplicationInfoResponse registerApplicationInfo(RssApplicationInfoRequest request) {
ApplicationInfoRequest rpcRequest =
ApplicationInfoRequest.newBuilder().setAppId(request.getAppId()).setUser(request.getUser()).build();
ApplicationInfoResponse rpcResponse = blockingStub
Expand Down

0 comments on commit 25b4b78

Please sign in to comment.