pacificleo opened a new pull request, #13427:
URL: https://github.com/apache/hudi/pull/13427
### Change Logs
HBase 2.4+ does not allocate a block cache automatically within the
CacheConfig
but requires a BlockCache instance to be passed in. This is different
from HBase 1.x
where CacheConfig allocated and used a static global BlockCache instance.
BlockCache speeds up lookup from the HFile. To emulate the behavior of
HBase 1.x, we will allocate a global static global block cache here if
it is enabled. The BlockCache can be controlle via hfile configs passed
via hadoop configuration to the process.
https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheFactory.java
Logs which show BlockCache was allocated
[Driver] BlockCacheFactory: Allocating BlockCache size=3.20 GB,
blockSize=64 KB
[Driver] HoodieAvroHFileReader: Allocated a new global block cache for
hfile readers LruBlockCache{blockCount=0, currentSize=2.40 MB, freeSize=3.20
GB, maxSize=3.20 GB, heapSize=2.40 MB, minSize=3.04 GB, minFactor=0.95,
multiSize=1.52 GB, multiFactor=0.5, singleSize=778.24 MB,
singleFactor=0.25}
Test Plan:
Tested using a perf tool to lookup 10K keys from RI. With BlockCache
enabled, the time is 4x less.
With BlockCache:
[Driver] HoodieRecordIndexPerf: Time to lookup 10000 existing keys:
204462
[Driver] HoodieRecordIndexPerf: Time to lookup 10000 missing keys:
95169
Without BlockCache:
[Driver] HoodieRecordIndexPerf: Time to lookup 10000 existing keys:
817908
[Driver] HoodieRecordIndexPerf: Time to lookup 10000 missing keys: 93470
### Impact
Lookups from MDT partitions like RI can be faster.
### Risk level (write none, low medium or high below)
_If medium or high, explain what verification was done to mitigate the
risks._
### Documentation Update
_Describe any necessary documentation update if there is any new feature,
config, or user-facing change. If not, put "none"._
- _The config description must be updated if new configs are added or the
default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website.
Please create a Jira ticket, attach the
ticket number here and follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website) to
make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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]