goiri commented on code in PR #4543:
URL: https://github.com/apache/hadoop/pull/4543#discussion_r922724973
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/MockDefaultRequestInterceptorREST.java:
##########
@@ -231,4 +240,43 @@ public boolean isRunning() {
public void setRunning(boolean runningMode) {
this.isRunning = runningMode;
}
+
+ @Override
+ public ContainersInfo getContainers(HttpServletRequest req,
HttpServletResponse res,
+ String appId, String appAttemptId) {
+ if (!isRunning) {
+ throw new RuntimeException("RM is stopped");
+ }
+
+ // We avoid to check if the Application exists in the system because we
need
+ // to validate that each subCluster returns 1 container.
+ ContainersInfo containers = new ContainersInfo();
+
+ int subClusterId = Integer.valueOf(getSubClusterId().getId());
+
+ ContainerId containerId = ContainerId.newContainerId(
+ ApplicationAttemptId.fromString(appAttemptId), subClusterId);
+ Resource allocatedResource =
+ Resource.newInstance(subClusterId, subClusterId);
+
+ NodeId assignedNode = NodeId.newInstance("Node", subClusterId);
+ Priority priority = Priority.newInstance(subClusterId);
+ long creationTime = subClusterId;
+ long finishTime = subClusterId;
+ String diagnosticInfo = "Diagnostic " + subClusterId;
+ String logUrl = "Log " + subClusterId;
+ int containerExitStatus = subClusterId;
+ ContainerState containerState = ContainerState.COMPLETE;
+ String nodeHttpAddress = "HttpAddress " + subClusterId;
+
+ ContainerReport containerReport =
Review Comment:
This indentation looks weird:
```
ContainerReport containerReport = ContainerReport.newInstance(
containerId, allocatedResource, assignedNode, priority, creationTime,
finishTime,
diagnosticInfo, logUrl, containerExitStatus, containerState,
nodeHttpAddress);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]