Package com.oltpbenchmark.benchmarks.auctionmark.util

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


            for (int i = 0; i < this.tableSize; i++) {
                int category_id = profile.rng.number(0, (int)this.num_categories);
                this.category_groups.put(category_id);
                int id = this.category_groups.get(category_id).intValue();
                int count = (int)profile.rng.number(1, AuctionMarkConstants.TABLESIZE_GLOBAL_ATTRIBUTE_VALUE_PER_GROUP);
                GlobalAttributeGroupId gag_id = new GlobalAttributeGroupId(category_id, id, count);
                assert(profile.gag_ids.contains(gag_id) == false);
                profile.gag_ids.add(gag_id);
                this.group_ids.add(gag_id);
            } // FOR
        }
View Full Code Here


        }
        @Override
        protected int populateRow(Object[] row) {
            int col = 0;

            GlobalAttributeGroupId gag_id = this.group_ids.poll();
            assert(gag_id != null);
           
            // GAG_ID
            row[col++] = gag_id.encode();
            // GAG_C_ID
            row[col++] = gag_id.getCategoryId();
            // GAG_NAME
            row[col++] = profile.rng.astring(6, 32);
           
            return (col);
        }
View Full Code Here

   
    private static final void loadGlobalAttributeGroups(AuctionMarkProfile profile, ResultSet vt) throws SQLException {
        while (vt.next()) {
            int col = 1;
            long gag_id = vt.getLong(col++);
            profile.gag_ids.add(new GlobalAttributeGroupId(gag_id));
        } // WHILE
        if (LOG.isDebugEnabled())
            LOG.debug(String.format("Loaded %d records from %s",
                                    profile.gag_ids.size(), AuctionMarkConstants.TABLENAME_GLOBAL_ATTRIBUTE_GROUP));
    }
View Full Code Here

     * Return a random GlobalAttributeValueId
     * @return
     */
    public GlobalAttributeValueId getRandomGlobalAttributeValue() {
        int offset = rng.nextInt(this.gag_ids.size());
        GlobalAttributeGroupId gag_id = this.gag_ids.get(offset);
        assert(gag_id != null);
        int count = rng.nextInt(gag_id.getCount());
        GlobalAttributeValueId gav_id = new GlobalAttributeValueId(gag_id, count);
        return gav_id;
    }
View Full Code Here

TOP

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

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.