Uh oh!
There was an error while loading. Please reload this page.
HBASE-28716: Users of QuotaRetriever should pass an existing connection (branch-2) - #6054
HBASE-28716: Users of QuotaRetriever should pass an existing connection (branch-2)#6054charlesconnell wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
charlesconnell
commented
Jul 8, 2024
The build check failure appears unrelated to my change |
| List<QuotaSettings> quotas = new ArrayList<>(); | ||
| try (QuotaRetriever retriever = QuotaRetriever.open(conf, filter)) { | ||
| try (QuotaRetriever retriever = QuotaRetriever.open(connection, filter)) { | ||
| Iterator<QuotaSettings> iterator = retriever.iterator(); |
There was a problem hiding this comment.
Changes looks good to me.
However similar optimization can be done in master branch as well, below API is used multiple placesorg.apache.hadoop.hbase.quotas.QuotaRetriever#open(org.apache.hadoop.conf.Configuration, org.apache.hadoop.hbase.quotas.QuotaFilter)
We can reuse the existing connection instead of creating new one always.
There was a problem hiding this comment.
Okay, I'm happy to expand the scope of this ticket.
Apache-HBase
commented
Jul 9, 2024
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 9, 2024
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 9, 2024
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 9, 2024
🎊 +1 overall
This message was automatically generated. |
charlesconnell
commented
Jul 15, 2024
unit test failure appears unrelated |
ndimiduk
commented
Jul 17, 2024
Heya -- let's keep the initial design discussion on the PR vs. master and leave this for the backport. |
Every call to
HBaseAdmin#getQuota()opens a newConnection, and then closes it. As far as I can tell, this is pointless, since it could use the existingConnectionobject held by theHBaseAdmin. Change this and other uses of QuotaRetriever to use existing Connections.