Package org.apache.pig.data

Examples of org.apache.pig.data.WritableByteArray


    /**
     * The constructor that uses the default field delimiter.
     */
    public PigStreaming() {
        out = new WritableByteArray();
    }
View Full Code Here


    private static BagFactory bagFactory = BagFactory.getInstance();

    private WritableByteArray out;

    public PigStreamingUDF() {
        out = new WritableByteArray();
    }
View Full Code Here

    public PigStreamingUDF() {
        out = new WritableByteArray();
    }
   
    public PigStreamingUDF(FieldSchema topLevelFs) {
        out = new WritableByteArray();
        this.topLevelFs = topLevelFs;
    }
View Full Code Here

     * @param t input <code>Tuple</code>
     * @throws IOException
     */
    public void putNext(Tuple t) throws IOException {
        if (newSerializer != null) {
            WritableByteArray buf = newSerializer.serializeToBytes(t);
            out.write(buf.getData(), 0, buf.getLength());
        } else {
            out.write(serializer.serialize(t));
        }
    }
View Full Code Here

public abstract class PigStreamingBase implements PigToStream, StreamToPig {

    @Override
    @Deprecated
    public final byte[] serialize(Tuple t) throws IOException {
        WritableByteArray data = serializeToBytes(t);
        if (data.getLength() == data.getData().length) {
            return data.getData();
        } else {
            byte[] buf = new byte[data.getLength()];
            System.arraycopy(data.getData(), 0, buf, 0, data.getLength());
            return buf;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.data.WritableByteArray

Copyright © 2018 www.massapicom. 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.