Skip to content

Commit e7a432b

Browse files
author
slfan1989
committed
YARN-11509. Fix CheckStyle.
1 parent 385babc commit e7a432b

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/FederationInterceptor.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,14 +1242,22 @@ private void sendRequestsToResourceManagers(
12421242
}
12431243

12441244
class TokenAndRegisterResponse {
1245-
Token<AMRMTokenIdentifier> token;
1246-
RegisterApplicationMasterResponse response;
1245+
private Token<AMRMTokenIdentifier> token;
1246+
private RegisterApplicationMasterResponse response;
12471247

12481248
TokenAndRegisterResponse(Token<AMRMTokenIdentifier> pToken,
12491249
RegisterApplicationMasterResponse pResponse) {
12501250
this.token = pToken;
12511251
this.response = pResponse;
12521252
}
1253+
1254+
public Token<AMRMTokenIdentifier> getToken() {
1255+
return token;
1256+
}
1257+
1258+
public RegisterApplicationMasterResponse getResponse() {
1259+
return response;
1260+
}
12531261
}
12541262

12551263
/**
@@ -1263,16 +1271,15 @@ private List<SubClusterId> registerAndAllocateWithNewSubClusters(
12631271
// Check to see if there are any new sub-clusters in this request
12641272
// list and create and register Unmanaged AM instance for the new ones
12651273
List<SubClusterId> newSubClusters = new ArrayList<>();
1266-
for (SubClusterId subClusterId : requests.keySet()) {
1267-
if (!subClusterId.equals(this.homeSubClusterId)
1268-
&& !this.uamPool.hasUAMId(subClusterId.getId())) {
1269-
newSubClusters.add(subClusterId);
12701274

1275+
requests.keySet().stream().forEach(subClusterId -> {
1276+
String id = subClusterId.getId();
1277+
if (!subClusterId.equals(this.homeSubClusterId) && !this.uamPool.hasUAMId(id)) {
1278+
newSubClusters.add(subClusterId);
12711279
// Set sub-cluster to be timed out initially
1272-
lastSCResponseTime.put(subClusterId,
1273-
clock.getTime() - subClusterTimeOut);
1280+
lastSCResponseTime.put(subClusterId, clock.getTime() - subClusterTimeOut);
12741281
}
1275-
}
1282+
});
12761283

12771284
this.uamRegisterFutures.clear();
12781285

0 commit comments

Comments
 (0)