hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abdul Qadeer" <qadeer.qad...@gmail.com>
Subject Re: Codec Returning null
Date Wed, 16 Jul 2008 18:53:12 GMT
Kylie,

If your file is e.g gzip compressed its name should end in .gz.  Codec
factory
tries to recognize compressed files by its extensions.

Abdul Qadeer

On Wed, Jul 16, 2008 at 11:47 AM, Kylie McCormick <kyliemccormick@gmail.com>
wrote:

> Hello:
> My filename extension for the input file is .txt.
>
> Thanks,
> Kylie
>
> On Wed, Jul 16, 2008 at 3:21 AM, Devaraj Das <ddas@yahoo-inc.com> wrote:
>
> > What does your file name extension look like?
> >
> > > -----Original Message-----
> > > From: Kylie McCormick [mailto:kyliemccormick@gmail.com]
> > > Sent: Wednesday, July 16, 2008 11:18 AM
> > > To: core-user@hadoop.apache.org
> > > Subject: Codec Returning null
> > >
> > > Hello Again!
> > >
> > > I'm running into a NullPointerException from the following
> > > code (taken from a recordreader). None of the other variables
> > > are returning null, I've check them all. I've checked the
> > > documentation, and I still don't know why the
> > > compressionCodecFactory would return a null result. Any ideas?
> > >
> > > Thank you!
> > > Kylie
> > >
> > >     public ServiceRecordReader(Configuration job, FileSplit split)
> > >         throws java.io.IOException {
> > >
> > >             final Path file = split.getPath();
> > >             compressionCodecs = new CompressionCodecFactory(job);
> > >             final CompressionCodec codec =
> > > compressionCodecs.getCodec(file);
> > >
> > >             //since we're not concerned with splits, we'll
> > > just open the objects
> > >             FileSystem fs = file.getFileSystem(job);
> > >             FSDataInputStream fileIn = fs.open(split.getPath());
> > >
> > >
> > >             if(codec != null) {
> > >
> > >                 in = new
> > > ServiceReader(codec.createInputStream(fileIn));
> > >
> > >             } else {
> > >
> > >                 throw new java.io.IOException("codec is null,
> > > curses... ");
> > >
> > >             }
> > >
> >
> >
>
>
> --
> The Circle of the Dragon -- unlock the mystery that is the dragon.
> http://www.blackdrago.com/index.html
>
> "Light, seeking light, doth the light of light beguile!"
> -- William Shakespeare's Love's Labor's Lost
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message