-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-28716: Users of QuotaRetriever should pass an existing connection (branch-2) #6054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-28716: Users of QuotaRetriever should pass an existing connection (branch-2) #6054
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.
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me.
However similar optimization can be done in master branch as well, below API is used multiple places
org.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm happy to expand the scope of this ticket.
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
unit test failure appears unrelated |
|
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.