Package org.voltdb.client

Examples of org.voltdb.client.NullCallback


        // preload keys if requested
        System.out.println();
        if (config.preload) {
            System.out.println("Preloading data store...");
            for(int i=0; i < config.poolsize; i++) {
                client.callProcedure(new NullCallback(),
                                     "STORE.upsert",
                                     String.format(processor.KeyFormat, i),
                                     processor.generateForStore().getStoreValue());
            }
            client.drain();
View Full Code Here


        // Run the benchmark for the requested duration.
        System.out.println("\n\nInserting into table " + systemStr + " materialized view...\n");

        if (config.group > 0) {
            for (int i=0; i<config.txn; i++){
                client.callProcedure(new NullCallback(),
                                     procStr + "_insert",
                                     i,
                                     grp,
                                     i);
                if (grp == config.group) {
                    grp = 1;
                } else {
                    grp++;
                }
            }
        } else {
            for (int i=0; i<config.txn; i++){
                client.callProcedure(new NullCallback(),
                                     procStr + "_insert",
                                     i,
                                     i,
                                     i);
            }
        }
        timer.cancel();
        client.drain();

        if ((config.statsfile == null) || (config.statsfile.length() == 0)) {
            printResults(procStr + "_insert");
        } else {
            printResults(procStr + "_insert", fw, "Insert " + csvStr + " MV");
        }
        System.out.print(HORIZONTAL_RULE);

        if (!matView.equals("minMatView")) {
            // grp is initialized to 2 for updating the grouping column to (grouping column = grouping column + 1)
            grp = 2;

            fullStatsContext.fetchAndResetBaseline();
            periodicStatsContext.fetchAndResetBaseline();

            benchmarkStartTS = System.currentTimeMillis();
            schedulePeriodicStats();

            System.out.println("\n\nUpdating grouping column in table " + systemStr + " materialized view...\n");

            if (config.group > 0) {
                for (int i=0; i<config.txn; i++){
                    client.callProcedure(new NullCallback(),
                                         procStr + "_group_id_update",
                                         grp,
                                         i);
                    if (grp == (config.group + 1)) {
                        grp = 2;
                    } else {
                        grp++;
                    }
                }
            } else {
                for (int i=0; i<config.txn; i++){
                    client.callProcedure(new NullCallback(),
                                         procStr + "_group_id_update",
                                         (i + 1),
                                         i);
                }
            }
            timer.cancel();
            client.drain();

            if ((config.statsfile == null) || (config.statsfile.length() == 0)) {
                printResults(procStr + "_group_id_update");
            } else {
                printResults(procStr + "_group_id_update", fw, "Update Grp " + csvStr + " MV");
            }
            System.out.print(HORIZONTAL_RULE);

            fullStatsContext.fetchAndResetBaseline();
            periodicStatsContext.fetchAndResetBaseline();

            benchmarkStartTS = System.currentTimeMillis();
            schedulePeriodicStats();

            System.out.println("\n\nUpdating aggregated column in table " + systemStr + " materialized view...\n");

            for (int i=0; i<config.txn; i++){
                client.callProcedure(new NullCallback(),
                                     procStr + "_value_update",
                                     (i + 1),
                                     i);
            }
            timer.cancel();
            client.drain();

            if ((config.statsfile == null) || (config.statsfile.length() == 0)) {
                printResults(procStr + "_value_update");
            } else {
                printResults(procStr + "_value_update", fw, "Update Sum " + csvStr + " MV");
            }
            System.out.print(HORIZONTAL_RULE);
        }

        fullStatsContext.fetchAndResetBaseline();
        periodicStatsContext.fetchAndResetBaseline();

        benchmarkStartTS = System.currentTimeMillis();
        schedulePeriodicStats();

        System.out.println("\n\nDeleting from table " + systemStr + " materialized view...\n");
        for (int i=0; i<config.txn; i++){
            client.callProcedure(new NullCallback(),
                                 procStr + "_delete",
                                 i);
        }
        timer.cancel();
        client.drain();
View Full Code Here

        // Run the benchmark loop for the requested warmup time
        // The throughput may be throttled depending on client configuration
        if (config.warmup > 0) {
            System.out.println("Warming up...");
            for (int i=0; i<config.warmup; i++){
                client.callProcedure(new NullCallback(),
                                     "ids_insert",
                                     i,
                                     i,
                                     i);
                client.callProcedure(new NullCallback(),
                                     "idsWithMatView_insert",
                                     i,
                                     i,
                                     i);
                client.callProcedure(new NullCallback(),
                                     "idsWithMinMatView_insert",
                                     i,
                                     i,
                                     i);
            }
            client.drain();
            for (int i=0; i<config.warmup; i++){
                client.callProcedure(new NullCallback(),
                                     "ids_delete",
                                     i);
                client.callProcedure(new NullCallback(),
                                     "idsWithMatView_delete",
                                     i);
                client.callProcedure(new NullCallback(),
                                     "idsWithMinMatView_delete",
                                     i);
            }
            client.drain();
        }
View Full Code Here

        // preload keys if requested
        System.out.println();
        if (config.preload) {
            System.out.println("Preloading data store...");
            for(int i=0; i < config.poolsize; i++) {
                client.callProcedure(new NullCallback(),
                                     "Put",
                                     String.format(processor.KeyFormat, i),
                                     processor.generateForStore().getStoreValue());
            }
            client.drain();
View Full Code Here

            tablename = "narrow_index_p";
            scanproc = "MinIndexScan";
        }

        for (long i = 0; i < config.rows; i++) {
            client.callProcedure(new NullCallback(), loadproc, i % 509 /* radom prime */, i);
            if ((i % 100000) == 0) {
                System.out.printf("Loading row at index %d.\n", i);
            }
        }
        client.drain();
View Full Code Here

        // preload keys if requested
        System.out.println();
        if (config.preload) {
            System.out.println("Preloading data store...");
            for(int i=config.preloadLowKey; i < config.poolsize; i++) {
                client.callProcedure(new NullCallback(),
                                     "Put",
                                     String.format(processor.KeyFormat, i),
                                     processor.generateForStore().getStoreValue());
                lastSuccessfulResponse = System.currentTimeMillis();
            }
            client.drain();
            System.out.println("Preloading complete.\n");
        }

        if (!config.runbenchmark) {
            System.out.println("Benchmark run disabled by --runbenchmark option, exiting now");
            System.exit(0);
        }

        System.out.print(HORIZONTAL_RULE);
        System.out.println("Starting Benchmark");
        System.out.println(HORIZONTAL_RULE);

        // Run the benchmark loop for the requested warmup time
        // The throughput may be throttled depending on client configuration
        if (config.warmup > 0) {
            System.out.println("Warming up...");
            final long warmupEndTime = System.currentTimeMillis() + (1000l * config.warmup);
            while (warmupEndTime > System.currentTimeMillis()) {
                // Decide whether to perform a GET or PUT operation
                if (rand.nextDouble() < config.getputratio) {
                    // Get a key/value pair, asynchronously
                    client.callProcedure(new NullCallback(), "Get", processor.generateRandomKeyForRetrieval());
                }
                else {
                    // Put a key/value pair, asynchronously
                    final PayloadProcessor.Pair pair = processor.generateForStore();
                    client.callProcedure(new NullCallback(), "Put", pair.Key, pair.getStoreValue());
                }
                lastSuccessfulResponse = System.currentTimeMillis();
            }
        }

View Full Code Here

        // preload keys if requested
        System.out.println();
        if (config.preload) {
            System.out.println("Preloading data store...");
            for(int i=0; i < config.poolsize; i++) {
                client.callProcedure(new NullCallback(),
                                     "Put",
                                     String.format(processor.KeyFormat, i),
                                     processor.generateForStore().getStoreValue());
            }
            client.drain();
View Full Code Here

        while (warmupEndTime > System.currentTimeMillis()) {
            // Get the next phone call
            PhoneCallGenerator.PhoneCall call = switchboard.receive();

            // asynchronously call the "Vote" procedure
            client.callProcedure(new NullCallback(),
                                 "Vote",
                                 call.phoneNumber,
                                 call.contestantNumber,
                                 config.maxvotes);
        }
View Full Code Here

}

    void callHelper(Client client, String procname, Object ...objects )
    throws InterruptedException, IOException
    {
        NullCallback nullCallback = new NullCallback();
        boolean done;
        do {
            done = client.callProcedure(nullCallback, procname, objects);
            if (!done) {
                client.backpressureBarrier();
View Full Code Here

        /*
         * Load a little partitioned data for the mispartitioned check
         */
        Random r = new Random(0);
        for (int ii = 0; ii < 50; ii++) {
            client.callProcedure(new NullCallback(), "@AdHoc",
                    "INSERT INTO new_order values (" + (short)(r.nextDouble() * Short.MAX_VALUE) + ");");
        }

        // try the failure case first
        try {
View Full Code Here

TOP

Related Classes of org.voltdb.client.NullCallback

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.