Skip to content

Complete WriteBufferManager Java API with monitoring methods#14392

Open
mike-evolved wants to merge 3 commits intofacebook:mainfrom
evolvedbinary:eb/feature/write-buffer-manager-java
Open

Complete WriteBufferManager Java API with monitoring methods#14392
mike-evolved wants to merge 3 commits intofacebook:mainfrom
evolvedbinary:eb/feature/write-buffer-manager-java

Conversation

@mike-evolved
Copy link

Summary

Adds 10 missing methods to WriteBufferManager Java API.

Changes

  • Monitoring: enabled(), costToCache(), memoryUsage(), mutableMemtableMemoryUsage(), dummyEntriesInCacheUsage(), bufferSize()
  • Control: setBufferSize(), setAllowStall()
  • Status: isStallActive(), isStallThresholdExceeded()
  • tests

Previously Java users could only create WriteBufferManager but couldn't monitor memory usage or adjust settings.

Example

try (WriteBufferManager wbm = new WriteBufferManager(32 * MB, cache, true)) {
    System.out.println("Memory: " + wbm.memoryUsage() + " / " + wbm.bufferSize());
    if (wbm.isStallThresholdExceeded()) wbm.setBufferSize(64 * MB);
}

@meta-cla meta-cla bot added the CLA Signed label Feb 26, 2026
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

✅ clang-tidy: No findings on changed lines

Completed in 0.0s.

@meta-codesync
Copy link

meta-codesync bot commented Mar 6, 2026

@hx235 has imported this pull request. If you are a Meta employee, you can view this in D95603876.

Copy link
Contributor

@hx235 hx235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the format error https://github.com/facebook/rocksdb/actions/runs/22458935067/job/65833367780?pr=14392 others look good to me.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants