Package org.voltdb.messaging

Examples of org.voltdb.messaging.FastDeserializer.readObject()


        assertNotNull(invocation_bytes);
       
        for (int partition = 0; partition < 100; partition+=3) {
            StoredProcedureInvocation.setBasePartition(partition, ByteBuffer.wrap(invocation_bytes));
            FastDeserializer fds = new FastDeserializer(invocation_bytes);
            StoredProcedureInvocation clone = fds.readObject(StoredProcedureInvocation.class);
            assertNotNull(clone);
            assert(clone.hasBasePartition());
            assertEquals(partition, clone.getBasePartition());
        } // FOR
    }
View Full Code Here


        byte[] invocation_bytes = FastSerializer.serialize(invocation);
        assertNotNull(invocation_bytes);

        // Let 'er rip!
        FastDeserializer fds = new FastDeserializer(invocation_bytes);
        StoredProcedureInvocation clone = fds.readObject(StoredProcedureInvocation.class);
        assertNotNull(clone);
        clone.buildParameterSet();
       
        assertEquals(invocation.getClientHandle(), clone.getClientHandle());
        assertEquals(invocation.getProcName(), clone.getProcName());
View Full Code Here

       
        for (int i = 0; i < 99; i++) {
            ByteBuffer b = ByteBuffer.wrap(invocation_bytes);
            ClientResponseImpl.setRestartCounter(b, i);
            FastDeserializer fds = new FastDeserializer(invocation_bytes);
            ClientResponseImpl clone = fds.readObject(ClientResponseImpl.class);
            assertNotNull(clone);
            assertEquals(i, clone.getRestartCounter());
        } // FOR
    }
   
View Full Code Here

       
        for (int partition : new int[]{ 1, 10, 100}) {
            ByteBuffer b = ByteBuffer.wrap(invocation_bytes);
            ClientResponseImpl.setBasePartition(b, partition);
            FastDeserializer fds = new FastDeserializer(invocation_bytes);
            ClientResponseImpl clone = fds.readObject(ClientResponseImpl.class);
            assertNotNull(clone);
            assertEquals(partition, clone.getBasePartition());
        } // FOR
    }
   
View Full Code Here

       
        for (Status s : Status.values()) {
            ByteBuffer b = ByteBuffer.wrap(invocation_bytes);
            ClientResponseImpl.setStatus(b, s);
            FastDeserializer fds = new FastDeserializer(invocation_bytes);
            ClientResponseImpl clone = fds.readObject(ClientResponseImpl.class);
            assertNotNull(clone);
            assertEquals(s, clone.getStatus());
        } // FOR
    }
   
View Full Code Here

        @Override
        public void handleMessage(ByteBuffer message, Connection c) {
            try {
                FastDeserializer fds = new FastDeserializer(message);
                StoredProcedureInvocation spi = fds.readObject(StoredProcedureInvocation.class);

                VoltTable vt[] = new VoltTable[1];
                vt[0] = new VoltTable(new VoltTable.ColumnInfo("Foo", VoltType.BIGINT));
                vt[0].addRow(1);
                ClientResponseImpl response =
View Full Code Here

         */
        public void handleInput(ByteBuffer message, Connection connection) {
            ClientResponseImpl response = null;
            FastDeserializer fds = new FastDeserializer(message);
            try {
                response = fds.readObject(ClientResponseImpl.class);
            } catch (IOException e) {
                e.printStackTrace();
            }
            ProcedureCallback cb = null;
            cb = m_callbacks.remove(response.getClientHandle());
View Full Code Here

            ParameterSet procParams = null;
            if (request.hasProcParams()) {
                FastDeserializer fds = new FastDeserializer(request.getProcParams().asReadOnlyByteBuffer());
                try {
                    procParams = fds.readObject(ParameterSet.class);
                } catch (Exception ex) {
                    String msg = String.format("Failed to deserialize procedure ParameterSet for txn #%d from %s",
                                               txn_id, request.getClass().getSimpleName());
                    throw new ServerFaultException(msg, ex, txn_id);
                }
View Full Code Here

                final FastDeserializer fds = new FastDeserializer(paramData.asReadOnlyByteBuffer());
                if (trace.val)
                    LOG.trace(String.format("Txn #%d paramData[%d] => %s",
                              txn_id, i, fds.buffer()));
                try {
                    parameterSets[i] = fds.readObject(ParameterSet.class);
                } catch (Exception ex) {
                    String msg = String.format("Failed to deserialize ParameterSet[%d] for txn #%d TransactionRequest", i, txn_id);
                    throw new ServerFaultException(msg, ex, txn_id);
                }
                // LOG.info("PARAMETER[" + i + "]: " + parameterSets[i]);
View Full Code Here

            if (fds == null) fds = new FastDeserializer(data.asReadOnlyByteBuffer());
            else fds.setBuffer(data.asReadOnlyByteBuffer());

            vt = null;
            try {
                vt = fds.readObject(VoltTable.class);
            } catch (Exception ex) {
                String msg = String.format("Failed to deserialize VoltTable[%d] for txn #%d", input_dep_id, txn_id);
                throw new ServerFaultException(msg, ex, txn_id);
            }
            assert(vt != null);
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.