Package edu.brown.benchmark.auctionmark.util

Examples of edu.brown.benchmark.auctionmark.util.ItemId


        }
        @Override
        protected int populateRow(UserId seller_id, short remaining) {
            int col = 0;
           
            ItemId itemId = new ItemId(seller_id, remaining);
            TimestampType endDate = this.getRandomEndTimestamp();
            TimestampType startDate = this.getRandomStartTimestamp(endDate);
           
            //LOG.info("endDate = " + endDate + " : startDate = " + startDate);
            long bidDurationDay = ((endDate.getTime() - startDate.getTime()) / AuctionMarkConstants.MICROSECONDS_IN_A_DAY);
View Full Code Here


        Integer cnt = this.seller_item_cnt.get(seller_id);
        if (cnt == null || cnt == 0) {
            cnt = (int)seller_id.getItemCount();
        }
        this.seller_item_cnt.put(seller_id, ++cnt);
        return (new ItemId(seller_id, cnt));
    }
View Full Code Here

         * stored in that row.
         * @param vt
         * @return
         */
        public ItemId processItemRecord(VoltTable vt) {
            ItemId itemId = new ItemId(vt.getLong("i_id"));
            TimestampType endDate = vt.getTimestampAsTimestamp("i_end_date");
            short numBids = (short)vt.getLong("i_num_bids");
            double currentPrice = vt.getDouble("i_current_price");
            ItemInfo itemInfo = new ItemInfo(itemId, currentPrice, endDate, numBids);
            if (vt.hasColumn("ip_id")) itemInfo.status = ItemStatus.CLOSED;
            if (vt.hasColumn("i_status")) itemInfo.status = ItemStatus.get(vt.getLong("i_status"));
           
            UserId sellerId = new UserId(vt.getLong("i_u_id"));
            assert (itemId.getSellerId().equals(sellerId));
           
            ItemStatus qtype = profile.addItemToProperQueue(itemInfo, false);
            this.updated.put(qtype);

            return (itemId);
View Full Code Here

        }
        @Override
        public void process(VoltTable[] results) {
            assert (null != results && results.length > 0);
            while (results[0].advanceRow()) {
                ItemId itemId = this.processItemRecord(results[0]);
                assert(itemId != null);
            } // WHILE
            if (debug.val) LOG.debug(super.toString());
            profile.updateItemQueues();
        }
View Full Code Here

        }
        @Override
        public void process(VoltTable[] results) {
            assert (null != results && results.length > 0);
            while (results[0].advanceRow()) {
                ItemId itemId = this.processItemRecord(results[0]);
                assert(itemId != null);
            } // WHILE
            if (debug.val) LOG.debug(super.toString());
        }
View Full Code Here

            // ITEM Result Tables
            for (int i = idx; i < results.length; i++) {
                VoltTable vt = results[i];
                assert(vt != null);
                while (vt.advanceRow()) {
                    ItemId itemId = this.processItemRecord(vt);
                    assert(itemId != null);
                } // WHILE
            } // FOR
        }
View Full Code Here

        }
        @Override
        public void process(VoltTable[] results) {
            assert(results.length == 1);
            while (results[0].advanceRow()) {
                ItemId itemId = this.processItemRecord(results[0]);
                assert(itemId != null);
            } // WHILE
            if (debug.val) LOG.debug(super.toString());
        }
View Full Code Here

        }
        @Override
        public void process(VoltTable[] results) {
            assert(results.length == 1);
            while (results[0].advanceRow()) {
                ItemId itemId = this.processItemRecord(results[0]);
                assert(itemId != null);
            } // WHILE
            if (debug.val) LOG.debug(super.toString());
        }
View Full Code Here

        }
        @Override
        public void process(VoltTable[] results) {
            assert(results.length == 1);
            while (results[0].advanceRow()) {
                ItemId itemId = this.processItemRecord(results[0]);
                assert(itemId != null);
            } // WHILE
            if (debug.val) LOG.debug(super.toString());
        }
View Full Code Here

   
    private final void loadItems(VoltTable vt, ItemStatus status) {
        int ctr = 0;
        while (vt.advanceRow()) {
            int col = 0;
            ItemId i_id = new ItemId(vt.getLong(col++));
            double i_current_price = vt.getDouble(col++);
            TimestampType i_end_date = vt.getTimestampAsTimestamp(col++);
            int i_num_bids = (int)vt.getLong(col++);
            ItemStatus i_status = ItemStatus.get(vt.getLong(col++));
            assert(i_status == status);
View Full Code Here

TOP

Related Classes of edu.brown.benchmark.auctionmark.util.ItemId

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.