Examples of callProcedure()


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

    public void testInitialize() throws Exception {
        Client client = this.getClient();
        this.initializeDatabase(client, NUM_TUPLES);
       
        String query = "SELECT COUNT(*) FROM " + YCSBConstants.TABLE_NAME;
        ClientResponse cresponse = client.callProcedure("@AdHoc", query);
        assertEquals(Status.OK, cresponse.getStatus());
        VoltTable results[] = cresponse.getResults();
        assertEquals(1, results.length);
        assertEquals(NUM_TUPLES, results[0].asScalarLong());
        System.err.println(results[0]);
View Full Code Here

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

        this.initializeDatabase(client, NUM_TUPLES);
       
        long key = NUM_TUPLES / 2;
        String procName = ReadRecord.class.getSimpleName();
        Object params[] = { key };
        ClientResponse cresponse = client.callProcedure(procName, params);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        assertEquals(1, cresponse.getResults().length);
       
        VoltTable vt = cresponse.getResults()[0];
View Full Code Here

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

        for (String table : tables)
        {
            Client client = getClient();
            for (int i = 0; i < ROWS; ++i)
            {
                client.callProcedure("Insert", table, i, "desc",
                                     new BigDecimal(10.0), i / 2, 14.5);
            }
            String query = String.format("select distinct %s.NUM from %s",
                                         table, table);
            VoltTable[] results = client.callProcedure("@AdHoc", query).getResults();
View Full Code Here

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

                client.callProcedure("Insert", table, i, "desc",
                                     new BigDecimal(10.0), i / 2, 14.5);
            }
            String query = String.format("select distinct %s.NUM from %s",
                                         table, table);
            VoltTable[] results = client.callProcedure("@AdHoc", query).getResults();
            // lazy check that we get 5 rows back, put off checking contents
            assertEquals(5, results[0].getRowCount());
        }
    }
   
View Full Code Here

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

           
            for (int i = 0; i < ROWS; ++i) {
                BigDecimal cash = new BigDecimal(10.0);
                long num = i / 2;
                double ratio = rand.nextDouble();
                client.callProcedure("Insert", table, i, "desc", cash, num, ratio);
                val_nums.add(num);
                val_ratios.add(ratio);
            } // FOR
           
            double expected_results[] = {
View Full Code Here

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

            double expected_results[] = {
                MathUtil.arithmeticMean(val_nums),
                MathUtil.arithmeticMean(val_ratios),
            };
            String query = String.format("SELECT AVG(NUM), AVG(RATIO) FROM %s", table);
            VoltTable[] results = client.callProcedure("@AdHoc", query).getResults();
            assertEquals(1, results.length);
            assertEquals(1, results[0].getRowCount());
            assertTrue(results[0].advanceRow());
            for (int i = 0; i < expected_results.length; ++i) {
                double val = ((Number)results[0].get(i, results[0].getColumnType(i))).doubleValue();
View Full Code Here

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

        String[] tables = {"P1", "R1"};
       
        for (String table : tables) {
            Client client = getClient();
            for (int i = 0; i < ROWS; ++i) {
                client.callProcedure("Insert", table, i, "desc",
                                     new BigDecimal(10.0), i / 2, 14.5);
            } // FOR
       
            String query = "SELECT ";
            for (int i = 0; i < aggs.length; ++i) {
View Full Code Here

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

                if (i > 0) query += ", ";
                query += String.format("%s(%s.NUM)", aggs[i], table);
            } // FOR
            query += "FROM " + table;
           
            VoltTable[] results = client.callProcedure("@AdHoc", query).getResults();
            assertEquals(1, results.length);
            assertEquals(1, results[0].getRowCount());
            assertTrue(results[0].advanceRow());
            for (int i = 0; i < aggs.length; ++i) {
                // Do avg separately since the column is a float
View Full Code Here

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

        for (String table : tables)
        {
            Client client = getClient();
            for (int i = 0; i < ROWS; ++i)
            {
                client.callProcedure("Insert", table, i, "desc",
                                     new BigDecimal(10.0), i / 2, 14.5);
            }
            for (int i = 0; i < aggs.length; ++i)
            {
                String query = String.format("select %s(%s.NUM) from %s",
View Full Code Here

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

            }
            for (int i = 0; i < aggs.length; ++i)
            {
                String query = String.format("select %s(%s.NUM) from %s",
                                             aggs[i], table, table);
                VoltTable[] results = client.callProcedure("@AdHoc", query).getResults();
                assertEquals(expected_results[i], results[0].asScalarLong());
            }
            // Do avg separately since the column is a float and makes
            // asScalarLong() unhappy
            String query = String.format("select avg(%s.NUM) from %s",
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.