Package org.voltdb.client

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


                new Long(i),
                PHONE_NUMBER + (i % 10),
                i % VoterConstants.NUM_CONTESTANTS,
                MAX_VOTES_PER_PHONE_NUMBER
            };
            client.callProcedure(callback, Vote.class.getSimpleName(), params);
        } // FOR
        System.err.printf("Invoked %d txns. Waiting for responses...\n", num_txns);
        boolean result = latch.await(15, TimeUnit.SECONDS);
        System.err.println("LATCH RESULT: " + result);
        System.err.println("TOTAL:        " + numTotal.get() + " / " + num_txns);
View Full Code Here


        assertEquals(0, numFailed.get());
       
        // At this point we know that all of our txns have been committed to disk
        // Make sure that our vote is actually in the real table and materialized views
        String query = "SELECT COUNT(*) FROM votes";
        ClientResponse cresponse = client.callProcedure("@AdHoc", query);
        System.err.println(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        VoltTable results[] = cresponse.getResults();
        assertEquals(1, results.length);
        assertEquals(numCompleted.get(), results[0].asScalarLong());
View Full Code Here

                rtLists.get(index).set(3, ((Integer)rtLists.get(index).get(3) ).intValue()+ 1);
            }
        }
       
        // execute MapReduce Transaction to check the result
        ClientResponse cr = client.callProcedure("MRquery1");
        assertEquals(Status.OK, cr.getStatus());
        System.out.println("I am starting to compare the results...");
        int index = -1;
        // 0:ol_number,1:sum(ol_quantity),2:SUM(ol_amount),3:weight(ol_quantity),4:weight(ol_amount),5:sum
        for ( VoltTable v : cr.getResults()) {
View Full Code Here

                "",
                "",
                VoltType.NULL_DECIMAL
        };

        results = client.callProcedure("Update", params).getResults();
        params = null;
        firstString = null;
        secondString = null;

        assertEquals(results.length, 1);
View Full Code Here

        secondString = null;

        assertEquals(results.length, 1);
        assertEquals( 1, results[0].asScalarLong());

        results = client.callProcedure("Select", "JUMBO_ROW", 0).getResults();
        assertEquals(results.length, 1);
        assertTrue(results[0].advanceRow());
        assertTrue(java.util.Arrays.equals( results[0].getStringAsBytes(1), firstStringBytes));
        assertTrue(java.util.Arrays.equals( results[0].getStringAsBytes(2), secondStringBytes));
    }
View Full Code Here

        params[0] = "ALLOW_NULLS";
        params[1] = 0;
        for (int i=0; i < COLS; i++) {
            params[i+2] = m_midValues[i];
        }
        client.callProcedure("Insert", params);

        // insert one row with the max values
        params[0] = "ALLOW_NULLS";
        params[1] = 1;
        for (int i=0; i < COLS; i++) {
View Full Code Here

        params[0] = "ALLOW_NULLS";
        params[1] = 1;
        for (int i=0; i < COLS; i++) {
            params[i+2] = m_maxValues[i];
        }
        client.callProcedure("Insert", params);

        // update the mid value to the minimum decimal value
        VoltTable[] result = client.callProcedure("UpdateDecimal", m_minValues[10], m_midValues[10]).getResults();

        // select that same row again by primary key
View Full Code Here

            params[i+2] = m_maxValues[i];
        }
        client.callProcedure("Insert", params);

        // update the mid value to the minimum decimal value
        VoltTable[] result = client.callProcedure("UpdateDecimal", m_minValues[10], m_midValues[10]).getResults();

        // select that same row again by primary key
        result = client.callProcedure("Select", "ALLOW_NULLS", 0).getResults();

        // and verify the row
View Full Code Here

        // update the mid value to the minimum decimal value
        VoltTable[] result = client.callProcedure("UpdateDecimal", m_minValues[10], m_midValues[10]).getResults();

        // select that same row again by primary key
        result = client.callProcedure("Select", "ALLOW_NULLS", 0).getResults();

        // and verify the row
        final VoltTableRow row = result[0].fetchRow(0);
        final BigDecimal bd = (row.getDecimalAsBigDecimal(11));
        assertTrue(comparisonHelper(m_minValues[10], bd, m_types[10]));
View Full Code Here

        params[5] = new TimestampType[1];
        params[6] = new BigDecimal[1];
        params[7] = new byte[1];

        // make sure the procedure CAN work.
        client.callProcedure("ParamSetArrays", params);

        // now cycle through invalid array lengths
        // these should fail in client serialization to the server
        params[0] = new short[Short.MAX_VALUE + 1];
        helper_testInvalidParameterSerializations(client, params);
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.