Package org.voltdb

Examples of org.voltdb.StoredProcedureInvocation


//        } // SYNCH
//    }

    public static StoredProcedureInvocation decodeRequest(byte[] bytes) {
        final FastDeserializer fds = new FastDeserializer(ByteBuffer.wrap(bytes));
        StoredProcedureInvocation task;
        try {
            task = fds.readObject(StoredProcedureInvocation.class);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        task.buildParameterSet();
        return task;
    }
View Full Code Here


            public long getInstanceId() {
                return 0;
            }
            @Override
            public void invocationQueue(ByteBuffer serializedRequest, RpcCallback<byte[]> done) {
                StoredProcedureInvocation invocation = null;
                try {
                    invocation = FastDeserializer.deserialize(serializedRequest, StoredProcedureInvocation.class);
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
                LOG.debug("request: " + invocation.getProcName() + " " +
                        invocation.getParams().toArray().length);
                done.run(serializeResponse(new VoltTable[0], invocation.getClientHandle()));               
            }
        }
        PrintHandler printer = new PrintHandler();
        VoltProcedureListener listener = new VoltProcedureListener(0, eventLoop, printer);
        listener.bind();
View Full Code Here

            public long getInstanceId() {
                return 0;
            }
            @Override
            public void invocationQueue(ByteBuffer serializedRequest, RpcCallback<byte[]> done) {
                StoredProcedureInvocation invocation = null;
                try {
                    invocation = FastDeserializer.deserialize(serializedRequest, StoredProcedureInvocation.class);
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
                LOG.debug("request: " + invocation.getProcName() + " " +
                        invocation.getParams().toArray().length);
                done.run(serializeResponse(new VoltTable[0], invocation.getClientHandle()));               
            }
View Full Code Here

            for (int i = 0; i < m_nonCoordinatorSites.length; i++) {
                m_nonCoordinatorSites[i] = buf.getLong();
            }
        }

        m_invocation = new StoredProcedureInvocation();
        m_invocation.initFromBuffer(buf);
    }
View Full Code Here

        super.initFromBuffer(buf);
        m_clientInterfaceHandle = buf.getLong();
        m_connectionId = buf.getLong();
        m_isSinglePartition = buf.get() == 1;
        m_shouldReturnResultTables = buf.get() != 0;
        m_invocation = new StoredProcedureInvocation();
        m_invocation.initFromBuffer(buf);
    }
View Full Code Here

        for (int i = 0; i < partitionCount; i++) {
            m_involvedPartitions.add(buf.getInt());
        }

        if (buf.remaining() > 0) {
            m_invocation = new StoredProcedureInvocation();
            m_invocation.initFromBuffer(buf);
        } else {
            m_invocation = null;
        }
    }
View Full Code Here

            long hashinatorVersion = buf.getLong();
            byte[] hashinatorBytes = new byte[buf.getInt()];
            buf.get(hashinatorBytes);
            m_currentHashinatorConfig = Pair.of(hashinatorVersion, hashinatorBytes);
            // SPI must be the last to deserialize, it will take the remaining as parameter bytes
            m_invocation = new StoredProcedureInvocation();
            m_invocation.initFromBuffer(buf);
            m_commit = false;
        }
    }
View Full Code Here

            fail();
        }

        buf.flip();

        StoredProcedureInvocation spi = new StoredProcedureInvocation();
        try {
            spi.initFromBuffer(buf);
        } catch (IOException e) {
            e.printStackTrace();
            fail();
        }
View Full Code Here

            fail();
        }

        buf.flip();

        StoredProcedureInvocation spi = new StoredProcedureInvocation();
        try {
            spi.initFromBuffer(buf);
        } catch (IOException e) {
            e.printStackTrace();
            fail();
        }

        assertEquals(54321, spi.getClientHandle());
        assertEquals(12345, spi.getOriginalTxnId());
        assertEquals(56789, spi.getOriginalUniqueId());
        assertEquals("test", spi.getProcName());
    }
View Full Code Here

        assertEquals(56789, spi.getOriginalUniqueId());
        assertEquals("test", spi.getProcName());
    }

    public void testGetAsBytes() throws Exception {
        StoredProcedureInvocation spi = null;
        try {
            ByteBuffer buf = ByteBuffer.allocate(pi.getSerializedSize());
            pi.flattenToBuffer(buf);
            buf.flip();
            spi = new StoredProcedureInvocation();
            spi.initFromBuffer(buf);
        } catch (IOException e) {
            e.printStackTrace();
            fail();
        }
View Full Code Here

TOP

Related Classes of org.voltdb.StoredProcedureInvocation

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.