[ 
https://issues.apache.org/jira/browse/HDFS-16693?focusedWorklogId=795368&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-795368
 ]

ASF GitHub Bot logged work on HDFS-16693:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jul/22 17:54
            Start Date: 26/Jul/22 17:54
    Worklog Time Spent: 10m 
      Work Description: goiri commented on code in PR #4633:
URL: https://github.com/apache/hadoop/pull/4633#discussion_r930260394


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Quota.java:
##########
@@ -204,7 +204,8 @@ QuotaUsage getGlobalQuota(String path) throws IOException {
    * @return {@code true} if path is a mount entry; {@code false} otherwise.
    */
   private boolean isMountEntry(String path) {

Review Comment:
   Can we add a unit test?



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Quota.java:
##########
@@ -204,7 +204,8 @@ QuotaUsage getGlobalQuota(String path) throws IOException {
    * @return {@code true} if path is a mount entry; {@code false} otherwise.
    */
   private boolean isMountEntry(String path) {
-    return router.getQuotaManager().isMountEntry(path);
+    return router.isQuotaEnabled() &&

Review Comment:
   This can be a single line.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 795368)
    Time Spent: 40m  (was: 0.5h)

> RBF: Fix NPE in Quota
> ---------------------
>
>                 Key: HDFS-16693
>                 URL: https://issues.apache.org/jira/browse/HDFS-16693
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Weison Wei
>            Assignee: Weison Wei
>            Priority: Critical
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> when the switch `dfs.federation.router.quota.enable` is false, 
> Quota#isMountEntry will throw NPE;
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to