Package org.voltdb

Examples of org.voltdb.VoltTable


       
    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       
View Full Code Here


        Client client = this.getClient();
        String procName = VoltSystemProcedure.procCallName(AdHoc.class);
        ClientResponse cr;
       
        cr = client.callProcedure(procName, "INSERT INTO NEW_ORDER VALUES (1, 1, 1);");
        VoltTable modCount = cr.getResults()[0];
        assertTrue(modCount.getRowCount() == 1);
        assertTrue(modCount.asScalarLong() == 1);

        cr = client.callProcedure(procName, "SELECT * FROM NEW_ORDER;");
        VoltTable result = cr.getResults()[0];
        assertTrue(result.getRowCount() == 1);
        // System.out.println(result.toString());

        boolean caught = false;
        try {
            client.callProcedure("@AdHoc", "SLEECT * FROOM NEEEW_OOORDERERER;");
View Full Code Here

        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

        ClientResponse cresponse = client.callProcedure(procName, params);
        assertNotNull(cresponse);
        assertEquals(Status.OK, cresponse.getStatus());
        assertEquals(1, cresponse.getResults().length);
       
        VoltTable vt = cresponse.getResults()[0];
        boolean adv = vt.advanceRow();
        assert(adv);
        assertEquals(key, vt.getLong(0));
    }
View Full Code Here

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

        // Load database       
View Full Code Here

        Client client = this.getClient();
        CatalogContext catalogContext = this.getCatalogContext();
        Table catalog_tbl = catalogContext.getTableByName(TPCCConstants.TABLENAME_ITEM);
        assertTrue(catalog_tbl.getIsreplicated());
        int expectedNumItems = 10;
        VoltTable vt = CatalogUtil.getVoltTable(catalog_tbl);
        for (int i = 0; i < expectedNumItems; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = i;
            vt.addRow(row);
        } // FOR
        RegressionSuiteUtil.load(client, catalog_tbl, vt);
       
        long numItems = RegressionSuiteUtil.getRowCount(client, catalog_tbl);
        assertEquals(expectedNumItems, numItems);
View Full Code Here

            VoltTable[] results = client.callProcedure("FeaturesSelectAll").getResults();

            assertEquals(5, results.length);

            // get the order line table
            VoltTable table = results[2];
            assertEquals(table.getColumnName(0), "OL_O_ID");
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            assertEquals(row.getLong("OL_O_ID"), 1);
            assertEquals(row.getLong("OL_D_ID"), 6);
            assertEquals(row.getLong("OL_W_ID"), 1);
            assertEquals(row.getLong("OL_QUANTITY"), 1);
            assertEquals(row.getLong("OL_SUPPLY_W_ID"), 5);
View Full Code Here

            VoltTable[] results = client.callProcedure("SelfJoinTest", 1L).getResults();

            assertEquals(results.length, 1);

            // get the new order table
            VoltTable table = results[0];
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            assertEquals(row.getLong("NO_D_ID"), 3);

        } catch (ProcCallException e) {
            e.printStackTrace();
            fail();
View Full Code Here

            VoltTable[] results = client.callProcedure("FeaturesSelectAll").getResults();

            assertEquals(5, results.length);

            // get the order line table
            VoltTable table = results[2];
            assertEquals(table.getColumnName(0), "OL_O_ID");
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            String resultString = row.getString("OL_DIST_INFO");
            assertEquals(testString, resultString);
        }
        catch (ProcCallException e) {
            e.printStackTrace();
View Full Code Here

            client.callProcedure("InsertOrderLine", 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 1.5, "a");
            client.callProcedure("InsertOrderLine", 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1.5, testString);
            client.callProcedure("InsertOrderLine", 3L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 1.5, "def");
            VoltTable[] results = client.callProcedure("SelectOrderLineByDistInfo", testString).getResults();
            assertEquals(1, results.length);
            VoltTable table = results[0];
            assertTrue(table.getRowCount() == 1);
            VoltTableRow row = table.fetchRow(0);
            String resultString = row.getString("OL_DIST_INFO");
            assertEquals(testString, resultString);
        }
        catch (ProcCallException e) {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.voltdb.VoltTable

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.