Package org.voltdb.client

Examples of org.voltdb.client.ClientResponse


        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());
       
       
        // TODO: We should go through the log and make sure that all of our
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()) {
            System.out.println("Jason,voltable:" + v);
            while (v.advanceRow()) {
                Integer key = new Integer ((int) v.getLong(0));
                assertTrue(map.containsKey(key));
                index = map.get(key);
View Full Code Here

            row[col++] = "null message";
            assertEquals(col, 10);
            vt.addRow(row);
        } // FOR
       
        ClientResponse cr = client.callProcedure("@LoadMultipartitionTable", catalog_tbl.getName(), vt);
        assertEquals(Status.OK, cr.getStatus());
       
        return (vt);
    }
View Full Code Here

        assert(HStoreConf.isConfParameter(paramName)) :
            "Invalid HStoreConf parameter '" + paramName + "'";
        String procName = VoltSystemProcedure.procCallName(SetConfiguration.class);
        String confParams[] = {paramName};
        String confValues[] = {paramValue.toString()};
        ClientResponse cresponse = client.callProcedure(procName, confParams, confValues);
        assert(cresponse.getStatus() == Status.OK) : cresponse.toString();
        return (cresponse);
    }
View Full Code Here

    }
   
    public static ClientResponse getStats(Client client, SysProcSelector statsType) throws Exception {
        String procName = VoltSystemProcedure.procCallName(Statistics.class);
        Object params[] = { statsType.name(), 0 };
        ClientResponse cresponse = client.callProcedure(procName, params);
        assert(cresponse.getStatus() == Status.OK) : cresponse.toString();
        return (cresponse);
    }
View Full Code Here

        return (cresponse);
    }
   
    public static ClientResponse sql(Client client, String sql) throws IOException, ProcCallException {
        String procName = VoltSystemProcedure.procCallName(AdHoc.class);
        ClientResponse cresponse = client.callProcedure(procName, sql);
        assert(cresponse.getStatus() == Status.OK) : cresponse.toString();
        return (cresponse);
    }
View Full Code Here

        return (cresponse);
    }
   
    public static ClientResponse load(Client client, Table tbl, VoltTable data) throws IOException, ProcCallException {
        String procName = VoltSystemProcedure.procCallName(LoadMultipartitionTable.class);
        ClientResponse cresponse = client.callProcedure(procName, tbl.getName(), data);
        assert(cresponse.getStatus() == Status.OK) : cresponse.toString();
        return (cresponse);
    }
View Full Code Here

        assert(cresponse.getStatus() == Status.OK) : cresponse.toString();
        return (cresponse);
    }
   
    public static long getRowCount(Client client, Table tbl) throws Exception {
        ClientResponse cresponse = getStats(client, SysProcSelector.TABLE);
        VoltTable result = cresponse.getResults()[0];
       
        long count = 0;
        boolean found = false;
        while (result.advanceRow()) {
            if (tbl.getName().equalsIgnoreCase(result.getString("TABLE_NAME"))) {
View Full Code Here

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

            // Each insert into the NO_NULLS table must fail with a
            // constraint failure.  Verify this.

            System.out.println("testNullsRejected: :" + k + " " + m_types[k]);
            try {
                ClientResponse cr = client.callProcedure("Insert", params);
                assertNotNull(cr);
            } catch (final ProcCallException e) {
                if (e.getMessage().contains("CONSTRAINT VIOLATION"))
                    caught = true;
                else {
View Full Code Here

TOP

Related Classes of org.voltdb.client.ClientResponse

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.