Package com.thinkaurelius.titan.graphdb.database.serialize

Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeClassAndObject()


        TestClass c = new TestClass(5, 8, new short[]{1, 2, 3, 4, 5}, TestEnum.Two);
        Number n = new Double(3.555);
        out.writeObjectNotNull(str);
        out.putInt(i);
        out.writeObject(c, TestClass.class);
        out.writeClassAndObject(n);
        ReadBuffer b = out.getStaticBuffer().asReadBuffer();
        if (printStats) log.debug(bufferStats(b));
        String str2 = serialize.readObjectNotNull(b, String.class);
        assertEquals(str, str2);
        if (printStats) log.debug(bufferStats(b));
View Full Code Here


    @Test
    public void parallelDeserialization() throws InterruptedException {
        DataOutput out = serialize.getDataOutput(128, true);
        out.putLong(8);
        out.writeClassAndObject(Long.valueOf(8));
        TestClass c = new TestClass(5, 8, new short[]{1, 2, 3, 4, 5}, TestEnum.Two);
        out.writeObject(c, TestClass.class);
        final StaticBuffer b = out.getStaticBuffer();

        int numThreads = 100;
View Full Code Here

    @Test
    public void testObjectVerification() {
        KryoSerializer s = new KryoSerializer();
        DataOutput out = s.getDataOutput(128, true);
        Long l = Long.valueOf(128);
        out.writeClassAndObject(l);
        Calendar c = Calendar.getInstance();
        out.writeClassAndObject(c);
        NoDefaultConstructor dc = new NoDefaultConstructor(5);
        try {
            out.writeClassAndObject(dc);
View Full Code Here

        KryoSerializer s = new KryoSerializer();
        DataOutput out = s.getDataOutput(128, true);
        Long l = Long.valueOf(128);
        out.writeClassAndObject(l);
        Calendar c = Calendar.getInstance();
        out.writeClassAndObject(c);
        NoDefaultConstructor dc = new NoDefaultConstructor(5);
        try {
            out.writeClassAndObject(dc);
            fail();
        } catch (IllegalArgumentException e) {
View Full Code Here

        out.writeClassAndObject(l);
        Calendar c = Calendar.getInstance();
        out.writeClassAndObject(c);
        NoDefaultConstructor dc = new NoDefaultConstructor(5);
        try {
            out.writeClassAndObject(dc);
            fail();
        } catch (IllegalArgumentException e) {

        }
        TestTransientClass d = new TestTransientClass(101);
View Full Code Here

        } catch (IllegalArgumentException e) {

        }
        TestTransientClass d = new TestTransientClass(101);
        try {
            out.writeClassAndObject(d);
            fail();
        } catch (IllegalArgumentException e) {

        }
        out.writeObject(null, TestClass.class);
View Full Code Here

            Object value = ((TitanProperty) relation).getValue();
            Preconditions.checkNotNull(value);
            TitanKey key = (TitanKey) type;
            assert key.getDataType().isInstance(value);
            if (hasGenericDataType(key)) {
                writer.writeClassAndObject(value);
            } else {
                writer.writeObjectNotNull(value);
            }
        }
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.