Package com.oltpbenchmark.util.RandomDistribution

Examples of com.oltpbenchmark.util.RandomDistribution.Zipf.nextInt()


            Zipf randomNumItems = new Zipf(profile.rng,
                       AuctionMarkConstants.ITEM_ITEMS_PER_SELLER_MIN,
                       max_items,
                       AuctionMarkConstants.ITEM_ITEMS_PER_SELLER_SIGMA);
            for (long i = 0; i < this.tableSize; i++) {
                long num_items = randomNumItems.nextInt();
                profile.users_per_itemCount.put(num_items);
            } // FOR
             if (LOG.isDebugEnabled())
                LOG.debug("Users Per Item Count:\n" + profile.users_per_itemCount);
            this.idGenerator = new UserIdGenerator(profile.users_per_itemCount, benchmark.getWorkloadConfiguration().getTerminals());
View Full Code Here


            char old_text[] = TextGenerator.randomChars(rng(), old_text_length);
           
            for (int i = 0; i < num_revised; i++) {
                // Generate the User who's doing the revision and the Page revised
                // Makes sure that we always update their counter
                int user_id = h_users.nextInt();
                assert(user_id > 0 && user_id <= this.num_users) : "Invalid UserId '" + user_id + "'";
                this.user_revision_ctr[user_id-1]++;
               
                // Generate what the new revision is going to be
                if (i > 0) {
View Full Code Here

                user_id = z_users.nextInt();
            }
            assert(user_id != -1);
           
            // Figure out what page they're going to update
            int page_id = z_pages.nextInt();
            Pair<Integer, String> p = this.titles.get(page_id);
            assert(p != null);
           
            TransactionSelector.writeEntry(ps, user_id, p.getFirst(), p.getSecond());
        } // FOR
View Full Code Here

            if (LOG.isTraceEnabled())
                LOG.trace(user_id + " => " + num_watches);
           
            userPages.clear();
            for (int i = 0; i < num_watches; i++) {
                int pageId = h_pageId.nextInt();
                while (userPages.contains(pageId)) {
                    pageId = h_pageId.nextInt();
                } // WHILE
                userPages.add(pageId);
               
View Full Code Here

           
            userPages.clear();
            for (int i = 0; i < num_watches; i++) {
                int pageId = h_pageId.nextInt();
                while (userPages.contains(pageId)) {
                    pageId = h_pageId.nextInt();
                } // WHILE
                userPages.add(pageId);
               
                Pair<Integer, String> page = this.titles.get(pageId);
                assert(page != null) : "Invalid PageId " + pageId;
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.