-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-18296. Memory fragmentation in ChecksumFileSystem readVectored() #7732
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
base: branch-3.4
Are you sure you want to change the base?
Changes from all commits
86d6bac
995fcc4
3c855c0
0ea6638
b51f2e8
de78242
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 |
---|---|---|
|
@@ -72,6 +72,7 @@ | |
import org.apache.hadoop.util.StringUtils; | ||
|
||
import static org.apache.hadoop.fs.VectoredReadUtils.LOG_BYTE_BUFFER_RELEASED; | ||
import static org.apache.hadoop.fs.VectoredReadUtils.hasVectorIOCapability; | ||
import static org.apache.hadoop.fs.VectoredReadUtils.sortRangeList; | ||
import static org.apache.hadoop.fs.VectoredReadUtils.validateRangeRequest; | ||
import static org.apache.hadoop.fs.impl.PathCapabilitiesSupport.validatePathCapabilityArgs; | ||
|
@@ -293,15 +294,12 @@ public FileDescriptor getFileDescriptor() throws IOException { | |
|
||
@Override | ||
public boolean hasCapability(String capability) { | ||
// a bit inefficient, but intended to make it easier to add | ||
// new capabilities. | ||
switch (capability.toLowerCase(Locale.ENGLISH)) { | ||
case StreamCapabilities.IOSTATISTICS: | ||
case StreamCapabilities.IOSTATISTICS_CONTEXT: | ||
case StreamCapabilities.VECTOREDIO: | ||
return true; | ||
default: | ||
return false; | ||
return hasVectorIOCapability(capability); | ||
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. Does this actually change the logic? It seems like |
||
} | ||
} | ||
|
||
|
@@ -400,7 +398,9 @@ private void initiateRead() { | |
for(int i = 0; i < ranges.size(); ++i) { | ||
FileRange range = ranges.get(i); | ||
buffers[i] = allocateRelease.getBuffer(false, range.getLength()); | ||
channel.read(buffers[i], range.getOffset(), i, this); | ||
final ByteBuffer buffer = buffers[i]; | ||
There was a problem hiding this comm 10000 ent. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any specific reason for this refactoring and making it final? |
||
LOG.debug("Reading file range {} into buffer {}", range, System.identityHashCode(buffer)); | ||
channel.read(buffer, range.getOffset(), i, this); | ||
} | ||
} | ||
|
||
|
@@ -416,6 +416,8 @@ private void initiateRead() { | |
public void completed(Integer result, Integer rangeIndex) { | ||
FileRange range = ranges.get(rangeIndex); | ||
ByteBuffer buffer = buffers[rangeIndex]; | ||
LOG.debug("Completed read range {} into buffer {} outcome={} remaining={}", | ||
range, System.identityHashCode(buffer), result, buffer.remaining()); | ||
if (result == -1) { | ||
// no data was read back. | ||
failed(new EOFException("Read past End of File"), rangeIndex); | ||
|
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.
Unnecessary change?