Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport "HBASE-29099 Avoid expensive BlockCacheKey.toString() calls when traci…" to branch-3 #6645

Open
wants to merge 1 commit into
base: branch-3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1289,11 +1289,15 @@ public HFileBlock readBlock(long dataBlockOffset, long onDiskBlockSize, final bo

BlockCacheKey cacheKey =
new BlockCacheKey(path, dataBlockOffset, this.isPrimaryReplicaReader(), expectedBlockType);
Attributes attributes = Attributes.of(BLOCK_CACHE_KEY_KEY, cacheKey.toString());

boolean useLock = false;
IdLock.Entry lockEntry = null;
final Span span = Span.current();
// BlockCacheKey#toString() is quite expensive to call, so if tracing isn't enabled, don't
// record
Attributes attributes = span.isRecording()
? Attributes.of(BLOCK_CACHE_KEY_KEY, cacheKey.toString())
: Attributes.empty();
try {
while (true) {
// Check cache for block. If found return.
Expand Down