sharmaar12 commented on code in PR #7464:
URL: https://github.com/apache/hbase/pull/7464#discussion_r2523785002


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ReadOnlyController.java:
##########
@@ -334,26 +437,168 @@ public void 
preDeleteNamespace(ObserverContext<MasterCoprocessorEnvironment> ctx
     MasterObserver.super.preDeleteNamespace(ctx, namespace);
   }
 
+  @Override public void 
preMasterStoreFlush(ObserverContext<MasterCoprocessorEnvironment> ctx)
+    throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preMasterStoreFlush(ctx);
+  }
+
   @Override
-  public void 
preMergeRegionsAction(ObserverContext<MasterCoprocessorEnvironment> ctx,
-    RegionInfo[] regionsToMerge) throws IOException {
+  public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> 
ctx, String userName,
+    GlobalQuotaSettings quotas) throws IOException {
     internalReadOnlyGuard();
-    MasterObserver.super.preMergeRegionsAction(ctx, regionsToMerge);
+    MasterObserver.super.preSetUserQuota(ctx, userName, quotas);
   }
 
-  /* ---- RegionServerObserver Overrides ---- */
   @Override
-  public void 
preRollWALWriterRequest(ObserverContext<RegionServerCoprocessorEnvironment> ctx)
+  public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> 
ctx, String userName,
+    TableName tableName, GlobalQuotaSettings quotas) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preSetUserQuota(ctx, userName, tableName, quotas);
+  }
+
+  @Override
+  public void preSetUserQuota(ObserverContext<MasterCoprocessorEnvironment> 
ctx, String userName,
+    String namespace, GlobalQuotaSettings quotas) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preSetUserQuota(ctx, userName, namespace, quotas);
+  }
+
+  @Override public void 
preSetTableQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
+    TableName tableName, GlobalQuotaSettings quotas) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preSetTableQuota(ctx, tableName, quotas);
+  }
+
+  @Override public void 
preSetNamespaceQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
+    String namespace, GlobalQuotaSettings quotas) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preSetNamespaceQuota(ctx, namespace, quotas);
+  }
+
+  @Override public void 
preSetRegionServerQuota(ObserverContext<MasterCoprocessorEnvironment> ctx,
+    String regionServer, GlobalQuotaSettings quotas) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preSetRegionServerQuota(ctx, regionServer, quotas);
+  }
+
+  @Override public void preMergeRegions(final 
ObserverContext<MasterCoprocessorEnvironment> ctx,
+    final RegionInfo[] regionsToMerge) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preMergeRegions(ctx, regionsToMerge);
+  }
+
+  @Override public void 
preMoveServersAndTables(ObserverContext<MasterCoprocessorEnvironment> ctx,
+    Set<Address> servers, Set<TableName> tables, String targetGroup) throws 
IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preMoveServersAndTables(ctx, servers, tables, 
targetGroup);
+  }
+
+  @Override public void 
preMoveServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
+    Set<Address> servers, String targetGroup) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preMoveServers(ctx, servers, targetGroup);
+  }
+
+  @Override public void 
preMoveTables(ObserverContext<MasterCoprocessorEnvironment> ctx,
+    Set<TableName> tables, String targetGroup) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preMoveTables(ctx, tables, targetGroup);
+  }
+
+  @Override
+  public void preAddRSGroup(ObserverContext<MasterCoprocessorEnvironment> ctx, 
String name)
     throws IOException {
     internalReadOnlyGuard();
-    RegionServerObserver.super.preRollWALWriterRequest(ctx);
+    MasterObserver.super.preAddRSGroup(ctx, name);
+  }
+
+  @Override
+  public void preRemoveRSGroup(ObserverContext<MasterCoprocessorEnvironment> 
ctx, String name)
+    throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preRemoveRSGroup(ctx, name);
+  }
+
+  @Override
+  public void preBalanceRSGroup(ObserverContext<MasterCoprocessorEnvironment> 
ctx, String groupName,
+    BalanceRequest request) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preBalanceRSGroup(ctx, groupName, request);
+  }
+
+  @Override public void 
preRemoveServers(ObserverContext<MasterCoprocessorEnvironment> ctx,
+    Set<Address> servers) throws IOException {
+    internalReadOnlyGuard();
+    MasterObserver.super.preRemoveServers(ctx, servers);
   }
 
   @Override
-  public void 
preClearCompactionQueues(ObserverContext<RegionServerCoprocessorEnvironment> 
ctx)

Review Comment:
   I have removed blocking of clearcompactionQueues because in read-only mode 
we must block compaction. So in case if the compaction queue is having some 
elements we should let it clear without blocking.



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

Reply via email to