Skip to content
Closed
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 @@ -122,13 +122,23 @@ public synchronized void flush() {
currentTierWriter.flush(false, false);
}

public synchronized boolean needHardSplitForMemoryShuffleStorage() {
if (!(currentTierWriter instanceof MemoryTierWriter)) {
public boolean needHardSplitForMemoryShuffleStorage() {
// Disk-backed writers never need this memory-only split check. Avoid contending with writes and
// evictions on the hot push path for the common case.
TierWriterBase tierWriter = currentTierWriter;
if (!(tierWriter instanceof MemoryTierWriter)) {
return false;
}
return !storageManager.localOrDfsStorageAvailable()
&& (currentTierWriter.fileInfo().getFileLength() > memoryFileStorageMaxFileSize
|| !MemoryManager.instance().memoryFileStorageAvailable());

synchronized (this) {
tierWriter = currentTierWriter;
if (!(tierWriter instanceof MemoryTierWriter)) {
return false;
}
return !storageManager.localOrDfsStorageAvailable()
&& (tierWriter.fileInfo().getFileLength() > memoryFileStorageMaxFileSize
|| !MemoryManager.instance().memoryFileStorageAvailable());
}
}

public synchronized void write(ByteBuf data) throws IOException {
Expand Down
Loading