skochhar commented on a change in pull request #1935:
URL: https://github.com/apache/hbase/pull/1935#discussion_r456509573



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
##########
@@ -628,6 +628,34 @@ static Put createPutForNamespaceSnapshotSize(String 
namespace, long size) {
     }
   }
 
+  /**
+   * Remove table usage snapshots (u:p columns) for the namespace passed
+   * @param connection connection to re-use
+   * @param namespace the namespace to fetch the list of table usage snapshots
+   */
+  static void deleteTableUsageSnapshotsForNamespace(Connection connection, 
String namespace)
+    throws IOException {
+    Scan s = new Scan();
+    //Get rows for all tables in namespace
+    s.setRowPrefixFilter(Bytes.toBytes("t." + namespace));

Review comment:
       I added a test to check for the bug, in my test I create 2 namespaces 
with similar names and tested that the code only deletes the usage columns for 
the tables in the deleted namespace. 




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to