-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-27778 Incorrect ReplicationSourceWALReader.totalBufferUsed may … #5158
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,9 @@ class WALEntryBatch { | |
| private Map<String, Long> lastSeqIds = new HashMap<>(); | ||
| // indicate that this is the end of the current file | ||
| private boolean endOfFile; | ||
| // indicate the buffer size used, which is added to | ||
| // ReplicationSourceWALReader.totalBufferUsed | ||
| private long usedBufferSize; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we have recorded the size here, I think we could use it directly in many places(especially in ReplicationSourceShipper), so we do not need to calculate the size of the WALEntryBatch again? Anyway, can be a follow on issue.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Apache9 ,yes, I plan to open a new PR to centralize the totalBufferUsed related code and eliminate duplicate code. |
||
|
|
||
| /** | ||
| * @param lastWalPath Path of the WAL the last entry in this batch was read from | ||
|
|
@@ -153,11 +156,19 @@ public void setLastSeqId(String region, long sequenceId) { | |
| lastSeqIds.put(region, sequenceId); | ||
| } | ||
|
|
||
| public void incrementUsedBufferSize(long increment) { | ||
| usedBufferSize += increment; | ||
| } | ||
|
|
||
| public long getUsedBufferSize() { | ||
| return this.usedBufferSize; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "WALEntryBatch [walEntries=" + walEntriesWithSize + ", lastWalPath=" + lastWalPath | ||
| + ", lastWalPosition=" + lastWalPosition + ", nbRowKeys=" + nbRowKeys + ", nbHFiles=" | ||
| + nbHFiles + ", heapSize=" + heapSize + ", lastSeqIds=" + lastSeqIds + ", endOfFile=" | ||
| + endOfFile + "]"; | ||
| + endOfFile + ",usedBufferSize=" + usedBufferSize + "]"; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.