Examples of VoltTable


Examples of org.voltdb.VoltTable

        {
            Column c = iCols.next();
            vtCols[c.getIndex()] = new VoltTable.ColumnInfo(c.getName(), VoltType.get((byte) c.getType()));
        }

        return new VoltTable(vtCols);
    }
View Full Code Here

Examples of org.voltdb.VoltTable

    {
        Map<String, VoltTable> memory = new HashMap<String, VoltTable>();
        for (AbstractTable at : getAllTables())
        {
            String sTblName = at.getName();
            VoltTable vt = TableEnv.initVoltTable(at.getName());

            String sLinkPath = at.getCsvLinkPath();
            if (sLinkPath != CodeGenerator.NO_CSV_PATH)
            {
                loadTableFromCsv(sTblName, sLinkPath, vt, memory);
            }
            else
            {
                loadTableByRandom(at, vt, memory);
            }

            System.err.println(sTblName + ": loading final " + vt.getRowCount() + " rows. ");
        }
    }
View Full Code Here

Examples of org.voltdb.VoltTable

            {
                final int iCol = col.getIndex();
                Column referredCol = TableEnv.getReferredColumn(col);
                if (referredCol != null)
                {
                    VoltTable referredTbl = memory.get(referredCol.getParent().getName());
                    row[iCol] = pickRandomVal(referredTbl, referredCol);
                }
                else
                {
                    row[iCol] = at.getColumnValGenerators()[iCol].genRandVal();
View Full Code Here

Examples of org.voltdb.VoltTable

        client = new TPCCClient(mockClient, generator, new Clock.Mock(),
                new ScaleParameters(SMALL_ITEMS, 1, 1, SMALL_DISTRICTS, SMALL_CUSTOMERS, 0), this.config);
    }

    public void testStockLevel() throws IOException {
        VoltTable t = new VoltTable(new VoltTable.ColumnInfo("foo", VoltType.BIGINT));
        t.addRow(0);
        mockClient.nextResult = new VoltTable[]{ t };
        client.m_tpccSim.doStockLevel();
        assertEquals(TPCCConstants.STOCK_LEVEL, mockClient.calledName);
        assertEquals(3, mockClient.calledParameters.length);
        assertEquals(1L, mockClient.calledParameters[0])// w_id
View Full Code Here

Examples of org.voltdb.VoltTable

        assertEquals((long) TPCCConstants.DISTRICTS_PER_WAREHOUSE, mockClient.calledParameters[1]);
        assertEquals(72L, mockClient.calledParameters[2])// c_id
    }

    public void testDelivery() throws IOException {
        VoltTable orders = new VoltTable(
                new VoltTable.ColumnInfo("", VoltType.BIGINT)
        );
        for (int i = 0; i < TPCCConstants.DISTRICTS_PER_WAREHOUSE; ++i) {
            orders.addRow((long) i);
        }
        mockClient.nextResult = new VoltTable[]{ orders };
        client.m_tpccSim.doDelivery();
        assertEquals("delivery", mockClient.calledName);
        assertEquals(3, mockClient.calledParameters.length);
View Full Code Here

Examples of org.voltdb.VoltTable

            }
        } // FOR
       
        // We should always get back the same handle each time.
        try {
            VoltTable result0 = this.ee.trackingReadSet(txnId);
            VoltTable result1 = this.ee.trackingReadSet(txnId);
            assert(result0 == result1);
        } finally {
            this.finishTxn(voltProc);
        }
    }
View Full Code Here

Examples of org.voltdb.VoltTable

                expectedTables.add(tbl.getName());
            }
        } // FOR
       
        // Let's take a peek at its ReadSet
        VoltTable result = this.ee.trackingReadSet(txnId);
        assertNotNull(result);
        this.verifySchema(result);
        Set<String> foundTables = new HashSet<String>();
        while (result.advanceRow()) {
            String tableName = result.getString(0);
            int tupleId = (int)result.getLong(1);
            foundTables.add(tableName);
            assert(tupleId >= 0);
        } // WHILE
        this.finishTxn(voltProc);
        System.err.println("READ SET:\n" + VoltTableUtil.format(result));
View Full Code Here

Examples of org.voltdb.VoltTable

                expectedTables.add(tbl.getName());
            }
        } // FOR
       
        // Let's take a peek at its WriteSet
        VoltTable result = this.ee.trackingWriteSet(txnId);
        assertNotNull(result);
        this.verifySchema(result);
        Set<String> foundTables = new HashSet<String>();
        while (result.advanceRow()) {
            String tableName = result.getString(0);
            int tupleId = (int)result.getLong(1);
            foundTables.add(tableName);
            assert(tupleId >= 0);
        } // WHILE
        this.finishTxn(voltProc);
        System.err.println("WRITE SET:\n" + VoltTableUtil.format(result));
View Full Code Here

Examples of org.voltdb.VoltTable

//        m.put("Status", cresponse.getStatus());
//        m.put("Length", String.format("%d [bytes=%d]", cresponse.getResults().length, cresponse.getResultsSize()));
//        m.put("Results", StringUtil.join("\n", ));
        Map<String, Object> m = new LinkedHashMap<String, Object>();
        for (int i = 0; i < cresponse.getResults().length; i++) {
            VoltTable vt = cresponse.getResults()[i];
            m.put(String.format("  [%02d]", i), vt);
        } // FOR
       
        LOG.info(StringUtil.repeat("-", 50));
        LOG.info(String.format("%s Txn #%d - Status %s\n%s",
View Full Code Here

Examples of org.voltdb.VoltTable

    // UTILITY METHODS
    // --------------------------------------------------------------------------------------------
   
    private void loadData() throws Exception {
        // Load in a bunch of dummy data for this table
        VoltTable vt = CatalogUtil.getVoltTable(catalog_tbl);
        assertNotNull(vt);
        for (int i = 0; i < NUM_TUPLES; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = i; // OL_O_ID
            row[1] = (byte)i; // OL_D_ID
            row[2] = (short)i; // OL_W_ID
            vt.addRow(row);
        } // FOR
        this.executor.loadTable(1000l, catalog_tbl, vt, false);
       
        VoltTable stats[] = this.ee.getStats(SysProcSelector.TABLE, this.locators, false, 0L);
        assertEquals(1, stats.length);
        System.err.println(VoltTableUtil.format(stats));
    }
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.