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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java:
##########
@@ -3116,16 +3116,9 @@ public ClusterMetrics 
getClusterMetricsWithoutCoprocessor(EnumSet<Option> option
           if (isActiveMaster() && isInitialized() && assignmentManager != 
null) {
             try {
               Map<TableName, RegionStatesCount> tableRegionStatesCountMap = 
new HashMap<>();
-              Map<String, TableDescriptor> tableDescriptorMap = 
getTableDescriptors().getAll();
-              for (TableDescriptor tableDescriptor : 
tableDescriptorMap.values()) {
+              List<TableDescriptor> tableDescriptors = 
listTableDescriptors(null, null, null, true);

Review Comment:
   Yes will do this.



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionObserver.java:
##########
@@ -557,4 +797,16 @@ public void testPreWALAppendReadOnlyException() throws 
IOException {
   public void testPreWALAppendNoException() throws IOException {
     readOnlyController.preWALAppend(ctx, key, edit);
   }
+
+  @Test
+  public void testPreWALAppendReadOnlyMetaNoException() throws IOException {
+    readOnlyController.onConfigurationChange(readOnlyConf);
+    when(key.getTableName()).thenReturn(TableName.META_TABLE_NAME);

Review Comment:
   Note that here we will be using key to determine on which table the 
operation is getting performed on hence we have to mock key.getTableName 
instead of regionInfo.getTable()



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ReadOnlyController.java:
##########
@@ -129,24 +134,30 @@ public Optional<RegionObserver> getRegionObserver() {
     return Optional.of(this);
   }
 
-  @Override

Review Comment:
   Moved the preflush function below to put code for both versions together.



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestReadOnlyControllerRegionObserver.java:
##########
@@ -420,10 +654,16 @@ public void 
testPreCheckAndDeleteAfterRowLockV2NoException() throws IOException
     readOnlyController.preCheckAndDeleteAfterRowLock(c, row, filter, delete, 
result);
   }
 
-  @Test(expected = IOException.class)
-  public void testPreBatchMutateReadOnlyException() throws IOException {

Review Comment:
   This test function is moved above to be added near the other tests covering 
same function.



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ReadOnlyController.java:
##########
@@ -105,6 +105,11 @@ private void internalReadOnlyGuard() throws IOException {
     }
   }
 
+  private boolean
+    isOperationOnNonMetaTable(final ObserverContext<? extends 
RegionCoprocessorEnvironment> c) {

Review Comment:
   Done.



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