/** * {@inheritDoc} */ @Override public ObjectStoreWriterInterMineImpl getNewWriter() throws ObjectStoreException { return new ObjectStoreWriterInterMineImpl(this); }
/** * {@inheritDoc} */ @Override public ObjectStoreWriterInterMineImpl getNewWriter() throws ObjectStoreException { return new ObjectStoreWriterInterMineImpl(this); }
public static void testPerformance(ObjectStore os) throws ObjectStoreException { // make sure we have verbose query logging on ((ObjectStoreInterMineImpl) os).setVerboseQueryLog(true); int batchSize = 10000; ObjectStoreWriterInterMineImpl osw = new ObjectStoreWriterInterMineImpl(os); long storeTime = 0; int batches = 3; for (int i = 0; i < batches; i++) { storeTime += storeEmployees(osw, batchSize); } double timePerThousand = (double) storeTime / ((double)(batches * batchSize)) * 1000; System.out.println("Total store time: " + storeTime + "ms. Average time per thousand: " + new DecimalFormat("#0.000").format(timePerThousand) + "ms."); LOG.info("Total store time: " + storeTime + "ms"); // flush the cache so we have to materialise all objects os.flushObjectById(); System.out.println("\nReading all employee objects with empty object cache"); readEmployees(os, batchSize); }