Examples of CBZip2InputStream


Examples of org.apache.tools.bzip2r.CBZip2InputStream

        pig.registerQuery("store A into '" + out.getAbsolutePath() + "';");
        FileSystem fs = FileSystem.get(ConfigurationUtil.toConfiguration(
                pig.getPigContext().getProperties()));
        FSDataInputStream is = fs.open(new Path(out.getAbsolutePath() +
                "/part-r-00000.bz2"));
        CBZip2InputStream cis = new CBZip2InputStream(is, -1, out.length());
       
        // Just a sanity check, to make sure it was a bzip file; we
        // will do the value verification later
        assertEquals(-1, cis.read(new byte[100]));
        cis.close();
       
        pig.registerQuery("B = load '" + out.getAbsolutePath() + "';");
        pig.openIterator("B");
       
        in.delete();
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

        CBZip2OutputStream cos = new CBZip2OutputStream(new FileOutputStream(
                tmp));
        cos.close();
        assertNotSame(0, tmp.length());
        FileSystem fs = FileSystem.getLocal(new Configuration(false));
        CBZip2InputStream cis = new CBZip2InputStream(
                fs.open(new Path(tmp.getAbsolutePath())), -1, tmp.length());
        assertEquals(-1, cis.read(new byte[100]));
        cis.close();
        tmp.delete();
    }
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

        pig.registerQuery("store A into '" + out.getAbsolutePath() + "';");
        FileSystem fs = FileSystem.get(ConfigurationUtil.toConfiguration(
                pig.getPigContext().getProperties()));
        FSDataInputStream is = fs.open(new Path(out.getAbsolutePath() +
                "/part-r-00000.bz2"));
        CBZip2InputStream cis = new CBZip2InputStream(is);
       
        // Just a sanity check, to make sure it was a bzip file; we
        // will do the value verification later
        assertEquals(100, cis.read(new byte[100]));
        cis.close();
       
        pig.registerQuery("B = load '" + out.getAbsolutePath() + "';");
       
        Iterator<Tuple> i = pig.openIterator("B");
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

        pig.registerQuery("store A into '" + out.getAbsolutePath() + "';");
        FileSystem fs = FileSystem.get(ConfigurationUtil.toConfiguration(
                pig.getPigContext().getProperties()));
        FSDataInputStream is = fs.open(new Path(out.getAbsolutePath() +
                "/part-r-00000.bz2"));
        CBZip2InputStream cis = new CBZip2InputStream(is);
       
        // Just a sanity check, to make sure it was a bzip file; we
        // will do the value verification later
        assertEquals(-1, cis.read(new byte[100]));
        cis.close();
       
        pig.registerQuery("B = load '" + out.getAbsolutePath() + "';");
        pig.openIterator("B");
       
        in.delete();
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

        CBZip2OutputStream cos = new CBZip2OutputStream(new FileOutputStream(
                tmp));
        cos.close();
        assertNotSame(0, tmp.length());
        FileSystem fs = FileSystem.getLocal(new Configuration(false));
        CBZip2InputStream cis = new CBZip2InputStream(
                fs.open(new Path(tmp.getAbsolutePath())));
        assertEquals(-1, cis.read(new byte[100]));
        cis.close();
        tmp.delete();
    }
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

        fsis.seek(start, FLAGS.SEEK_CUR);

        end = start + getLength();

        if (file.endsWith(".bz") || file.endsWith(".bz2")) {
            is = new CBZip2InputStream(fsis, 9);
        } else if (file.endsWith(".gz")) {
            is = new GZIPInputStream(fsis);
            // We can't tell how much of the underlying stream GZIPInputStream
            // has actually consumed
            end = Long.MAX_VALUE;
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

        fsis.seek(start, FLAGS.SEEK_CUR);

        end = start + getLength();

        if (file.endsWith(".bz") || file.endsWith(".bz2")) {
            is = new CBZip2InputStream(fsis, 9);
        } else if (file.endsWith(".gz")) {
            is = new GZIPInputStream(fsis);
            // We can't tell how much of the underlying stream GZIPInputStream
            // has actually consumed
            end = Long.MAX_VALUE;
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

           
            out.write(buffer, 0, buffer.length);
            out.close();
           
            LocalSeekableInputStream is = new LocalSeekableInputStream( testFile );
            CBZip2InputStream bzis = new CBZip2InputStream( is );
            BufferedPositionedInputStream bpis = new BufferedPositionedInputStream( bzis );
           
            PigLineRecordReader reader = new PigLineRecordReader( bpis, 0, 100 );

            Field lineReader = reader.getClass().getDeclaredField("lineReader");
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

                ps.println( text );
            }
            ps.close();
           
            LocalSeekableInputStream is = new LocalSeekableInputStream( testFile );
            CBZip2InputStream bzis = new CBZip2InputStream( is );
            BufferedPositionedInputStream bpis = new BufferedPositionedInputStream( bzis );
            PigLineRecordReader reader = new PigLineRecordReader( bpis, 0, Integer.MAX_VALUE );
           
            Text value = new Text();
            int counter = 0;
View Full Code Here

Examples of org.apache.tools.bzip2r.CBZip2InputStream

            ps.close();
           
            LocalSeekableInputStream is =
                new LocalSeekableInputStream( testFile );
           
            CBZip2InputStream bzis = new CBZip2InputStream( is );
           
            BufferedPositionedInputStream bpis =
                new BufferedPositionedInputStream( bzis );
           
            PigLineRecordReader reader = new PigLineRecordReader( bpis, 0,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.