slfan1989 commented on code in PR #4929:
URL: https://github.com/apache/hadoop/pull/4929#discussion_r1000109116
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/RMQueueAclInfo.java:
##########
@@ -25,9 +25,10 @@
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class RMQueueAclInfo {
- protected boolean allowed;
+ protected Boolean allowed;
Review Comment:
In Federation mode, we may have multiple SubClusters, and to verify whether
the user has queue permissions, multiple results may be returned, and these
results cannot be directly integrated.
We directly call the RM interface, and the following return results can be
obtained
```
http://hostname:8088/ws/v1/cluster/queues/default/access?user=yarn
<rmQueueAclInfo>
<allowed>true</allowed>
<user>yarn</user>
<diagnostics/>
</rmQueueAclInfo>
```
We visit the router and hope to get the following results:
```
http://hostname:8089/ws/v1/cluster/queues/default/access?user=yarn
<federationRMQueueAclInfo>
<subCluster>
<allowed>true</allowed>
<user>yarn</user>
<diagnostics/>
<subClusterId>SC-1</subClusterId>
</subCluster>
<subCluster>
<allowed>true</allowed>
<user>yarn</user>
<diagnostics/>
<subClusterId>SC-2</subClusterId>
</subCluster>
</federationRMQueueAclInfo>
```
I found that if allowed is a boolean type, the return result is like this
```
<federationRMQueueAclInfo>
<allowed>false</allowed>
<subCluster>
<allowed>true</allowed>
<user>yarn</user>
<diagnostics/>
<subClusterId>SC-1</subClusterId>
</subCluster>
<subCluster>
<allowed>true</allowed>
<user>yarn</user>
<diagnostics/>
<subClusterId>SC-2</subClusterId>
</subCluster>
</federationRMQueueAclInfo>
```
I want federationRMQueueAclInfo to not show allowed, so I changed it to
Boolean, Because the XmlRootElement displays the field, if the field is null,
it will not be displayed in the result.
--
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]