Package com.urbanairship.datacube.backfill

Examples of com.urbanairship.datacube.backfill.CollectionWritable.readFields()


        byte[] rawBytes = Base64.decodeBase64(base64.getBytes());
        DataInputBuffer in = new DataInputBuffer();
        in.reset(rawBytes, rawBytes.length);
       
        CollectionWritable cw = new CollectionWritable();
        cw.readFields(in);
        return (Collection<T>)cw.getCollection();
    }
   
    @Override
    public RecordReader<Writable, NullWritable> createRecordReader(final InputSplit split, TaskAttemptContext arg1)
View Full Code Here


        c.write(buf);
       
        DataInputBuffer in = new DataInputBuffer();
        in.reset(buf.getData(), buf.getLength());
        CollectionWritable roundTripped = new CollectionWritable();
        roundTripped.readFields(in);
       
        Assert.assertEquals(list, roundTripped.getCollection());
        Iterator<? extends Writable> it = roundTripped.getCollection().iterator();
        Assert.assertEquals(new IntWritable(1), it.next());
        Assert.assertEquals(new IntWritable(2), it.next());
View Full Code Here

        c.write(buf);
       
        DataInputBuffer in = new DataInputBuffer();
        in.reset(buf.getData(), buf.getLength());
        CollectionWritable roundTripped = new CollectionWritable();
        roundTripped.readFields(in);
       
        Assert.assertEquals(0, roundTripped.getCollection().size());
    }
}
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.