Package org.apache.pig.data

Examples of org.apache.pig.data.InterSedes


     * @param tuple
     * @throws IOException
     */
    private void testTupleSedes(Tuple tuple) throws IOException {
       
        InterSedes sedes = InterSedesFactory.getInterSedesInstance();
       
        //write the tuple into a DataOutputStream on bytearray
        ByteArrayOutputStream bout = new ByteArrayOutputStream(10*1024*1024);// 10 MB
        DataOutputStream out = new DataOutputStream(bout);
        sedes.writeDatum(out, tuple);
        out.flush();
       
        //read tuple back
        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
        DataInputStream in = new DataInputStream(bin);
        Tuple tupleout = (Tuple)sedes.readDatum(in);
       
        assertEquals(" Tuple before and after serialization are same ",
                tuple, tupleout);
       
    }
View Full Code Here


     * @param tuple
     * @throws IOException
     */
    private void testTupleSedes(Tuple tuple) throws IOException {
       
        InterSedes sedes = InterSedesFactory.getInterSedesInstance();
       
        //write the tuple into a DataOutputStream on bytearray
        ByteArrayOutputStream bout = new ByteArrayOutputStream(10*1024*1024);// 10 MB
        DataOutputStream out = new DataOutputStream(bout);
        sedes.writeDatum(out, tuple);
        out.flush();
       
        //read tuple back
        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
        DataInputStream in = new DataInputStream(bin);
        Tuple tupleout = (Tuple)sedes.readDatum(in);
       
        assertEquals(" Tuple before and after serialization are same ",
                tuple, tupleout);
       
    }
View Full Code Here

TOP

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

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.