optimize HBase 1.x request-path CPU usage - #330
Conversation
Optimize point Get and closestRowBefore, consume compact KQTV batches, avoid TableGroup intermediate copies, and use lightweight result cells for Get and Scan.
Reduce HBase client CPU usage by simplifying synchronous Put execution and integrating compact Put request encoding.
Use a dedicated pure-Get batch result loop and preallocate result containers. Consume compact K/Q/T/V batches directly without rebuilding results from per-field ObObj values. Enable the compact Batch Get decoder by default while retaining an explicit configuration fallback.
AI Coding Review审查范围: [P1] BufferedMutatorParams.maxKeyValueSize 被静默忽略位置: 影响:
建议增加两个回归用例: 依赖风险pom.xml 将依赖升级为: Review 结论合入前需要修复 BufferedMutatorParams.maxKeyValueSize 参数失效问题,并确认 Table Client snapshot 的发布顺序。 |
|
LGTM |
Summary
This PR optimizes the request and response hot paths of the HBase 1.x client.
It reduces CPU usage, byte-array copying, and temporary object allocation for
Get, Batch Get, Scan, and Put operations while preserving existing HBase client
semantics and compatibility paths.
Changes
Read path
obkv-table-client-java.ObObjvalues when compact resultsare available.
OHBaseResultCell, a lightweight immutableCellimplementationbacked directly by decoded field arrays.
KeyValueobjects and row-key clonesclosestRowBeforeby retaining only cells belonging to the greatestreturned row key without cloning row keys from temporary cells.
KeyValueresults without rebuilding generic rows.family\0qualifiercolumns.Batch Get
per-operation result mapping.
ObObjdecoding as a compatibility fallback.Put path
autoFlushis enabled, execute synchronous Puts directly without passingthrough the
BufferedMutatorqueue, heap-size accounting, temporary linkedlists, and an additional flush cycle.
write ordering.
the current call.
materializing deprecated compatibility structures.
Default behavior
The optimizations are applied automatically when the request shape and lifetime
make them safe. No new public tuning switches are introduced.
In particular:
requests
KeyValueresult contractCompatibility
Dependency
obkv-table-clientfrom2.4.0to2.4.1-SNAPSHOT.obkv-table-client-java.Dependent PR: oceanbase/obkv-table-client-java#442
Tests
Added 47 focused unit test cases covering:
closestRowBeforeprocessing