Package org.voltdb

Examples of org.voltdb.VoltTable.addRow()


                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


    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

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

            if (catalog_tbl.getName().equalsIgnoreCase(TPCCConstants.TABLENAME_ORDER_LINE)) {
                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);
       
        int statsLocators[] = { catalog_tbl.getRelativeIndex() };
        VoltTable stats[] = this.ee.getStats(SysProcSelector.TABLE, statsLocators, false, 0L);
View Full Code Here

        VoltTable vt1 = CatalogUtil.getVoltTable(catalog_tbl);
        assertNotNull(vt1);
        for (int i = 0; i < NUM_TUPLES/2; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = i;
            vt1.addRow(row);
        } // FOR
        this.executors[0].loadTable(1000l, catalog_tbl, vt1, false);
       
        // site 2
        VoltTable vt2 = CatalogUtil.getVoltTable(catalog_tbl);
View Full Code Here

        // site 2
        VoltTable vt2 = CatalogUtil.getVoltTable(catalog_tbl);
        for (int i = 0; i < NUM_TUPLES/2; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = i;
            vt2.addRow(row);
        } // FOR
        this.executors[1].loadTable(1001l, catalog_tbl, vt2, false);
       
        VoltTable stats[] = this.ee[0].getStats(SysProcSelector.TABLE, this.locators, false, 0L);
        assertEquals(1, stats.length);
View Full Code Here

        else {
            vt = vts[OptimisticConflictChecker.WRITE];
            ts.markTableWritten(BASE_PARTITION, catalog_tbl);
        }
        for (int tupleId : tupleIds) {
            vt.addRow(catalog_tbl.getName(), tupleId);
        } // FOR
    }
   
    private void addReads(AbstractTransaction ts, Table tbl, int...tupleIds) {
        this.updateTracking(ts, tbl, true, tupleIds);
View Full Code Here

        VoltTable vt = CatalogUtil.getVoltTable(catalog_tbl);
        assertNotNull(vt);
        for (int i = 0; i < tuples; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = i;
            vt.addRow(row);
        } // FOR
        this.executor.loadTable(1000l, catalog_tbl, vt, false);
    }

    private Map<Integer, VoltTable> evictData(long block_size) throws Exception {
View Full Code Here

        VoltTable vt = CatalogUtil.getVoltTable(catalog_tbl);
        for (int i = 0; i < NUM_PARTITIONS; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            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

        Map<Integer, Long> expectedValues = new HashMap<Integer, Long>();
        for (int i = 0; i < 5; i++) {
            int fragmentId = baseFragmentId + i;
            long expected = baseValue + i;
            VoltTable result = new VoltTable(TARGET_RESULT);
            result.addRow(expected);
            expectedValues.put(fragmentId, expected);
       
            // First store it in the cache
            this.cache.addResult(txnId, fragmentId, partitionId, params, result);
        } // FOR
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.