-
Notifications
You must be signed in to change notification settings - Fork 374
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
[CELEBORN-1835][CIP-8] Add tier writer base and memory tier writer #3065
Conversation
} | ||
waitTime -= WAIT_INTERVAL_MS | ||
} | ||
if (counter.get > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
numPendingWrites can bypass counter.get>0
flushBuffer = inputBuffer | ||
} | ||
|
||
def close(evict: Boolean = false): Long = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we synchronized when close?
metaHandler.beforeWrite(buf) | ||
ensureNotClosed() | ||
writerInternal(buf) | ||
updateMemoryMetric(buf.readableBytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move updateMemoryMetric to MemoryTierWriter
val dupBuf = flushBuffer.retainedDuplicate() | ||
// this flusher buffer is from memory tier writer, so that we can not keep the buffer | ||
flushTask = genFlushTask(finalFlush, false) | ||
MemoryManager.instance.releaseMemoryFileStorage(numBytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to MemoryTierWriter, releaseMemoryFileStorage and incrementDiskBuffer after evict finished
storageManager) { | ||
|
||
override def needEvict(): Boolean = { | ||
flushBuffer.readableBytes() > memoryFileStorageMaxFileSize && storageManager.localOrDfsStorageAvailable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lazy val for storageManager.localOrDfsStorageAvailable()
|
||
protected def writerInternal(buf: ByteBuf): Unit | ||
|
||
def updateMemoryMetric(numBytes: Int): Unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateMemoryMetric
can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, merge to main(v0.6.0)
What changes were proposed in this pull request?
Code coverage report:
NOTE:
Evict test needs file tier writer, so the branch coverage is not 100% in the memory tier.
Why are the changes needed?
Refactor partition data writer for CIP-8.
Does this PR introduce any user-facing change?
NO.
How was this patch tested?
GA.