Package org.voltdb

Examples of org.voltdb.ParameterSet.readExternal()


        // We will deserialize the rest of it later
        ParameterSet procParams = new ParameterSet();
        try {
            StoredProcedureInvocation.seekToParameterSet(buffer);
            incomingDeserializer.setBuffer(buffer);
            procParams.readExternal(incomingDeserializer);
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
        assert(procParams != null) :
            "The parameters object is null for new txn from client #" + client_handle;
View Full Code Here


        // Initialize the ParameterSet
        FastDeserializer incomingDeserializer = new FastDeserializer();
        ParameterSet procParams = new ParameterSet();
        try {
            incomingDeserializer.setBuffer(StoredProcedureInvocation.getParameterSet(paramsBuffer));
            procParams.readExternal(incomingDeserializer);
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
        assert(procParams != null) :
            "The parameters object is null for new txn from client #" + client_handle;
View Full Code Here

        params.setParameters(new Object[]{null, null, null});
        ByteBuffer buf = ByteBuffer.wrap(FastSerializer.serialize(params));
        buf.rewind();

        ParameterSet out = new ParameterSet();
        out.readExternal(new FastDeserializer(buf));

        assertEquals(3, out.toArray().length);
        assertNull(out.toArray()[0]);
    }
View Full Code Here

        params.setParameters(new Object[]{"foo"});
        ByteBuffer buf = ByteBuffer.wrap(FastSerializer.serialize(params));
        buf.rewind();

        ParameterSet out = new ParameterSet();
        out.readExternal(new FastDeserializer(buf));
        assertEquals(1, out.toArray().length);
        assertEquals("foo", out.toArray()[0]);
    }

    public void testStringsAsByteArray() throws IOException {
View Full Code Here

        params.setParameters(new Object[]{new byte[]{'f', 'o', 'o'}});
        ByteBuffer buf = ByteBuffer.wrap(FastSerializer.serialize(params));
        buf.rewind();

        ParameterSet out = new ParameterSet();
        out.readExternal(new FastDeserializer(buf));
        assertEquals(1, out.toArray().length);

        byte[] bin = (byte[]) out.toArray()[0];
        assertEquals(bin[0], 'f'); assertEquals(bin[1], 'o'); assertEquals(bin[2], 'o');
    }
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.