apache/hadoop · error · UnsupportedOperationException
Byte-buffer pread unsupported by ${className}
Error message
Byte-buffer pread unsupported by ${className} What it means
Error "Byte-buffer pread unsupported by ${className}" thrown in apache/hadoop.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java:262
public boolean hasCapability(String capability) {
return StoreImplementationUtils.hasCapability(in, capability);
}
/**
* String value. Includes the string value of the inner stream
* @return the stream
*/
@Override
public String toString() {
return super.toString() + ": " + in;
}
@Override
public int read(long position, ByteBuffer buf) throws IOException {
if (in instanceof ByteBufferPositionedReadable) {
return ((ByteBufferPositionedReadable) in).read(position, buf);
}
throw new UnsupportedOperationException("Byte-buffer pread unsupported " +
"by " + in.getClass().getCanonicalName());
}
/**
* Delegate to the underlying stream.
* @param position position within file
* @param buf the ByteBuffer to receive the results of the read operation.
* @throws IOException on a failure from the nested stream.
* @throws UnsupportedOperationException if the inner stream does not
* support this operation.
*/
@Override
public void readFully(long position, ByteBuffer buf) throws IOException {
if (in instanceof ByteBufferPositionedReadable) {
((ByteBufferPositionedReadable) in).readFully(position, buf);
} else {
throw new UnsupportedOperationException("Byte-buffer pread " +
"unsupported by " + in.getClass().getCanonicalName());View on GitHub (pinned to 2add963021)
Solutions
- Use positional byte-array pread instead of ByteBuffer pread.
- Check hasCapability("in:preadbytebuffer") before use; fall back to regular pread when unsupported.
When it happens
Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java:262 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/f70ec27dacf8cbcc.
Report an issue: GitHub.