apache/hadoop · warning · UnsupportedOperationException
skip not supported
Error message
skip not supported
What it means
S3ARemoteInputStream.skip() always throws UnsupportedOperationException("skip not supported"). Skipping forward must be done by seek(pos + n) on this seekable stream; the InputStream skip idiom (reading and discarding) was deliberately not implemented.
Source
Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/prefetch/S3ARemoteInputStream.java:483
throw new EOFException(FSExceptionMessages.CANNOT_SEEK_PAST_EOF + " " + pos);
}
}
// Unsupported functions.
@Override
public void mark(int readlimit) {
throw new UnsupportedOperationException("mark not supported");
}
@Override
public void reset() {
throw new UnsupportedOperationException("reset not supported");
}
@Override
public long skip(long n) {
throw new UnsupportedOperationException("skip not supported");
}
}
View on GitHub (pinned to 2add963021)
Solutions
- Replace skip(n) with seek(getPos() + n) on the seekable stream.
- Guard generic code: if (!stream.markSupported() && stream instanceof Seekable) { seek } else { skip } - or simply prefer seek on FSDataInputStream.
- Wrap the stream in BufferedInputStream, whose skip() works by buffered reads.
- Keep utility readers configurable to use seek-based positioning for Hadoop streams.
Example fix
// before
long remaining = n;
while (remaining > 0) { remaining -= stream.skip(remaining); } // throws
// after
if (stream instanceof org.apache.hadoop.fs.Seekable) {
((org.apache.hadoop.fs.Seekable) stream).seek(stream.getPos() + n);
} Defensive patterns
Strategy: fallback
Prevention
- Replace skip(n) with seek(getPos() + n) on FSDataInputStream/Seekable streams.
- Test stream-adapters against Hadoop filesystems, not just local files.
- BufferedInputStream wrapping also neutralizes skip() calls from libraries.
When it happens
Trigger: Calling skip(n) on the prefetcher's remote stream - often from libraries that use skip() as their standard 'advance' operation (compression streams, archive readers); test code using skip in read loops.
Common situations: Tools (gzip/zip/tar readers) that skip headers or entries; frameworks defaulting to skip() instead of seek() on FSDataInputStream; ported local-filesystem code.
Related errors
- mark not supported
- reset not supported
- Stream is closed!
- name + ": Stream is closed!"
- Cannot seek to a negative offset " + pos
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/6d862d3ef5fbfc3e.
Report an issue: GitHub.