Package org.voltdb.client

Examples of org.voltdb.client.ClientResponse


    public void testTransactionCounters() throws Exception {
        hstore_conf.site.txn_counters = true;
        hstore_site.updateConf(hstore_conf, null);
       
        Procedure catalog_proc = this.getProcedure(UpdateLocation.class);
        ClientResponse cr = null;
        int num_txns = 500;
       
        Object params[] = { 1234l, "XXXX" };
        for (int i = 0; i < num_txns; i++) {
            this.client.callProcedure(catalog_proc.getName(), params);
        } // FOR
        ThreadUtil.sleep(1000);
        assertEquals(num_txns, TransactionCounter.RECEIVED.get());
       
        // Now try invoking @Statistics to get back more information
        params = new Object[]{ SysProcSelector.TXNCOUNTER.name(), 0 };
        cr = this.client.callProcedure(VoltSystemProcedure.procCallName(Statistics.class), params);
//        System.err.println(cr);
        assertNotNull(cr);
        assertEquals(Status.OK, cr.getStatus());
       
        VoltTable results[] = cr.getResults();
        assertEquals(1, results.length);
        boolean found = false;
        while (results[0].advanceRow()) {
            if (results[0].getString(3).equalsIgnoreCase(catalog_proc.getName())) {
                for (int i = 4; i < results[0].getColumnCount(); i++) {
View Full Code Here


        hstore_conf.site.txn_counters = true;
        hstore_conf.site.txn_profiling = true;
        hstore_site.updateConf(hstore_conf, null);
       
        Procedure catalog_proc = this.getProcedure(UpdateLocation.class);
        ClientResponse cr = null;
        int num_txns = 500;
       
        Object params[] = { 1234l, "XXXX" };
        for (int i = 0; i < num_txns; i++) {
            this.client.callProcedure(catalog_proc.getName(), params);
        } // FOR
        ThreadUtil.sleep(1000);
        assertEquals(num_txns, TransactionCounter.RECEIVED.get());
       
        // Now try invoking @Statistics to get back more information
        // Invoke it multiple times to make sure we get something...
        String procName = VoltSystemProcedure.procCallName(Statistics.class);
        params = new Object[]{ SysProcSelector.TXNPROFILER.name(), 0 };
        String fields[] = { "TOTAL", "INIT_TOTAL" };
        for (int ii = 0; ii < 5; ii++) {
            cr = this.client.callProcedure(procName, params);
            System.err.println(VoltTableUtil.format(cr.getResults()[0]));
            assertNotNull(cr);
            assertEquals(Status.OK, cr.getStatus());
           
            VoltTable results[] = cr.getResults();
            assertEquals(1, results.length);
           
            if (ii != 0) continue;
           
            boolean found = false;
View Full Code Here

        //        System.err.printf("Finished evicting data.");


        // Our stats should now come back with one eviction executed
        procName = VoltSystemProcedure.procCallName(EvictHistory.class);
        ClientResponse cresponse = client.callProcedure(procName);
        assertEquals(cresponse.toString(), Status.OK, cresponse.getStatus());
        assertEquals(cresponse.toString(), 1, cresponse.getResults().length);
        VoltTable result_table = cresponse.getResults()[0];
        System.err.println(VoltTableUtil.format(result_table));

        return (m);
    }
View Full Code Here

        String procName = "ReadRecord";
        Object params[] = { 1 };

        start = System.currentTimeMillis()// start timer

        ClientResponse cresponse = client.callProcedure(procName, params);

        stop = System.currentTimeMillis();
        System.err.println("  Uneviction Time: " + (stop-start) + " ms");

//        procName = VoltSystemProcedure.procCallName(EvictedAccessHistory.class);
//        cresponse = client.callProcedure(procName);
//        assertEquals(cresponse.toString(), Status.OK, cresponse.getStatus());
//        assertEquals(cresponse.toString(), 1, cresponse.getResults().length);
//        VoltTable result = cresponse.getResults()[0];
//        assertEquals(1, result.getRowCount());
//        System.err.println(VoltTableUtil.format(result));

        procName = VoltSystemProcedure.procCallName(Statistics.class);
        Object params2[] = { SysProcSelector.ANTICACHE.name(), 0 };
        cresponse = this.client.callProcedure(procName, params2);
        assertEquals(cresponse.toString(), Status.OK, cresponse.getStatus());
        assertEquals(cresponse.toString(), 1, cresponse.getResults().length);
        VoltTable result = cresponse.getResults()[0];
        assertEquals(1, result.getRowCount());
        System.err.println(VoltTableUtil.format(result));
    }
View Full Code Here

            Procedure proc = this.getProcedure(SelectBlaster.class);
            Object params[] = new Object[keys.length];
            for (int i = 0; i < keys.length; i++) {
                params[i] = keys[i];
            } // FOR
            ClientResponse cresponse = this.client.callProcedure(proc.getName(), params);
            assertEquals(Status.OK, cresponse.getStatus());
           
            VoltTable results[] = cresponse.getResults();
            assertEquals(1, results.length);
            data[trial] = results[0].asScalarLong() / 1000000d;
            System.err.printf("  TRIAL %d: %.2f ms [# of Reads=%d]\n", trial, data[trial], num_reads);
        } // FOR
        double avg = MathUtil.arithmeticMean(data);
View Full Code Here

            row[0] = new Long(i);
            row[catalog_col.getIndex()] = 0l;
            vt.addRow(row);
        } // FOR
        String procName = VoltSystemProcedure.procCallName(LoadMultipartitionTable.class);
        ClientResponse cr = this.client.callProcedure(procName, catalog_tbl.getName(), vt);
        assertEquals(cr.toString(), Status.OK, cr.getStatus());
    }
View Full Code Here

        // TODO: Check that the string data has all been evicted.
       
        // Now execute a query that needs to access data from this block
        long expected = 1;
        Procedure proc = this.getProcedure("GetRecord");
        ClientResponse cresponse = this.client.callProcedure(proc.getName(), expected);
        assertEquals(Status.OK, cresponse.getStatus());
       
        // Check to make sure that our stats were updated
        VoltTable newStats[] = this.ee.getStats(SysProcSelector.TABLE, this.locators, false, 0L);
        assertEquals(1, newStats.length);
        System.err.println(VoltTableUtil.format(newStats));
        adv = newStats[0].advanceRow();
        assert(adv);
        for (int i = 0; i < statsFields.length; i++) {
            // ACTIVE
            assertEquals(statsFields[i], 0, newStats[0].getLong(statsFields[i]));
           
            // GLOBAL WRITTEN
            assertEquals(writtenFields[i], origStats[0].getLong(writtenFields[i]), newStats[0].getLong(writtenFields[i]));
           
            // GLOBAL READ
            assertEquals(readFields[i], origStats[0].getLong(writtenFields[i]), newStats[0].getLong(readFields[i]));
        } // FOR
       
        // Check that the global stats for the site matches too
        this.executor.getDebugContext().updateMemory();
        proc = this.getProcedure(VoltSystemProcedure.procCallName(Statistics.class));
        Object params[] = { SysProcSelector.MEMORY.name(), 0 };
        cresponse = this.client.callProcedure(proc.getName(), params);
        assertEquals(Status.OK, cresponse.getStatus());
        VoltTable results = cresponse.getResults()[0];
        adv = results.advanceRow();
        assert(adv);
        for (int i = 0; i < statsFields.length; i++) {
            // XXX: Skip the byte counters since it will be kilobytes
            if (statsFields[i].contains("BYTES")) continue;
View Full Code Here

        assertTrue("No tuples were evicted!"+evictResult, evicted > 0);
       
        // Now execute a query that needs to access data from this block
        long expected = 1;
        Procedure proc = this.getProcedure("GetRecord"); // Special Single-Stmt Proc
        ClientResponse cresponse = this.client.callProcedure(proc.getName(), expected);
        assertEquals(Status.OK, cresponse.getStatus());
       
        VoltTable results[] = cresponse.getResults();
        assertEquals(1, results.length);
        boolean adv = results[0].advanceRow();
        assertTrue(adv);
        assertEquals(expected, results[0].getLong(0));
View Full Code Here

        // Execute multiple queries that try to access tuples the same block
        // Only one should get an evicted access exception
        Procedure proc = this.getProcedure("GetRecord"); // Special Single-Stmt Proc
        for (int i = 1; i < 10; i++) {
            long expected = i;
            ClientResponse cresponse = this.client.callProcedure(proc.getName(), expected);
            assertEquals(Status.OK, cresponse.getStatus());
           
            VoltTable results[] = cresponse.getResults();
            assertEquals(1, results.length);
            boolean adv = results[0].advanceRow();
            assertTrue(adv);
            assertEquals(expected, results[0].getLong(0));
        } // FOR
View Full Code Here

    public void testTPCC() throws IOException, InterruptedException, ProcCallException {
       
        System.out.println("Starting testTPCC - Physical Recovery");               
      
        VoltTable results[] = null;
        ClientResponse cresponse = null;
        Client client = this.getClient();
        CatalogContext cc = this.getCatalogContext();      

        // Load database       
        try{
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.