Skip to content

Commit 6d11426

Browse files
author
slfan1989
committed
YARN-11252. Fix CheckStyle.
1 parent dfec706 commit 6d11426

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/records/impl/pb/DeleteReservationHomeSubClusterRequestPBImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ public ReservationId getReservationId() {
110110
}
111111

112112
@Override
113-
public void setReservationId(ReservationId ReservationId) {
113+
public void setReservationId(ReservationId reservationId) {
114114
maybeInitBuilder();
115-
if (ReservationId == null) {
115+
if (reservationId == null) {
116116
builder.clearReservationId();
117117
return;
118118
}
119-
builder.setReservationId(convertToProtoFormat(ReservationId));
119+
builder.setReservationId(convertToProtoFormat(reservationId));
120120
}
121121

122122
private ReservationId convertFromProtoFormat(ReservationIdProto appId) {
@@ -126,5 +126,4 @@ private ReservationId convertFromProtoFormat(ReservationIdProto appId) {
126126
private ReservationIdProto convertToProtoFormat(ReservationId appId) {
127127
return ((ReservationIdPBImpl) appId).getProto();
128128
}
129-
130129
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/records/impl/pb/UpdateReservationHomeSubClusterRequestPBImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ public ReservationHomeSubCluster getReservationHomeSubCluster() {
110110

111111
@Override
112112
public void setReservationHomeSubCluster(
113-
ReservationHomeSubCluster ReservationInfo) {
113+
ReservationHomeSubCluster reservationInfo) {
114114
maybeInitBuilder();
115-
if (ReservationInfo == null) {
115+
if (reservationInfo == null) {
116116
builder.clearAppSubclusterMap();
117117
return;
118118
}
119-
builder.setAppSubclusterMap(convertToProtoFormat(ReservationInfo));
119+
builder.setAppSubclusterMap(convertToProtoFormat(reservationInfo));
120120
}
121121

122122
private ReservationHomeSubCluster convertFromProtoFormat(
@@ -128,5 +128,4 @@ private ReservationHomeSubClusterProto convertToProtoFormat(
128128
ReservationHomeSubCluster sc) {
129129
return ((ReservationHomeSubClusterPBImpl) sc).getProto();
130130
}
131-
132131
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/policies/router/BaseRouterPoliciesTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ public void testUpdateReservation() throws YarnException {
214214

215215
// get all activeSubClusters
216216
Map<SubClusterId, SubClusterInfo> activeSubClusters = getActiveSubclusters();
217-
activeSubClusters.remove(chosen);
218217

219218
// Update ReservationHomeSubCluster
220219
List<SubClusterId> subClusterIds = new ArrayList<>(activeSubClusters.keySet());
@@ -230,8 +229,8 @@ public void testUpdateReservation() throws YarnException {
230229
null, false, false, 1, null, null, false);
231230

232231
applicationSubmissionContext.setReservationID(resReq.getReservationId());
233-
SubClusterId chosen3 = ((FederationRouterPolicy) getPolicy())
234-
.getHomeSubcluster(applicationSubmissionContext,new ArrayList<>());
232+
SubClusterId chosen3 = routerPolicy.getHomeSubcluster(
233+
applicationSubmissionContext, new ArrayList<>());
235234

236235
Assert.assertEquals(chosen2, chosen3);
237236
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/policies/router/TestRejectRouterPolicy.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ public void testNullQueueRouting() throws YarnException {
5858
localPolicy.getHomeSubcluster(applicationSubmissionContext, null);
5959
}
6060

61+
@Override
62+
@Test(expected = FederationPolicyException.class)
63+
public void testFollowReservation() throws YarnException {
64+
super.testFollowReservation();
65+
}
66+
6167
@Override
6268
@Test(expected = FederationPolicyException.class)
6369
public void testUpdateReservation() throws YarnException {

0 commit comments

Comments
 (0)