Package com.oltpbenchmark.util.RandomDistribution

Examples of com.oltpbenchmark.util.RandomDistribution.Flat


        private UserIdGenerator idGenerator;
       
        public UserGenerator() {
            super(AuctionMarkConstants.TABLENAME_USERACCT,
                  AuctionMarkConstants.TABLENAME_REGION);
            this.randomRegion = new Flat(profile.rng, 0, (int)AuctionMarkConstants.TABLESIZE_REGION);
            this.randomRating = new Zipf(profile.rng, AuctionMarkConstants.USER_MIN_RATING,
                                                      AuctionMarkConstants.USER_MAX_RATING, 1.0001);
            this.randomBalance = new Zipf(profile.rng, AuctionMarkConstants.USER_MIN_BALANCE,
                                                       AuctionMarkConstants.USER_MAX_BALANCE, 1.001);
        }
View Full Code Here


        if (file == null || b.getTraceSize() == 0) return (null);
       
        assert(this.num_pages == this.titles.size());
        LOG.info(String.format("Generating a %dk traces to '%s'", b.getTraceSize(), file));
       
        Flat z_users = new Flat(rng(), 1, this.num_users);
        Zipf z_pages = new Zipf(rng(), 1, this.num_pages, WikipediaConstants.USER_ID_SIGMA);
       
        PrintStream ps = new PrintStream(file);
        for (int i = 0, cnt = (b.getTraceSize() * 1000); i < cnt; i++) {
            int user_id = -1;
           
            // Check whether this should be an anonymous update
            if (rng().nextInt(100) < WikipediaConstants.ANONYMOUS_PAGE_UPDATE_PROB) {
                user_id = WikipediaConstants.ANONYMOUS_USER_ID;
            }
            // Otherwise figure out what user is updating this page
            else {
                user_id = z_users.nextInt();
            }
            assert(user_id != -1);
           
            // Figure out what page they're going to update
            int page_id = z_pages.nextInt();
View Full Code Here

  public WikipediaWorker(int id, WikipediaBenchmark benchmarkModule,
                         TransactionGenerator<WikipediaOperation> generator) {
    super(benchmarkModule, id);
    this.generator = generator;
    this.num_users = (int) Math.round(WikipediaConstants.USERS * this.getWorkloadConfiguration().getScaleFactor());
    this.usersRng = new Flat(rng(), 1, this.num_users);
  }
View Full Code Here

TOP

Related Classes of com.oltpbenchmark.util.RandomDistribution.Flat

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.