/** * Switches on the goFaster mode in the objectstore for this query. * * @throws RuntimeException if something goes wrong */ public void goFaster() { try { if ((!results.isSingleBatch()) && (!isGoingFaster)) { ((ObjectStoreInterMineImpl) results.getObjectStore()).goFaster(results.getQuery()); isGoingFaster = true; } } catch (ObjectStoreException ex) { LOG.warn("Error happened during executing goFaster method.", ex); } }
/** * Switches on the goFaster mode in the objectstore for this query. * * @throws RuntimeException if something goes wrong */ public void goFaster() { try { if ((!results.isSingleBatch()) && (!isGoingFaster)) { ((ObjectStoreInterMineImpl) results.getObjectStore()).goFaster(results.getQuery()); isGoingFaster = true; } } catch (ObjectStoreException ex) { LOG.warn("Error happened during executing goFaster method.", ex); } }
/** * Calls ObjectStore.goFaster() if this object wraps a Results object from an * ObjectStoreInterMineImpl. * @throws ObjectStoreException if ObjectStoreInterMineImpl.goFaster() throws the exception */ public synchronized void goFaster() throws ObjectStoreException { goingFaster++; if (goingFaster == 1) { osResults = changeResultBatchSize(osResults, BIG_BATCH_SIZE); ObjectStore os = osResults.getObjectStore(); if (os instanceof ObjectStoreInterMineImpl) { ((ObjectStoreInterMineImpl) os).goFaster(osResults.getQuery()); } } }
/** * Calls ObjectStore.goFaster() if this object wraps a Results object from an * ObjectStoreInterMineImpl. * @throws ObjectStoreException if ObjectStoreInterMineImpl.goFaster() throws the exception */ public synchronized void goFaster() throws ObjectStoreException { goingFaster++; if (goingFaster == 1) { osResults = changeResultBatchSize(osResults, BIG_BATCH_SIZE); ObjectStore os = osResults.getObjectStore(); if (os instanceof ObjectStoreInterMineImpl) { ((ObjectStoreInterMineImpl) os).goFaster(osResults.getQuery()); } } }
((ObjectStoreInterMineImpl) os).goFaster(queryReference); referenceResults.put(reference, new InterMineResultsContainer( resultsc));
((ObjectStoreInterMineImpl) os).goFaster(queryReference); referenceResults.put(reference, new InterMineResultsContainer( resultsc));
if (doGoFaster) { long startTime = System.currentTimeMillis(); osii.goFaster(q); out.println("Called goFaster in " + (System.currentTimeMillis() - startTime) + " ms");
@Test public void testGoFaster() throws Exception { Query q = new IqlQuery("SELECT Company, Department FROM Company, Department WHERE Department.company CONTAINS Company", "org.intermine.model.testmodel").toQuery(); try { ((ObjectStoreInterMineImpl) os).goFaster(q); Results r = os.execute(q); r.get(0); Assert.assertEquals(3, r.size()); } finally { ((ObjectStoreInterMineImpl) os).releaseGoFaster(q); } }