Package net.sf.joafip.performance.items.entity

Examples of net.sf.joafip.performance.items.entity.Item


    String line;
    while ((line = reader.readLine()) != null) {// NOPMD
      reader.readLine();// skip one
      final int identifier = Integer.parseInt(line);
      final ItemList itemList = getItemList(session);
      final Item item = itemList.removeItem(identifier);
      if (item == null) {
        Exception closeException=null;
        try {
          reader.close();
        } catch (Exception exception) {
          closeException=exception;
        }
        throw new FilePersistenceException("must found #" + identifier
            + " to be deleted",closeException);
      }
      if (++count == BATCH_SIZE) {
        count = 0;
        session.close(EnumFilePersistenceCloseAction.SAVE);
        session.open();
        consistencyCheck();
        ++batchCount;
        logger.info("delete batch #" + batchCount);
      }
    }
    reader.close();
    session.close(EnumFilePersistenceCloseAction.SAVE);

    session.open();
    batchCount = 0;
    count = 0;
    reader = new BufferedReader(new FileReader(insertLogFilePath));
    // "runtime_perf/toSearch.txt"));
    while (reader.readLine() != null && (line = reader.readLine()) != null) {// NOPMD
      final int identifier = Integer.parseInt(line);
      final ItemList itemList = getItemList(session);
      final Item item = itemList.get(identifier);
      if (item == null) {
        throw new FilePersistenceException("must found #" + identifier
            + " because not deleted");
      }
      if (++count == BATCH_SIZE) {
        count = 0;
        session.close(EnumFilePersistenceCloseAction.SAVE);
        session.open();
        ++batchCount;
        logger.info("search batch #" + batchCount);
      }
    }
    reader.close();
    session.close(EnumFilePersistenceCloseAction.SAVE);

    session.open();
    batchCount = 0;
    count = 0;
    reader = new BufferedReader(new FileReader(insertLogFilePath));
    // "runtime_perf/toDelete.txt"));
    while ((line = reader.readLine()) != null) { // NOPMD
      reader.readLine();// skip
      final int identifier = Integer.parseInt(line);
      final ItemList itemList = getItemList(session);
      final Item item = itemList.getItem(identifier);
      if (item != null) {
        throw new FilePersistenceException("must not found #"
            + identifier + " because deleted");
      }
      if (++count == BATCH_SIZE) {
View Full Code Here


    int count = 0;
    String line = reader.readLine();
    while (line != null) { // NOPMD
      count++;
      final int identifier = Integer.parseInt(line);
      Item removed = itemList.removeItem(identifier);
      if( removed==null){
        logger.error("not found "+identifier);
      }
      if (count % BATCH_SIZE == BATCH_SIZE - 1) {
        session.close(EnumFilePersistenceCloseAction.SAVE);
View Full Code Here

    while ((line = reader.readLine()) != null) { // NOPMD
      count++;
      final int identifier = Integer.parseInt(line);
      final ItemList itemList = getItemList(session);
      final long startSearchTime = System.currentTimeMillis();
      final Item item = itemList.get(identifier);
      if (item == null) {
        // throw new
        // IllegalStateException("missing item for identifier "
        // + identifier);
        logger.info("missing item for identifier " + identifier);
        missingCount++;
        if (missingCount < 40) {
          missingList.add(identifier);
        }
      } else {
        if (item.getIdentifier() != identifier) {
          misMatchCount++;
          if (misMatchCount < 40) {
            misMatchList.add(item.getIdentifier() + " for "
                + identifier);
          }
        }
      }
      final long currentTime = System.currentTimeMillis();
View Full Code Here

   * @throws FilePersistenceException
   */
  private void addItem(final IDataAccessSession session, final int identifier)
      throws FilePersistenceException {
    try {
      final Item item = new Item(identifier, null/* itemTemplate */,
          "item" + identifier);
      final ItemList itemList = getItemList(session);
      itemList.addItem(item);
    } catch (final RuntimeException exception) {
      logger.fatal("adding item " + identifier, exception);
View Full Code Here

TOP

Related Classes of net.sf.joafip.performance.items.entity.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.