smengcl commented on code in PR #3131:
URL: https://github.com/apache/ozone/pull/3131#discussion_r871746989


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManagerImpl.java:
##########
@@ -93,38 +98,81 @@ public class OMMultiTenantManagerImpl implements 
OMMultiTenantManager {
   private final OzoneManager ozoneManager;
   private final OMMetadataManager omMetadataManager;
   private final OzoneConfiguration conf;
-  private final ReentrantReadWriteLock controlPathLock;
+  // tenantCache: tenantId -> CachedTenantState
   private final Map<String, CachedTenantState> tenantCache;
+  private final ReentrantReadWriteLock tenantCacheLock;
+  private final OMRangerBGSyncService omRangerBGSyncService;
 
-  OMMultiTenantManagerImpl(OzoneManager ozoneManager, OzoneConfiguration conf)
+  public OMMultiTenantManagerImpl(OzoneManager ozoneManager,
+                                  OzoneConfiguration conf)
       throws IOException {
     this.conf = conf;
-    this.controlPathLock = new ReentrantReadWriteLock();
     this.ozoneManager = ozoneManager;
     this.omMetadataManager = ozoneManager.getMetadataManager();
     this.tenantCache = new ConcurrentHashMap<>();
-    boolean devSkipRanger = conf.getBoolean(OZONE_OM_TENANT_DEV_SKIP_RANGER,
-        false);
+    this.tenantCacheLock = new ReentrantReadWriteLock();
+
+    loadTenantCacheFromDB();
+
+    boolean devSkipRanger =
+        conf.getBoolean(OZONE_OM_TENANT_DEV_SKIP_RANGER, false);
     if (devSkipRanger) {
       this.authorizer = new MultiTenantAccessAuthorizerDummyPlugin();
     } else {
       this.authorizer = new MultiTenantAccessAuthorizerRangerPlugin();
     }
-    this.authorizer.init(conf);
-    loadUsersFromDB();
+    try {
+      this.authorizer.init(conf);
+    } catch (OMException ex) {
+      if (ex.getResult().equals(INTERNAL_ERROR)) {

Review Comment:
   We can try to do this in the follow up patch and after #3397 is merged. 
Making this fatal at this point without the config change breaks a lot of tests.



-- 
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]

Reply via email to