Package org.voltdb.client

Examples of org.voltdb.client.Client.callProcedure()


        final String testString = "袪被";
        try {
            // Intentionally using a one byte string to make sure length preceded strings are handled correctly in the EE.
            client.callProcedure("InsertOrderLine", 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1.5, "a");
            client.callProcedure("InsertOrderLine", 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1.5, testString);
            client.callProcedure("InsertOrderLine", 3L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 1.5, "def");
            VoltTable[] results = client.callProcedure("SelectOrderLineByDistInfo", testString).getResults();
            assertEquals(1, results.length);
            VoltTable table = results[0];
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
View Full Code Here


        try {
            // Intentionally using a one byte string to make sure length preceded strings are handled correctly in the EE.
            client.callProcedure("InsertOrderLine", 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1.5, "a");
            client.callProcedure("InsertOrderLine", 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1.5, testString);
            client.callProcedure("InsertOrderLine", 3L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 1.5, "def");
            VoltTable[] results = client.callProcedure("SelectOrderLineByDistInfo", testString).getResults();
            assertEquals(1, results.length);
            VoltTable table = results[0];
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            String resultString = row.getString("OL_DIST_INFO");
View Full Code Here

    }

    public void testBatchedMultipartitionTxns() throws IOException, ProcCallException {
        Client client = getClient();

        ClientResponse cresponse = client.callProcedure("BatchedMultiPartitionTest");
        System.err.println(cresponse);
        VoltTable[] results = cresponse.getResults();
        assertEquals(5, results.length);
        assertEquals(1, results[0].asScalarLong());
        assertEquals(1, results[1].asScalarLong());
View Full Code Here

        String longString = sb.toString();
        assertEquals(STRLEN, longString.length());

        VoltTable[] results = null;
        try {
            results = client.callProcedure("WorkWithBigString", 1, longString).getResults();
        } catch (ProcCallException e) {
            e.printStackTrace();
            fail();
        }
        assertEquals(1, results.length);
View Full Code Here

        assertEquals(STRLEN, longString.length());


        VoltTable[] results = null;
        try {
            results = client.callProcedure("PassByteArrayArg", 1, 2, longString.getBytes("UTF-8")).getResults();
        } catch (ProcCallException e) {
            e.printStackTrace();
            fail();
        }
        assertEquals(1, results.length);
View Full Code Here

        String str = "foo";
        byte bString[] = "bar".getBytes("UTF-8");

        Client client = getClient();
        try {
            client.callProcedure("PassAllArgTypes", b, bArray, s, sArray, i, iArray, l, lArray, str, bString);
        } catch (Exception e) {
            fail();
        }
    }
View Full Code Here

    throws IOException, ProcCallException
    {
        Client client = getClient();
        for (int i = 0; i < ROWS; ++i)
        {
            client.callProcedure("Insert", table, i, "desc", i, 14.5);
        }
        VoltTable[] results = client.callProcedure("@AdHoc", update).getResults();
        // ADHOC update still returns number of modified rows * number of partitions
        // Comment this out until it's fixed; the select count should be good enough, though
        //assertEquals(expectedRowsChanged, results[0].asScalarLong());
View Full Code Here

        Client client = getClient();
        for (int i = 0; i < ROWS; ++i)
        {
            client.callProcedure("Insert", table, i, "desc", i, 14.5);
        }
        VoltTable[] results = client.callProcedure("@AdHoc", update).getResults();
        // ADHOC update still returns number of modified rows * number of partitions
        // Comment this out until it's fixed; the select count should be good enough, though
        //assertEquals(expectedRowsChanged, results[0].asScalarLong());
        String query = String.format("select count(%s.NUM) from %s where %s.NUM = -1",
                                     table, table, table);
View Full Code Here

        // ADHOC update still returns number of modified rows * number of partitions
        // Comment this out until it's fixed; the select count should be good enough, though
        //assertEquals(expectedRowsChanged, results[0].asScalarLong());
        String query = String.format("select count(%s.NUM) from %s where %s.NUM = -1",
                                     table, table, table);
        results = client.callProcedure("@AdHoc", query).getResults();
        assertEquals(expectedRowsChanged, results[0].asScalarLong());
    }

    public void testUpdate()
    throws IOException, ProcCallException
View Full Code Here

                    if (m_types[k] == VoltType.STRING)
                        curr_string++;
                }
                try {
                    caught = false;
                    client.callProcedure("Insert", params);
                } catch (final ProcCallException e) {
                    caught = true;
                }

                assertTrue(caught);
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.