You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by maha <ma...@umail.ucsb.edu> on 2011/03/22 08:11:33 UTC

Check file is sequence?

Hello,

 Is there a way to check if a file foo is a Hadoop SequenceFile ? 

 Thanks,
 Maha

Re: Check file is sequence?

Posted by maha <ma...@umail.ucsb.edu>.
The Reader idea worked fine I guess :) Thanks,

Maha

On Mar 22, 2011, at 1:28 AM, Harsh J wrote:

> I do not know of an API-side thing that does this, but basically the
> first three bytes of a given sequence file would be 'S', 'E', 'Q'
> (which is checked), and following that is a version indicator numeral
> byte.
> 
> A silly (but working) way to use the libs itself to do this would be
> to construct a Reader object for the file and handle an IOException in
> case of 'not a sequence file'?
> 
> On Tue, Mar 22, 2011 at 12:41 PM, maha <ma...@umail.ucsb.edu> wrote:
>> Hello,
>> 
>>  Is there a way to check if a file foo is a Hadoop SequenceFile ?
>> 
>>  Thanks,
>>  Maha
>> 
> 
> 
> 
> -- 
> Harsh J
> http://harshj.com


Re: Check file is sequence?

Posted by Harsh J <qw...@gmail.com>.
I do not know of an API-side thing that does this, but basically the
first three bytes of a given sequence file would be 'S', 'E', 'Q'
(which is checked), and following that is a version indicator numeral
byte.

A silly (but working) way to use the libs itself to do this would be
to construct a Reader object for the file and handle an IOException in
case of 'not a sequence file'?

On Tue, Mar 22, 2011 at 12:41 PM, maha <ma...@umail.ucsb.edu> wrote:
> Hello,
>
>  Is there a way to check if a file foo is a Hadoop SequenceFile ?
>
>  Thanks,
>  Maha
>



-- 
Harsh J
http://harshj.com