Skip to content

Commit a856cfe

Browse files
author
slfan1989
committed
YARN-11228. Fix CheckStyle.
1 parent b4ad85e commit a856cfe

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/RouterServerUtil.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ private RouterServerUtil() {
4545
/**
4646
* Throws an exception due to an error.
4747
*
48-
* @param errMsgFormat the error message format string.
4948
* @param t the throwable raised in the called class.
49+
* @param errMsgFormat the error message format string.
5050
* @param args referenced by the format specifiers in the format string.
5151
* @throws YarnException on failure
5252
*/
5353
@Public
5454
@Unstable
55-
public static void logAndThrowException(String errMsgFormat, Throwable t, Object... args)
55+
public static void logAndThrowException(Throwable t, String errMsgFormat, Object... args)
5656
throws YarnException {
5757
String msg = String.format(errMsgFormat, args);
5858
if (t != null) {
@@ -74,7 +74,7 @@ public static void logAndThrowException(String errMsgFormat, Throwable t, Object
7474
@Public
7575
@Unstable
7676
public static void logAndThrowException(String errMsg, Throwable t)
77-
throws YarnException {
77+
throws YarnException {
7878
if (t != null) {
7979
LOG.error(errMsg, t);
8080
throw new YarnException(errMsg, t);
@@ -127,14 +127,14 @@ public static void logAndThrowRunTimeException(String errMsg, Throwable t)
127127
/**
128128
* Throws an RunTimeException due to an error.
129129
*
130-
* @param errMsgFormat the error message format string.
131130
* @param t the throwable raised in the called class.
131+
* @param errMsgFormat the error message format string.
132132
* @param args referenced by the format specifiers in the format string.
133133
* @throws RuntimeException on failure
134134
*/
135135
@Public
136136
@Unstable
137-
public static void logAndThrowRunTimeException(String errMsgFormat, Throwable t, Object... args)
137+
public static void logAndThrowRunTimeException(Throwable t, String errMsgFormat, Object... args)
138138
throws RuntimeException {
139139
String msg = String.format(errMsgFormat, args);
140140
if (t != null) {

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationInterceptorREST.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,8 +1376,8 @@ public AppAttemptsInfo getAppAttempts(HttpServletRequest hsr, String appId) {
13761376
subClusterInfo.getSubClusterId(), subClusterInfo.getRMWebServiceAddress());
13771377
return interceptor.getAppAttempts(hsr, appId);
13781378
} catch (IllegalArgumentException e) {
1379-
RouterServerUtil.logAndThrowRunTimeException(
1380-
"Unable to get the AppAttempt appId: %s.", e, appId);
1379+
RouterServerUtil.logAndThrowRunTimeException(e,
1380+
"Unable to get the AppAttempt appId: %s.", appId);
13811381
} catch (YarnException e) {
13821382
RouterServerUtil.logAndThrowRunTimeException("getContainer Failed.", e);
13831383
}
@@ -1409,8 +1409,8 @@ public AppAttemptInfo getAppAttempt(HttpServletRequest req,
14091409
subClusterInfo.getSubClusterId(), subClusterInfo.getRMWebServiceAddress());
14101410
return interceptor.getAppAttempt(req, res, appId, appAttemptId);
14111411
} catch (IllegalArgumentException e) {
1412-
RouterServerUtil.logAndThrowRunTimeException(
1413-
"Unable to get the AppAttempt appId: %s, appAttemptId: %s.", e, appId, appAttemptId);
1412+
RouterServerUtil.logAndThrowRunTimeException(e,
1413+
"Unable to get the AppAttempt appId: %s, appAttemptId: %s.", appId, appAttemptId);
14141414
} catch (YarnException e) {
14151415
RouterServerUtil.logAndThrowRunTimeException("getContainer Failed.", e);
14161416
}
@@ -1599,14 +1599,14 @@ private SubClusterInfo getHomeSubClusterInfoByAppId(String appId)
15991599
ApplicationId applicationId = ApplicationId.fromString(appId);
16001600
SubClusterId subClusterId = federationFacade.getApplicationHomeSubCluster(applicationId);
16011601
if (subClusterId == null) {
1602-
RouterServerUtil.logAndThrowException("Can't get HomeSubCluster by applicationId %s",
1603-
null, applicationId);
1602+
RouterServerUtil.logAndThrowException(null,
1603+
"Can't get HomeSubCluster by applicationId %s", applicationId);
16041604
}
16051605
subClusterInfo = federationFacade.getSubCluster(subClusterId);
16061606
return subClusterInfo;
16071607
} catch (YarnException e) {
1608-
RouterServerUtil.logAndThrowException("Get HomeSubClusterInfo by applicationId %s failed.",
1609-
e, appId);
1608+
RouterServerUtil.logAndThrowException(e,
1609+
"Get HomeSubClusterInfo by applicationId %s failed.", appId);
16101610
}
16111611
throw new YarnException("Unable to get subCluster by applicationId = " + appId);
16121612
}

0 commit comments

Comments
 (0)