Examples of Warehouse


Examples of com.oltpbenchmark.benchmarks.tpcc.pojo.Warehouse

            + "warehouse.csv"));
        LOG.debug("\nWriting Warehouse file to: "
            + fileLocation + "warehouse.csv");
      }

      Warehouse warehouse = new Warehouse();
      for (int i = 1; i <= whseKount; i++) {

        warehouse.w_id = i;
        warehouse.w_ytd = 300000;
View Full Code Here

Examples of com.pre.entity.base.Warehouse

    if(options.get(0).equals("create")){
      manageOption("create");
      return;
    }
    if(!ids.isEmpty()){
      final Warehouse warehouse=manager.find(new Long(ids.get(0)));

      nameBox.setText(warehouse.getName());
      groupsCombo.setText(warehouse.getGroup().getName());
      if(warehouse.getReplacingWarehouse() !=null){
        replacingBox.setText(warehouse.getReplacingWarehouse().getName());
      }
      shareableCheck.setChecked(warehouse.getShareable());
      sbox.setText(warehouse.getDescription().getShortDescription());
      dbox.setText(warehouse.getDescription().getLongDescription());
      cmbox.setText(warehouse.getDescription().getComment());
      if(options.get(0).equals("show")){
        nameBox.setDisabled(true);
        groupsCombo.setDisabled(true);
        replacingBox.setDisabled(true);
        shareableCheck.setDisabled(true);
        sbox.setDisabled(true);
        dbox.setDisabled(true);
        cmbox.setDisabled(true);
      }
      if(options.get(0).equals("edit")){
        nameBox.setDisabled(true);

        List<OrganizationGroup> groups=organizationGroupManager.findAll();
        for (OrganizationGroup group : groups) {
          Comboitem item=new Comboitem(group.getName());
          groupsCombo.appendChild(item);
        }
        List<Warehouse> replacements=manager.findAll();
        for (Warehouse replacement : replacements) {
          Comboitem item=new Comboitem(replacement.getName());
          replacingBox.appendChild(item);
        }


        Button okButton=new Button("OK");
        okButton.addEventListener("onClick", new EventListener(){

          public void onEvent(Event event) throws Exception {
            OrganizationGroup comp=organizationGroupManager.findByName(groupsCombo.getText()).get(0);
            if(nameBox.getText().equals("")){
              Messagebox.show("Name is empty!", "Error", Messagebox.YES , null);
              nameBox.focus();
              return;
            }
            warehouse.setGroup(comp);
            if(replacingBox.getText().equals(nameBox.getText())){
              Messagebox.show("Warehouse cannot replace itself!", "Error", Messagebox.YES , null);
              replacingBox.focus();
              return;
            }
            if(!replacingBox.getText().equals("")){
             
              Warehouse replacing=(Warehouse)((List<Warehouse>)manager.findByName(replacingBox.getText())).get(0);
              warehouse.setReplacingWarehouse(replacing);
            }
            warehouse.setShareable(shareableCheck.isChecked());
            warehouse.getDescription().setShortDescription(sbox.getText());
            warehouse.getDescription().setLongDescription(dbox.getText());
View Full Code Here

Examples of l2p.gameserver.model.items.Warehouse

    if(activeChar.isInStoreMode())
    {
      activeChar.sendPacket(Msg.WHILE_OPERATING_A_PRIVATE_STORE_OR_WORKSHOP_YOU_CANNOT_DISCARD_DESTROY_OR_TRADE_AN_ITEM);
      return;
    }
    Warehouse warehouse;
    PcInventory inventory = activeChar.getInventory();
    boolean privatewh = activeChar.getUsingWarehouseType() != WarehouseType.CLAN;
    int slotsleft;
    long adenaDeposit = 0;
    // Список предметов, уже находящихся на складе
    L2ItemInstance[] itemsOnWarehouse;
    if(privatewh)
    {
      warehouse = activeChar.getWarehouse();
      itemsOnWarehouse = warehouse.listItems(ItemClass.ALL);
      slotsleft = activeChar.getWarehouseLimit() - itemsOnWarehouse.length;
    }
    else
    {
      warehouse = activeChar.getClan().getWarehouse();
      itemsOnWarehouse = warehouse.listItems(ItemClass.ALL);
      slotsleft = activeChar.getClan().getWhBonus() + Config.WAREHOUSE_SLOTS_CLAN - itemsOnWarehouse.length;
    }
    // Список стекуемых предметов, уже находящихся на складе
    GArray<Integer> stackableList = new GArray<Integer>();
    for(L2ItemInstance i : itemsOnWarehouse)
    {
      if(i.isStackable())
      {
        stackableList.add(i.getItemId());
      }
    }
    // Создаем новый список передаваемых предметов, на основе полученных данных
    GArray<L2ItemInstance> itemsToStoreList = new GArray<L2ItemInstance>(_items.size() + 1);
    for(Integer itemObjectId : _items.keySet())
    {
      L2ItemInstance item = inventory.getItemByObjectId(itemObjectId);
      if(item == null || !item.canBeStored(activeChar, privatewh)) // а его вообще положить можно?
      {
        continue;
      }
      if(!item.isStackable() || !stackableList.contains(item.getItemId())) // вещь требует слота
      {
        if(slotsleft <= 0) // если слоты кончились нестекуемые вещи и отсутствующие стекуемые пропускаем
        {
          continue;
        }
        slotsleft--; // если слот есть то его уже нет
      }
      if(item.getItemId() == 57)
      {
        adenaDeposit = _items.get(itemObjectId);
      }
      itemsToStoreList.add(item);
    }
    // Проверяем, хватит ли у нас денег на уплату налога
    int fee = itemsToStoreList.size() * _WAREHOUSE_FEE;
    if(fee + adenaDeposit > activeChar.getAdena())
    {
      activeChar.sendPacket(Msg.YOU_LACK_THE_FUNDS_NEEDED_TO_PAY_FOR_THIS_TRANSACTION);
      return;
    }
    // Сообщаем о том, что слоты кончились
    if(slotsleft <= 0)
    {
      activeChar.sendPacket(Msg.YOUR_WAREHOUSE_IS_FULL);
    }
    // Перекидываем
    for(L2ItemInstance itemToStore : itemsToStoreList)
    {
      warehouse.addItem(inventory.dropItem(itemToStore, _items.get(itemToStore.getObjectId()), false), activeChar.getName());
    }
    // Платим налог
    activeChar.reduceAdena(fee, true);
    // Обновляем параметры персонажа
    activeChar.updateStats();
View Full Code Here

Examples of lineage2.gameserver.model.items.Warehouse

            oldOwner = getOwner();
            if (oldOwner != null) {
                long amount = getTreasury();
                if (amount > 0) {
                    Warehouse warehouse = oldOwner.getWarehouse();
                    if (warehouse != null) {
                        warehouse.addItem(ItemTemplate.ITEM_ID_ADENA, amount);
                        addToTreasuryNoTax(-amount, false, false);
                        Log.add(getName() + "|" + -amount + "|Castle:changeOwner", "treasury");
                    }
                }
View Full Code Here

Examples of org.apache.derbyTesting.system.oe.model.Warehouse

        rs.next();
        district.setName(rs.getString("D_NAME"));
        district.setAddress(getAddress(rs, "D_STREET_1"));
        reset(pyDistrictInfo);       
       
        Warehouse warehouse = new Warehouse();
        warehouse.setId(w);
       
        // Update WAREHOUSE
        pyWarehouseUpdate.setString(1, amount);
        pyWarehouseUpdate.setShort(2, w);
        pyWarehouseUpdate.executeUpdate();
        reset(pyWarehouseUpdate);
       
        // Get the required information from WAREHOUSE
        pyWarehouseInfo.setShort(1, w);
        rs = pyWarehouseInfo.executeQuery();
        rs.next();
        warehouse.setName(rs.getString("W_NAME"));
        warehouse.setAddress(getAddress(rs, "W_STREET_1"));
        reset(pyWarehouseInfo);
        
        // Insert HISTORY row
        pyHistory.setInt(1, c);
        pyHistory.setShort(2, cd);
        pyHistory.setShort(3, cw);
        pyHistory.setShort(4, d);
        pyHistory.setShort(5, w);
        pyHistory.setString(6, amount);
        StringBuffer hData = new StringBuffer(24);
        hData.append(warehouse.getName());
        hData.append("    ");
        hData.append(district.getName());
        pyHistory.setString(7, hData.toString());
        pyHistory.executeUpdate();
        reset(pyHistory);
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.Warehouse

  }

  private int aggregateStats() {
    try {
      // Stats setup:
      Warehouse wh = new Warehouse(conf);
      FileSystem fileSys;
      FileStatus[] fileStatus;

      // manufacture a StatsAggregator
      StatsAggregator statsAggregator;
      String statsImplementationClass = HiveConf.getVar(conf, HiveConf.ConfVars.HIVESTATSDBCLASS);
      StatsFactory.setImplementation(statsImplementationClass, conf);
      statsAggregator = StatsFactory.getStatsAggregator();
      if (!statsAggregator.connect(conf)) {
        // this should not fail the whole job, return 0 so that the job won't fail.
        console.printInfo("[WARNING] Could not update table/partition level stats.",
            "StatsAggregator.connect() failed: stats class = " +
            statsImplementationClass);
        return 0;
      }


      TableStatistics tblStats = new TableStatistics();

      //
      // For partitioned table get the old table statistics for incremental update
      //
      if (table.isPartitioned()) {
        org.apache.hadoop.hive.metastore.api.Table tTable = table.getTTable();
        Map<String, String> parameters = tTable.getParameters();
        if (parameters.containsKey(StatsSetupConst.ROW_COUNT)) {
          tblStats.setNumRows(Long.parseLong(parameters.get(StatsSetupConst.ROW_COUNT)));
        }
        if (parameters.containsKey(StatsSetupConst.NUM_PARTITIONS)) {
          tblStats.setNumPartitions(Integer.parseInt(parameters.get(StatsSetupConst.NUM_PARTITIONS)));
        }
        if (parameters.containsKey(StatsSetupConst.NUM_FILES)) {
          tblStats.setNumFiles(Integer.parseInt(parameters.get(StatsSetupConst.NUM_FILES)));
        }
        if (parameters.containsKey(StatsSetupConst.TOTAL_SIZE)) {
          tblStats.setSize(Long.parseLong(parameters.get(StatsSetupConst.TOTAL_SIZE)));
        }
      }

      List<Partition> partitions = getPartitionsList();

      if (partitions == null) {
        // non-partitioned tables:

        Path tablePath = wh.getDefaultTablePath(table.getDbName(), table.getTableName());
        fileSys = tablePath.getFileSystem(conf);
        fileStatus = Utilities.getFileStatusRecurse(tablePath, 1, fileSys);
        tblStats.setNumFiles(fileStatus.length);
        long tableSize = 0L;
        for (int i = 0; i < fileStatus.length; i++) {
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.Warehouse

    }
  }

  private void deleteDir(Path dir) throws HiveException {
    try {
      Warehouse wh = new Warehouse(conf);
      wh.deleteDir(dir, true);
    } catch (MetaException e) {
      throw new HiveException(e);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.Warehouse

    howlConf.set(HiveConf.ConfVars.SEMANTIC_ANALYZER_HOOK.varname, HowlSemanticAnalyzer.class.getName());
    howlConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, "");
    howlConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, "");
    howlConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
    clientWH = new Warehouse(howlConf);
    msc = new HiveMetaStoreClient(howlConf,null);
    System.setProperty(HiveConf.ConfVars.PREEXECHOOKS.varname, " ");
    System.setProperty(HiveConf.ConfVars.POSTEXECHOOKS.varname, " ");
  }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.Warehouse

    }
    catch(Exception e){
      assertTrue(e instanceof ExitException);
      assertEquals(((ExitException)e).getStatus(), 0);
    }
    Warehouse wh = new Warehouse(conf);
    Path dfsPath = wh.getDefaultTablePath(MetaStoreUtils.DEFAULT_DATABASE_NAME, "testNoPartTbl");
    FileSystem fs = dfsPath.getFileSystem(conf);
    assertEquals(fs.getFileStatus(dfsPath).getPermission(),FsPermission.valueOf("drwx-wx---"));

    pig.setBatchOn();
    pig.registerQuery("A  = load 'build.xml' as (line:chararray);");
    pig.registerQuery("store A into 'testNoPartTbl' using "+HowlStorer.class.getName()+"();");
    pig.executeBatch();
    FileStatus[] status = fs.listStatus(dfsPath,hiddenFileFilter);

    assertEquals(status.length, 1);
    assertEquals(FsPermission.valueOf("drwx-wx---"),status[0].getPermission());

    try{
      HowlCli.main(new String[]{"-e","create table testPartTbl (line string)  partitioned by (a string) stored as RCFILE", "-p","rwx-wx--x"});
    }
    catch(Exception e){
      assertTrue(e instanceof ExitException);
      assertEquals(((ExitException)e).getStatus(), 0);
    }

    dfsPath = wh.getDefaultTablePath(MetaStoreUtils.DEFAULT_DATABASE_NAME, "testPartTbl");
    assertEquals(fs.getFileStatus(dfsPath).getPermission(),FsPermission.valueOf("drwx-wx--x"));

    pig.setBatchOn();
    pig.registerQuery("A  = load 'build.xml' as (line:chararray);");
    pig.registerQuery("store A into 'testPartTbl' using "+HowlStorer.class.getName()+"('a=part');");
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.Warehouse

  private void authorize(HiveSemanticAnalyzerHookContext context, String loc) throws SemanticException{

    Path tblDir;
    Configuration conf = context.getConf();
    try {
      Warehouse wh = new Warehouse(conf);
      if (loc == null || loc.isEmpty()){
        tblDir = wh.getDnsPath(wh.getDefaultTablePath(context.getHive().getCurrentDatabase(), tableName).getParent());
      }
      else{
        tblDir = wh.getDnsPath(new Path(loc));
      }

      try {
        AuthUtils.authorize(tblDir, FsAction.WRITE, conf);
      } catch (HowlException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.