Package org.voltdb

Examples of org.voltdb.CatalogContext


     */
    public TransactionQueueManager(HStoreSite hstore_site) {
        this.hstore_site = hstore_site;
        this.hstore_conf = hstore_site.getHStoreConf();
       
        CatalogContext catalogContext = hstore_site.getCatalogContext();
        this.localPartitions = hstore_site.getLocalPartitionIds();
        this.lockQueues = new PartitionLockQueue[catalogContext.numberOfPartitions];
        this.lockQueueLastTxns = new Long[catalogContext.numberOfPartitions];
        this.lockQueueBarriers = new ReentrantLock[catalogContext.numberOfPartitions];
        this.initQueue = new LinkedBlockingQueue<AbstractTransaction>();
View Full Code Here


//        System.err.printf("Evicting data...");
        long start, stop;

        String procName = VoltSystemProcedure.procCallName(EvictTuples.class);
        CatalogContext catalogContext = this.getCatalogContext();
        String tableNames[] = { TARGET_TABLE };
        LatchableProcedureCallback callback = new LatchableProcedureCallback(catalogContext.numberOfPartitions);

        long evictBytes[] = {block_size};
        int numBlocks[] = { 1 };

        start = System.currentTimeMillis()// start timer

        for (int partition : catalogContext.getAllPartitionIds()) {
//            System.err.printf("Evicting data at partition %d...\n", partition);
            Object params[] = { partition, tableNames, null, evictBytes, numBlocks };
            boolean result = this.client.callProcedure(callback, procName, params);
            assertTrue(result);
        } // FOR
View Full Code Here

       
        this.numAccounts = (int)Math.round(SmallBankConstants.NUM_ACCOUNTS *
                                           this.getScaleFactor());
       
        // Calculate account name length
        CatalogContext catalogContext = this.getCatalogContext();
        Table catalog_tbl = catalogContext.getTableByName(SmallBankConstants.TABLENAME_ACCOUNTS);
        int acctNameLength = -1;
        for (Column col : catalog_tbl.getColumns()) {
            if (col.getType() == VoltType.STRING.getValue()) {
                acctNameLength = col.getSize();
                break;
View Full Code Here

        this.acctNameLength = acctNameLength;
    }

    @Override
    public void load() {
        final CatalogContext catalogContext = this.getCatalogContext();
        final int rows_per_thread = (int)Math.ceil(this.numAccounts / (double)this.loadthreads);
        final List<Runnable> runnables = new ArrayList<Runnable>();
        for (int i = 0; i < this.loadthreads; i++) {
            final int start = rows_per_thread * i;
            final int stop = start + rows_per_thread;
View Full Code Here

        BenchmarkComponent.main(SmallBankClient.class, args, false);
    }

    public SmallBankClient(String args[]) {
        super(args);
        CatalogContext catalogContext = this.getCatalogContext();
        TheHashinator.initialize(catalogContext.catalog);
       
        this.numAccounts = (int)Math.round(SmallBankConstants.NUM_ACCOUNTS * this.getScaleFactor());
       
        for (String key : m_extraParams.keySet()) {
View Full Code Here

     * Generate the txn input parameters for a new invocation.
     * @param target
     * @return
     */
    protected Object[] generateParams(Transaction target) {
        final CatalogContext catalogContext = this.getCatalogContext();
        long acctIds[] = new long[]{ -1, -1 };
        int partitions[] = new int[acctIds.length];
        int sites[] = new int[acctIds.length];
       
        boolean is_hotspot = (this.rand.nextInt(100) < this.prob_account_hotspot);
        boolean is_dtxn = (this.rand.nextInt(100) < this.prob_multiaccount_dtxn);
       
        boolean retry = false;
        for (int i = 0; i < acctIds.length; i++) {
            // Outside the hotspot
            if (is_hotspot == false) {
                acctIds[i] = this.rand.nextInt(this.numAccounts - this.hotspot_size) + this.hotspot_size;
            }
            // Inside the hotspot
            else {
                acctIds[i] = this.rand.nextInt(this.hotspot_size);
            }
           
            // They can never be the same!
            if (i > 0 && acctIds[i-1] == acctIds[i]) {
                continue;
            }
           
            partitions[i] = TheHashinator.hashToPartition(acctIds[i]);
            sites[i] = catalogContext.getSiteIdForPartitionId(partitions[i]);
           
            // If we only need one acctId, break out here.
            if (i == 0 && target.needsTwoAccts == false) break;
            // If we need two acctIds, then we need to go generate the second one
            if (i == 0) continue;
View Full Code Here

        System.out.println("Starting testTPCC - Physical Recovery");               
      
        VoltTable results[] = null;
        ClientResponse cresponse = null;
        Client client = this.getClient();
        CatalogContext cc = this.getCatalogContext();      

        // Load database       
        try{
            initializeTPCCDatabase(cc, client, false);
        }
View Full Code Here

   
    /**
     * testTransactionRedirect
     */
    public void testTransactionRedirect() throws Exception {
        CatalogContext catalogContext = this.getCatalogContext();
        if (catalogContext.numberOfPartitions == 1) return;
       
        // TODO
    }
View Full Code Here

   
    /**
     * testStoredProcedureInvocationHints
     */
    public void testStoredProcedureInvocationHints() throws Exception {
        CatalogContext catalogContext = this.getCatalogContext();
        Client client = this.getClient();
        RegressionSuiteUtil.initializeTPCCDatabase(catalogContext, client, true);
       
        final int repeat = 100;
        final StoredProcedureInvocationHints hints = new StoredProcedureInvocationHints();
View Full Code Here

            "NOCONNECTIONS=true",
            "BENCHMARK.FIXED_SIZE=true",
            "BENCHMARK.NUM_RECORDS="+num_tuples,
            "BENCHMARK.LOADTHREADS=1",
        };
        final CatalogContext catalogContext = this.getCatalogContext();
        YCSBLoader loader = new YCSBLoader(args) {
            {
                this.setCatalogContext(catalogContext);
                this.setClientHandle(client);
            }
View Full Code Here

TOP

Related Classes of org.voltdb.CatalogContext

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.