Package com.oltpbenchmark.benchmarks.auctionmark.util

Examples of com.oltpbenchmark.benchmarks.auctionmark.util.UserId


    // ----------------------------------------------------------------
   
    protected boolean executeUpdateItem(UpdateItem proc) throws SQLException {
        Timestamp benchmarkTimes[] = this.getTimestampParameterArray();
        ItemInfo itemInfo = profile.getRandomAvailableItemId();
        UserId sellerId = itemInfo.getSellerId();
        String description = profile.rng.astring(50, 255);
       
        boolean delete_attribute = false;
        long add_attribute[] = {
            -1,
            -1
        };
       
        // Delete ITEM_ATTRIBUTE
        if (profile.rng.number(1, 100) < AuctionMarkConstants.PROB_UPDATEITEM_DELETE_ATTRIBUTE) {
            delete_attribute = true;
        }
        // Add ITEM_ATTRIBUTE
        else if (profile.rng.number(1, 100) < AuctionMarkConstants.PROB_UPDATEITEM_ADD_ATTRIBUTE) {
            GlobalAttributeValueId gav_id = profile.getRandomGlobalAttributeValue();
            assert(gav_id != null);
            add_attribute[0] = gav_id.getGlobalAttributeGroup().encode();
            add_attribute[1] = gav_id.encode();
        }
       
        proc.run(conn, benchmarkTimes, itemInfo.itemId.encode(),
                                       sellerId.encode(),
                                       description,
                                       delete_attribute,
                                       add_attribute);
        conn.commit();
       
View Full Code Here


                System.err.println("Number of Users: " + num_users);
            }
           
            worker_users.clear();
            for (int i = 0; i < num_users; i++) {
                UserId user_id = profile.getRandomSellerId(worker.getId());
                assertNotNull(user_id);
                assertFalse(worker.getId() + " -> " + user_id.toString() + " / " + user_id.encode(),
                            all_users.contains(user_id));
                worker_users.add(user_id);
            } // FOR
            assertFalse(worker_users.isEmpty());
            all_users.addAll(worker_users);
View Full Code Here

        protected int populateRow(LoaderItemInfo itemInfo, Object[] row, short remaining) {
            int col = 0;
           
            // Make it more likely that a user that has bid on an item is watching it
            Histogram<UserId> bidderHistogram = itemInfo.getBidderHistogram();
            UserId buyerId = null;
            int num_watchers = this.watchers.size();
            boolean use_random = (num_watchers == bidderHistogram.getValueCount());
            long num_users = tableSizes.get(AuctionMarkConstants.TABLENAME_USERACCT);
           
            if (LOG.isTraceEnabled())
View Full Code Here

            assert(list != null);
            LinkedList<ItemInfo> origList = other.allItemSets[i];
            assert(origList != null);
           
            for (ItemInfo itemInfo : origList) {
                UserId sellerId = itemInfo.getSellerId();
                if (this.userIdGenerator.checkClient(sellerId)) {
                    this.seller_item_cnt.set(sellerId, sellerId.getItemCount());
                    list.add(itemInfo);
                }
            } // FOR
            Collections.shuffle(list);
        } // FOR
       
        for (ItemCommentResponse cr : other.pending_commentResponses) {
            UserId sellerId = new UserId(cr.sellerId);
            if (this.userIdGenerator.checkClient(sellerId)) {
                this.pending_commentResponses.add(cr);
            }
        } // FOR
       
View Full Code Here

        if (this.randomItemCount == null) {
            this.randomItemCount = new FlatHistogram<Long>(this.rng, this.users_per_itemCount);
        }
        if (this.userIdGenerator == null) this.initializeUserIdGenerator(clientId);
       
        UserId user_id = null;
        int tries = 1000;
        final long num_users = this.userIdGenerator.getTotalUsers()-1;
        while (user_id == null && tries-- > 0) {
            // We first need to figure out how many items our seller needs to have
            long itemCount = -1;
View Full Code Here

        return (this.getRandomUserId(1, client));
    }
   
    public void addPendingItemCommentResponse(ItemCommentResponse cr) {
        if (this.client_id != -1) {
            UserId sellerId = new UserId(cr.sellerId);
            if (this.userIdGenerator.checkClient(sellerId) == false) {
                return;
            }
        }
        this.pending_commentResponses.add(cr);
View Full Code Here

TOP

Related Classes of com.oltpbenchmark.benchmarks.auctionmark.util.UserId

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.