Skip to content

HBASE-30390 Obtain previous cell value in writer buffer instead of copying in encoding - #8662

Open
Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-30390
Open

Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-30390

Conversation

@Huginn-kio

Copy link
Copy Markdown
Contributor

HBASE-30390

Summary

Avoid copying previous cell values during data block encoding.

JIRA: https://issues.apache.org/jira/browse/HBASE-30390

Root cause

EncodingState.beforeShipped() copies the complete previous cell with
KeyValueUtil.copyToNewKeyValue(). FastDiffDeltaEncoder then uses that copied
cell for previous-value length and content comparison. This allocates and copies
value bytes even though the encoded value is already in the writer buffer.

Fix

  • Keep previous key metadata stable with a key-only materialization.
  • Track previous value length separately.
  • Compare FAST_DIFF values against the encoded writer buffer after shipping.
  • Add focused regression coverage for shipped cells, reused buffers, and failed
    encoding paths.

Testing

  • JAVA_HOME=$(/usr/libexec/java_home -v 17) mvn -pl hbase-common -am -Dtest=TestFastDiffEncodingState -Dsurefire.failIfNoSpecifiedTests=false -DskipITs test
    • Passed: 6 tests, 0 failures, 0 errors, 0 skipped.
  • JAVA_HOME=$(/usr/libexec/java_home -v 17) mvn -pl hbase-server -am -DskipTests -Dcheckstyle.skip=true -Drat.skip=true -Dspotbugs.skip=true compile
    • Passed: server reactor compilation completed successfully.
  • Scoped Checkstyle for the two new state classes and the regression test passed.
  • apache-rat:check and spotbugs:check passed for hbase-common.

The full reactor Checkstyle command is currently blocked by existing
InterfaceIsType violations in the hbase-annotations test-classification
interfaces; none of the reported lines are part of this change.

Compatibility

  • No public API impact; changes are internal.
  • No configuration impact.
  • No persisted-format or wire-format impact; encoded output semantics are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant