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) {