hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raghu Angadi <rang...@yahoo-inc.com>
Subject Re: Problem with InputStream.skip()
Date Tue, 29 May 2007 22:34:18 GMT

We should force subclasses of FSInputStream to implement skip if skip is 
  expected to be used. Only way I could think of achieving is to define

long skip(long len)  throws IOException {
    throw new IOException("Subclasses of FSInputStream should implement 

This makes sense for all the current FSInputStreams. But not sure if 
there is any way for subclasses to call InputStream.skip() is that makes 


Doug Cutting wrote:
> Raghu Angadi wrote:
>> Also, reading from block supports 'real skip', ie, it does not check 
>> checksum if an entire checksum block (usually 512 bytes) falls within 
>> the skip range. Another reason to implement our own skip.
> Yes, I don't see an alternative to implementing skip ourselves.  The 
> optimization in InputStream#skip(), of using a static buffer, requires 
> this.  Hopefully this method, like much of the checksum code, will be 
> shared between the generic ChecksumFileSystem and DFS's optimized 
> checksum implementation.
> Doug

View raw message