Package org.radargun.stages.tpcc.domain

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


            }
         }
         log.info(" STOCK for Warehouse " + id_wharehouse + " - ITEMS=" + 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++) {

            Stock newStock = new Stock(i,
                                       id_wharehouse,
                                       TpccTools.aleaNumber(10, 100),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       TpccTools.aleaChainel(24, 24),
                                       0,
                                       0,
                                       0,
                                       TpccTools.sData());

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


         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';
         }

         switch ((int) d_id) {
            case 1:
               ol_dist_info = s.getS_dist_01();
               break;
            case 2:
               ol_dist_info = s.getS_dist_02();
               break;
            case 3:
               ol_dist_info = s.getS_dist_03();
               break;
            case 4:
               ol_dist_info = s.getS_dist_04();
               break;
            case 5:
               ol_dist_info = s.getS_dist_05();
               break;
            case 6:
               ol_dist_info = s.getS_dist_06();
               break;
            case 7:
               ol_dist_info = s.getS_dist_07();
               break;
            case 8:
               ol_dist_info = s.getS_dist_08();
               break;
            case 9:
               ol_dist_info = s.getS_dist_09();
               break;
            case 10:
               ol_dist_info = s.getS_dist_10();
               break;
         }
         // clause 2.4.2.2 (dot 8.5)

         OrderLine ol = new OrderLine(o_id, d_id, w_id, ol_number, ol_i_id, ol_supply_w_id, null, ol_quantity, ol_amount, ol_dist_info);
View Full Code Here

TOP

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

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.