Package org.voltdb.client

Examples of org.voltdb.client.ClientResponse


            this.evictData(client);
        } // FOR
       
        // Now force the system to fetch the block back in
        // long expected = 1;
        ClientResponse cresponse = client.callProcedure(procName, params);
        assertEquals(cresponse.toString(), Status.OK, cresponse.getStatus());
        assertEquals(cresponse.toString(), 1, cresponse.getResults().length);
        VoltTable result = cresponse.getResults()[0];
        // result.advanceRow();
        // assertEquals(cresponse.toString(), expected, result.getRowCount());
       
        // Our stats should now come back with one evicted access
        cresponse = client.callProcedure(VoltSystemProcedure.procCallName(EvictedAccessHistory.class));
        assertEquals(cresponse.toString(), Status.OK, cresponse.getStatus());
        assertEquals(cresponse.toString(), 1, cresponse.getResults().length);
        result = cresponse.getResults()[0];
        // assertEquals(1, result.getRowCount());
        System.err.println(VoltTableUtil.format(result));
       
        while (result.advanceRow()) {
            assertEquals(procName, result.getString("PROCEDURE"));
View Full Code Here


        System.err.println("-------------------------------");

        // Our stats should now come back with one eviction executed
        String procName = VoltSystemProcedure.procCallName(Statistics.class);
        Object params[] = { SysProcSelector.ANTICACHE.name(), 0 };
        ClientResponse cresponse = client.callProcedure(procName, params);
        assertEquals(cresponse.toString(), Status.OK, cresponse.getStatus());
        assertEquals(cresponse.toString(), 1, cresponse.getResults().length);
        VoltTable statsResult = cresponse.getResults()[0];

        System.err.println(VoltTableUtil.format(statsResult));

        // We need this just to get the name of the column
        AntiCacheManagerProfiler profiler = new AntiCacheManagerProfiler();
View Full Code Here

            this.evictData(client);
        } // FOR
       
        // Our stats should now come back with one eviction executed
        String 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 = cresponse.getResults()[0];
        assertEquals(num_evicts * catalogContext.numberOfPartitions, result.getRowCount());
        System.err.println(VoltTableUtil.format(result));
       
        while (result.advanceRow()) {
            long start = result.getLong("START");
View Full Code Here

    public void testTupleAccessCountIndex() throws Exception {
        CatalogContext catalogContext = this.getCatalogContext();
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTPCCDatabase(catalogContext, client);
       
        ClientResponse cresponse = RegressionSuiteUtil.getStats(client, SysProcSelector.TABLE);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        this.checkTupleAccessCount(TPCCConstants.TABLENAME_ITEM, cresponse.getResults()[0], 0);
       
        int expected = 20;
        for (int i = 0; i < expected; i++) {
            cresponse = client.callProcedure("GetItemIndex", 1);
            assertNotNull(cresponse);
            assertEquals(Status.OK, cresponse.getStatus());
        } // FOR
       
        cresponse = RegressionSuiteUtil.getStats(client, SysProcSelector.TABLE);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        this.checkTupleAccessCount(TPCCConstants.TABLENAME_ITEM, cresponse.getResults()[0], expected);
    }
View Full Code Here

    public void testTupleAccessCountNoIndex() throws Exception {
        CatalogContext catalogContext = this.getCatalogContext();
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTPCCDatabase(catalogContext, client);
       
        ClientResponse cresponse = RegressionSuiteUtil.getStats(client, SysProcSelector.TABLE);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        this.checkTupleAccessCount(TPCCConstants.TABLENAME_ITEM, cresponse.getResults()[0], 0);
       
        int expected = 20;
        for (int i = 0; i < expected; i++) {
            cresponse = client.callProcedure("GetItemNoIndex");
            assertNotNull(cresponse);
            assertEquals(Status.OK, cresponse.getStatus());
        } // FOR
       
        cresponse = RegressionSuiteUtil.getStats(client, SysProcSelector.TABLE);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        this.checkTupleAccessCount(TPCCConstants.TABLENAME_ITEM, cresponse.getResults()[0], expected);
    }
View Full Code Here

        // Skip this test if there is only one partition
        if (catalogContext.numberOfPartitions == 1) return;
       
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTPCCDatabase(catalogContext, client);
        ClientResponse cresponse;

        // Invoke a NewOrder DTXN
        Object params[] = RegressionSuiteUtil.generateNewOrder(catalogContext.numberOfPartitions, true, 1, 1);
        cresponse = client.callProcedure(neworder.class.getSimpleName(), params);
        assertEquals(Status.OK, cresponse.getStatus());
        assertFalse(cresponse.toString(), cresponse.isSinglePartition());
       
        // Check that our remote query counters got increased
        cresponse = RegressionSuiteUtil.getStats(client, SysProcSelector.TXNPROFILER);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        VoltTable results[] = cresponse.getResults();
        assertEquals(1, results.length);
        // System.out.println(VoltTableUtil.format(results[0]));
       
        Map<String, Long> profilerStats = new TreeMap<String, Long>();
        while (results[0].advanceRow()) {
View Full Code Here

    public void testIndexStats() throws Exception {
        CatalogContext catalogContext = this.getCatalogContext();
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTPCCDatabase(catalogContext, client);

        ClientResponse cresponse = RegressionSuiteUtil.getStats(client, SysProcSelector.INDEX);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());

        // Loop through each table and make sure that each index reports back at least
        // some amount of data.
        VoltTable result = cresponse.getResults()[0];
        for (Table tbl : catalogContext.getDataTables()) {
            if (tbl.getIndexes().isEmpty()) continue;

            for (Index idx : tbl.getIndexes()) {
                result.resetRowPosition();
View Full Code Here

            expectedValues.put(c_b_a_id, total / (double)values.get(c_b_a_id).size());
        } // FOR
        System.err.println("EXPECTED AVERAGES (C_VALUE0)\n" + StringUtil.formatMaps(expectedValues));
       
        VoltTable result = null;
        ClientResponse cr = client.callProcedure("SimpleAggregate");
        assertEquals(Status.OK, cr.getStatus());
        assertEquals(cr.toString(), 1, cr.getResults().length);
        result = cr.getResults()[0];
        assertNotNull(result);
        System.err.println(result);
       
        while (result.advanceRow()) {
            Integer c_b_a_id = Integer.valueOf((int)result.getLong(0));
View Full Code Here

                } // FOR
                colValues.add(total / (double)vals.size());
            } // FOR
        } // FOR
       
        ClientResponse cr = client.callProcedure("MultiAggregate");
        assertEquals(Status.OK, cr.getStatus());
        assertEquals(cr.toString(), 1, cr.getResults().length);
        result = cr.getResults()[0];
        assertNotNull(result);
        System.err.println(result);
       
        int query_offsets[] = { 3, 4 };
        int expected_offsets[] = { 3, 4 };
View Full Code Here

                row[col] = val;
            } // FOR
            vt.addRow(row);
        } // FOR
       
        ClientResponse cr = client.callProcedure("@LoadMultipartitionTable", catalog_tbl.getName(), vt);
        assertEquals(Status.OK, cr.getStatus());
       
        return (vt);
    }
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.