Examples of toBytesWithClass()


Examples of com.twitter.chill.KryoPool.toBytesWithClass()

    }
    @Test
    public void testSpecificRecordSerializer() throws Exception {
        ClassTag<FiscalRecord> tag = getClassTag(FiscalRecord.class);
        KryoPool kryo = getKryo(tag, AvroSerializer$.MODULE$.SpecificRecordSerializer(tag));
        byte[] bytes = kryo.toBytesWithClass(fiscalRecord);
        FiscalRecord result = (FiscalRecord) kryo.fromBytes(bytes);
        assertEquals(fiscalRecord,result);
    }

    @Test
View Full Code Here

Examples of com.twitter.chill.KryoPool.toBytesWithClass()

    @Test
    public void SpecificRecordBinarySerializer() throws Exception {
        ClassTag<FiscalRecord> tag = getClassTag(FiscalRecord.class);
        KryoPool kryo = getKryo(tag, AvroSerializer$.MODULE$.SpecificRecordBinarySerializer(tag));
        byte[] bytes = kryo.toBytesWithClass(fiscalRecord);
        FiscalRecord result = (FiscalRecord) kryo.fromBytes(bytes);
        assertEquals(fiscalRecord,result);
    }

View Full Code Here

Examples of com.twitter.chill.KryoPool.toBytesWithClass()

    @Test
    public void testGenericRecord() throws Exception {
        ClassTag<GenericData.Record> tag = getClassTag(GenericData.Record.class);
        KryoPool kryo = getKryo(tag, AvroSerializer$.MODULE$.GenericRecordSerializer(schema,tag));
        byte[] userBytes = kryo.toBytesWithClass(user);
        GenericData.Record userResult = (GenericData.Record) kryo.fromBytes(userBytes);
        assertEquals(userResult.get("name").toString(),"Jeff");
        assertEquals(userResult.get("ID"),1);
        assertEquals(user.toString(), userResult.toString());
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.