satishkotha commented on a change in pull request #1484:
URL: https://github.com/apache/incubator-hudi/pull/1484#discussion_r418696889
##########
File path: hudi-client/src/main/java/org/apache/hudi/index/hbase/HBaseIndex.java
##########
@@ -322,66 +347,94 @@ private boolean checkIfValidCommit(HoodieTableMetaClient
metaClient, String comm
/**
* Helper method to facilitate performing mutations (including puts and
deletes) in Hbase.
*/
- private void doMutations(BufferedMutator mutator, List<Mutation> mutations)
throws IOException {
+ private void doMutations(BufferedMutator mutator, List<Mutation> mutations,
RateLimiter limiter) throws IOException {
if (mutations.isEmpty()) {
return;
}
+ // report number of operations to account per second with rate limiter.
+ // If #limiter.getRate() operations are acquired within 1 second,
ratelimiter will limit the rest of calls
+ // for within that second
+ limiter.acquire(mutations.size());
mutator.mutate(mutations);
mutator.flush();
mutations.clear();
Review comment:
example to help clarify what i meant:
lets say, mutator.mutate() + flush +clear takes 2 seconds as minimum.
limiter.acquire would never wait because it generates mutations.size() tokens
every second. So we would never wait. looks like this is expected and we dont
see it as a problem. So I'm fine with it. (if possible, having metrics on per
operation wait time would help us debug any potential issues)
----------------------------------------------------------------
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:
[email protected]