ndimiduk commented on code in PR #6065:
URL: https://github.com/apache/hbase/pull/6065#discussion_r1682671612


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaRetriever.java:
##########
@@ -156,26 +137,26 @@ public void remove() {
 
   /**
    * Open a QuotaRetriever with no filter, all the quota settings will be 
returned.
-   * @param conf Configuration object to use.
+   * @param conn Connection object to use.
    * @return the QuotaRetriever
    * @throws IOException if a remote or network exception occurs
    */
-  public static QuotaRetriever open(final Configuration conf) throws 
IOException {
-    return open(conf, null);
+  public static QuotaRetriever open(final Connection conn) throws IOException {

Review Comment:
   > If we're going through the trouble to make breaking changes, let's push 
RAII and do away with the parameterless constructor + init method.
   
   Since we're opening this worm-can, how about we get rid of these static 
constructor methods and use constructors like a normal object?



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.java:
##########
@@ -168,7 +168,7 @@ Multimap<TableName, String> getSnapshotsToComputeSize() 
throws IOException {
     filter.addTypeFilter(QuotaType.SPACE);
     try (Admin admin = conn.getAdmin()) {
       // Pull all of the tables that have quotas (direct, or from namespace)
-      for (QuotaSettings qs : QuotaRetriever.open(conf, filter)) {
+      for (QuotaSettings qs : QuotaRetriever.open(conn, filter)) {

Review Comment:
   Would you mind also promoting uses of the `QuotaRetriever` object up to 
try-with-resource blocks? In this particular case, it looks like we never close 
the object.



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