@@ -159,7 +159,7 @@ private static INodeDirectory createRoot(FSNamesystem namesystem) {
159159 private final FSNamesystem namesystem ;
160160 private volatile boolean skipQuotaCheck = false ; //skip while consuming edits
161161 private final int maxComponentLength ;
162- private int maxDirItems ;
162+ private volatile int maxDirItems ;
163163 private final int lsLimit ; // max list limit
164164 private final int contentCountLimit ; // max content summary counts per run
165165 private final long contentSleepMicroSec ;
@@ -217,7 +217,7 @@ private static INodeDirectory createRoot(FSNamesystem namesystem) {
217217 // authorizeWithContext() API or not.
218218 private boolean useAuthorizationWithContextAPI = false ;
219219
220- private final int MAX_DIR_ITEMS = 64 * 100 * 1000 ;
220+ private static final int maxDirItemsLimit = 64 * 100 * 1000 ;
221221
222222 public void setINodeAttributeProvider (
223223 @ Nullable INodeAttributeProvider provider ) {
@@ -401,9 +401,9 @@ public enum DirOp {
401401 // to 64MB. This means we can only store approximately 6.7 million entries
402402 // per directory, but let's use 6.4 million for some safety.
403403 Preconditions .checkArgument (
404- maxDirItems > 0 && maxDirItems <= MAX_DIR_ITEMS , "Cannot set "
404+ maxDirItems > 0 && maxDirItems <= maxDirItemsLimit , "Cannot set "
405405 + DFSConfigKeys .DFS_NAMENODE_MAX_DIRECTORY_ITEMS_KEY
406- + " to a value less than 1 or greater than " + MAX_DIR_ITEMS );
406+ + " to a value less than 1 or greater than " + maxDirItemsLimit );
407407
408408 int threshold = conf .getInt (
409409 DFSConfigKeys .DFS_NAMENODE_NAME_CACHE_THRESHOLD_KEY ,
@@ -583,9 +583,9 @@ String setProtectedDirectories(String protectedDirsString) {
583583
584584 public void setMaxDirItems (int newVal ) {
585585 com .google .common .base .Preconditions .checkArgument (
586- newVal > 0 && newVal <= MAX_DIR_ITEMS , "Cannot set "
586+ newVal > 0 && newVal <= maxDirItemsLimit , "Cannot set "
587587 + DFSConfigKeys .DFS_NAMENODE_MAX_DIRECTORY_ITEMS_KEY
588- + " to a value less than 1 or greater than " + MAX_DIR_ITEMS );
588+ + " to a value less than 1 or greater than " + maxDirItemsLimit );
589589 maxDirItems = newVal ;
590590 }
591591
0 commit comments