Package org.radargun.stages.tpcc.domain

Examples of org.radargun.stages.tpcc.domain.Item


      }
      log.info(" ITEM - ids=" + init_id_item + ",...," + (init_id_item - 1 + num_of_items));
      for (long i = init_id_item; i <= (init_id_item - 1 + num_of_items); i++) {

         Item newItem = new Item(i, TpccTools.aleaNumber(1, 10000), TpccTools.aleaChainec(14, 24), TpccTools.aleaFloat(1, 100, 2), TpccTools.sData());

         boolean successful = false;
         while (!successful) {
            try {
               newItem.store(basicCache);
               successful = true;
            } catch (Throwable e) {
               log.warn("Storing new item failed:", e);
            }
         }
View Full Code Here


         ol_supply_w_id = supplierWarehouseIDs[ol_number - 1];
         ol_i_id = itemIDs[ol_number - 1];
         ol_quantity = orderQuantities[ol_number - 1];

         // clause 2.4.2.2 (dot 8.1)
         Item i = new Item();
         i.setI_id(ol_i_id);
         found = i.load(basicCache);
         if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");


         itemPrices[ol_number - 1] = i.getI_price();
         itemNames[ol_number - 1] = i.getI_name();
         // clause 2.4.2.2 (dot 8.2)

         Stock s = new Stock();
         s.setS_i_id(ol_i_id);
         s.setS_w_id(ol_supply_w_id);
         found = s.load(basicCache);
         if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");


         s_quantity = s.getS_quantity();
         stockQuantities[ol_number - 1] = s_quantity;
         // clause 2.4.2.2 (dot 8.2)
         if (s_quantity - ol_quantity >= 10) {
            s_quantity -= ol_quantity;
         } else {
            s_quantity += -ol_quantity + 91;
         }

         if (ol_supply_w_id == w_id) {
            s_remote_cnt_increment = 0;
         } else {
            s_remote_cnt_increment = 1;
         }
         // clause 2.4.2.2 (dot 8.2)
         s.setS_quantity(s_quantity);
         s.setS_ytd(s.getS_ytd() + ol_quantity);
         s.setS_remote_cnt(s.getS_remote_cnt() + s_remote_cnt_increment);
         s.setS_order_cnt(s.getS_order_cnt() + 1);
         s.store(basicCache);


         // clause 2.4.2.2 (dot 8.3)
         ol_amount = ol_quantity * i.getI_price();
         orderLineAmounts[ol_number - 1] = ol_amount;
         total_amount += ol_amount;
         // clause 2.4.2.2 (dot 8.4)
         i_data = i.getI_data();
         s_data = s.getS_data();
         if (i_data.contains(TpccTools.ORIGINAL) && s_data.contains(TpccTools.ORIGINAL)) {
            brandGeneric[ol_number - 1] = 'B';
         } else {
            brandGeneric[ol_number - 1] = 'G';
View Full Code Here

TOP

Related Classes of org.radargun.stages.tpcc.domain.Item

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.