Package edu.brown.benchmark.ycsb.distributions

Examples of edu.brown.benchmark.ycsb.distributions.ZipfianGenerator


        double data[] = new double[NUM_TRIALS];
        for (int trial = 0; trial < NUM_TRIALS; trial++) {
            long keys[][] = new long[3][NUM_KEYS];
            int num_reads = 0;

            ZipfianGenerator zipf = new ZipfianGenerator(NUM_TUPLES, ZIPF_CONSTANT);

            for (int i = 0; i < keys.length; i++) {
                for (int j = 0; j < keys[i].length; j++) {
//                    keys[i][j] = rand.nextInt(NUM_TUPLES);
                      keys[i][j] = zipf.nextInt(NUM_TUPLES);
                    num_reads++;
                } // FOR
            } // FOR
           
            Procedure proc = this.getProcedure(SelectBlaster.class);
View Full Code Here


        }
        else {
            this.init_record_count = (long)Math.round(YCSBConstants.NUM_RECORDS * this.getScaleFactor());
        }
        this.rand_gen = new Random();
        this.randScan = new ZipfianGenerator(YCSBConstants.MAX_SCAN);
               
//        // initialize distribution generators
//        // We must know where to start inserting
//        this.insertRecord = new CustomSkewGenerator(this.rand_gen, this.init_record_count,
//                                            YCSBConstants.HOT_DATA_WORKLOAD_SKEW, YCSBConstants.HOT_DATA_SIZE,
//                                            YCSBConstants.WARM_DATA_WORKLOAD_SKEW, YCSBConstants.WARM_DATA_SIZE);
//
//        this.readRecord = new CustomSkewGenerator(this.rand_gen, this.init_record_count,
//                                            YCSBConstants.HOT_DATA_WORKLOAD_SKEW, YCSBConstants.HOT_DATA_SIZE,
//                                            YCSBConstants.WARM_DATA_WORKLOAD_SKEW, YCSBConstants.WARM_DATA_SIZE);
       
        this.insertRecord = new ZipfianGenerator(this.init_record_count, this.skewFactor);
        this.readRecord = new ZipfianGenerator(this.init_record_count, this.skewFactor);
       
        // Initialize the sampling table
        Histogram<Transaction> txns = new ObjectHistogram<Transaction>();
        for (Transaction t : Transaction.values()) {
            Integer weight = this.getTransactionWeight(t.callName);
View Full Code Here

        double sigma = 0.51d;
       
        int round = num_rounds;
        while (round-- > 0) {
//            RandomDistribution.Zipf zipf = new RandomDistribution.Zipf(this.rand, min, max, sigma);
            ZipfianGenerator zipf = new ZipfianGenerator(20, sigma);
            Histogram<Integer> hist = new ObjectHistogram<Integer>();
            System.out.println("Round #" + round + " [sigma=" + sigma + "]");
            for (int i = 0; i < num_records; i++) {
                int value = zipf.nextInt();
                hist.put(value);
            } // FOR
            Long last = null;
            for (Integer value : hist.values()) {
                long current = hist.get(value);
View Full Code Here

TOP

Related Classes of edu.brown.benchmark.ycsb.distributions.ZipfianGenerator

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.