Package com.twitter.chill

Examples of com.twitter.chill.KryoPool


       return KryoPool.withByteArrayOutputStream(1, kryoInstantiator);
    }
    @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);
    }
View Full Code Here


    }

    @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


    @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

Related Classes of com.twitter.chill.KryoPool

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.