Examples of VoltTable


Examples of org.voltdb.VoltTable

    public synchronized VoltTable getDependency(long txnId) {
        return this.dependencies.get(txnId);
    }
   
    public synchronized VoltTable waitForDependency(long txnId) {
        VoltTable vt = this.dependencies.get(txnId);
        if (vt == null) {
            CountDownLatch latch = this.latches.get(txnId);
            if (latch == null) {
                latch = new CountDownLatch(1);
                this.latches.put(txnId, latch);
View Full Code Here

Examples of org.voltdb.VoltTable

    // --------------------------------------------------------------------------------------------
    // UTILITY METHODS
    // --------------------------------------------------------------------------------------------
   
    private void updateTracking(AbstractTransaction ts, Table catalog_tbl, boolean isRead, int...tupleIds) {
        VoltTable vts[] = this.readWriteSets.get(ts);
        if (vts == null) {
            vts = new VoltTable[]{
                        new VoltTable(TestReadWriteTracking.RESULT_COLS),
                        new VoltTable(TestReadWriteTracking.RESULT_COLS)
            };
            this.readWriteSets.put(ts, vts);
        }

        VoltTable vt = null;
        if (isRead) {
            vt = vts[OptimisticConflictChecker.READ];
            ts.markTableRead(BASE_PARTITION, catalog_tbl);
        }
        else {
            vt = vts[OptimisticConflictChecker.WRITE];
            ts.markTableWritten(BASE_PARTITION, catalog_tbl);
        }
        for (int tupleId : tupleIds) {
            vt.addRow(catalog_tbl.getName(), tupleId);
        } // FOR
    }
View Full Code Here

Examples of org.voltdb.VoltTable

        assertEquals(Status.OK, cr.getStatus());
    }
   
    private void loadData(Table catalog_tbl) throws Exception {
        // Load some data directly into the EEs without going through transactions
        VoltTable vts[] = {
            CatalogUtil.getVoltTable(catalog_tbl),
            CatalogUtil.getVoltTable(catalog_tbl)
        };
        assertEquals(NUM_PARTITIONS, vts.length);
        AbstractHasher hasher = p_estimator.getHasher();
View Full Code Here

Examples of org.voltdb.VoltTable

        cr = this.client.callProcedure(VoltSystemProcedure.procCallName(Statistics.class), params);
//        System.err.println(cr);
        assertNotNull(cr);
        assertEquals(Status.OK, cr.getStatus());
       
        VoltTable results[] = cr.getResults();
        assertEquals(1, results.length);
        boolean found = false;
        while (results[0].advanceRow()) {
            if (results[0].getString(3).equalsIgnoreCase(catalog_proc.getName())) {
                for (int i = 4; i < results[0].getColumnCount(); i++) {
View Full Code Here

Examples of org.voltdb.VoltTable

            cr = this.client.callProcedure(procName, params);
            System.err.println(VoltTableUtil.format(cr.getResults()[0]));
            assertNotNull(cr);
            assertEquals(Status.OK, cr.getStatus());
           
            VoltTable results[] = cr.getResults();
            assertEquals(1, results.length);
           
            if (ii != 0) continue;
           
            boolean found = false;
View Full Code Here

Examples of org.voltdb.VoltTable

    }
   

    private void loadData(int tuples) 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 < tuples; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = i;
            vt.addRow(row);
        } // FOR
        this.executor.loadTable(1000l, catalog_tbl, vt, false);
    }
View Full Code Here

Examples of org.voltdb.VoltTable

        // Our stats should now come back with one eviction executed
        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_table = cresponse.getResults()[0];
        System.err.println(VoltTableUtil.format(result_table));

        return (m);
    }
View Full Code Here

Examples of org.voltdb.VoltTable

        procName = VoltSystemProcedure.procCallName(Statistics.class);
        Object params2[] = { SysProcSelector.ANTICACHE.name(), 0 };
        cresponse = this.client.callProcedure(procName, params2);
        assertEquals(cresponse.toString(), Status.OK, cresponse.getStatus());
        assertEquals(cresponse.toString(), 1, cresponse.getResults().length);
        VoltTable result = cresponse.getResults()[0];
        assertEquals(1, result.getRowCount());
        System.err.println(VoltTableUtil.format(result));
    }
View Full Code Here

Examples of org.voltdb.VoltTable

                params[i] = keys[i];
            } // FOR
            ClientResponse cresponse = this.client.callProcedure(proc.getName(), params);
            assertEquals(Status.OK, cresponse.getStatus());
           
            VoltTable results[] = cresponse.getResults();
            assertEquals(1, results.length);
            data[trial] = results[0].asScalarLong() / 1000000d;
            System.err.printf("  TRIAL %d: %.2f ms [# of Reads=%d]\n", trial, data[trial], num_reads);
        } // FOR
        double avg = MathUtil.arithmeticMean(data);
View Full Code Here

Examples of org.voltdb.VoltTable

        // We want to always insert one SUBSCRIBER record per partition so
        // that we can play with them. Set VLR_LOCATION to zero so that
        // can check whether it has been modified
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column catalog_col = this.getColumn(catalog_tbl, "VLR_LOCATION");
        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
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.