Package org.voltdb

Examples of org.voltdb.VoltTable.advanceRow()


        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"));
        } // WHILE       
    }
   
    // --------------------------------------------------------------------------------------------
View Full Code Here


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

        // We need this just to get the name of the column
        AntiCacheManagerProfiler profiler = new AntiCacheManagerProfiler();
        String colName = profiler.eviction_time.getName().toUpperCase()+"_CNT";
        while (statsResult.advanceRow()) {
            System.err.println("colName: " + colName);
            int partition = (int)statsResult.getLong("PARTITION");
            VoltTable vt = evictResults.get(partition);
            boolean adv = vt.advanceRow();
            assert(adv);
View Full Code Here

        String colName = profiler.eviction_time.getName().toUpperCase()+"_CNT";
        while (statsResult.advanceRow()) {
            System.err.println("colName: " + colName);
            int partition = (int)statsResult.getLong("PARTITION");
            VoltTable vt = evictResults.get(partition);
            boolean adv = vt.advanceRow();
            assert(adv);
            long expected = vt.getLong("ANTICACHE_BLOCKS_EVICTED");
            assertEquals("Partition "+partition, expected, statsResult.getLong(colName));
        } // WHILE
    }
View Full Code Here

        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");
            long stop = result.getLong("STOP");
            assert(start <= stop) : start + " <= " + stop;
        } // WHILE
    }
View Full Code Here

        assertEquals(expectedRows, rowCount);

        // System.out.println("Check table :: \n"+result);

        int i = 0;
        while (result.advanceRow()) {
            assertEquals(i, result.getLong(0));
            assertEquals("name_" + i, result.getString(1));
            assertEquals(i, result.getLong(2));
            assertEquals(new Double(i), result.getDouble(3));
            ++i;
View Full Code Here

        for (Table tbl : catalogContext.getDataTables()) {
            if (tbl.getIndexes().isEmpty()) continue;

            for (Index idx : tbl.getIndexes()) {
                result.resetRowPosition();
                while (result.advanceRow()) {
                    String idxName = result.getString("INDEX_NAME");
                    String tblName = result.getString("TABLE_NAME");
                    String idxType = result.getString("INDEX_TYPE");
                    long entryCount= result.getLong("ENTRY_COUNT");
                    if (tbl.getName().equalsIgnoreCase(tblName) && idx.getName().equalsIgnoreCase(idxName)) {
View Full Code Here

        assertNotNull(catalog_col);
       
        // Compute the AVG in Java so that we can compare
        Map<Integer, List<Integer>> values = new HashMap<Integer, List<Integer>>();
        vt.resetRowPosition();
        while (vt.advanceRow()) {
            int c_b_a_id = (int)vt.getLong(2) % num_partitions;
            if (values.containsKey(c_b_a_id) == false) {
                values.put(c_b_a_id, new ArrayList<Integer>());
            }
            values.get(c_b_a_id).add((int)vt.getLong(catalog_col.getIndex()));
View Full Code Here

        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));
            double actual = result.getDouble(1);
            Double expected = expectedValues.get(c_b_a_id);
            assertNotNull(c_b_a_id.toString(), expected);
            assertEquals(c_b_a_id.toString(), expected.doubleValue(), actual, 0.1);
View Full Code Here

        assertNotNull(result);
        System.err.println(result);
       
        int query_offsets[] = { 3, 4 };
        int expected_offsets[] = { 3, 4 };
        while (result.advanceRow()) {
            Integer c_b_a_id = Integer.valueOf((int)result.getLong(0));
            for (int i = 0; i < query_offsets.length; i++) {
                double actual = result.getDouble(query_offsets[i]);
                Double expected = expectedValues.get(c_b_a_id).get(expected_offsets[i]);
                assertNotNull(c_b_a_id.toString(), expected);
View Full Code Here

            vt.addRow(row);
        } // FOR
        assertEquals(num_rows, vt.getRowCount());
       
        vt.resetRowPosition();
        while (vt.advanceRow()) {
            VoltTableRow row = vt.getRow();
            long w_id = row.getLong(catalog_col.getIndex());
            int p = p_estimator.getTableRowPartition(catalog_tbl, row);
            assert(p >= 0 && p <= NUM_PARTITIONS);
           
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.