Loading pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ <groupId>mindex</groupId> <artifactId>ppp-codes</artifactId> <version>1.2.4-DEVEL</version> <version>1.2.5-DEVEL</version> <packaging>jar</packaging> <name>ppp-codes</name> Loading src/main/java/pppcodes/processors/ApproxNavProcessorPPPCodes.java +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ public abstract class ApproxNavProcessorPPPCodes implements AsynchronousNavigati return new Callable<RankingSingleQueryOperation>() { @Override public RankingSingleQueryOperation call() throws InterruptedException, CloneNotSupportedException, AlgorithmMethodException { // the single navigation processor CANNOT be executed in threads // the single navigation processor CANNOT be executed in threads (that is why pass 'null' to the .execute method) NavigationProcessors.execute(null, processor); return originalOperation; } Loading src/main/java/pppcodes/processors/SingleSpaceCandGeneratorAsync.java +13 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,14 @@ public class SingleSpaceCandGeneratorAsync extends SingleSpaceCandGenerator { objectCache = new ArrayBlockingQueue<>(CACHE_SIZE); } /** * This method reads from the priority queue {@link #priorityQueue} next leaf node of the PPP-Tree. * The underlying {@link ApproxNavigationProcessor} processes any internal nodes that would be on the top of the * priority queue. If data objects (object IDs, instances of {@link RankableLocators}) are at the top of the queue, * they are moved to the cache {@link #objectCache}. * @param isAsynchronous flag, if the processing of this processor is realized in threads (it should not be in case of this class) * @return leaf cell or null, if the reading is finished (the PPP-Codes merging thread has finished) */ @Override protected RankableCell getNextProcessingItem(boolean isAsynchronous) { RankableCell retVal = null; Loading @@ -63,6 +71,7 @@ public class SingleSpaceCandGeneratorAsync extends SingleSpaceCandGenerator { moveFromQueueToCache(); } if (readingFinished) { retVal.getCell().readUnLock(); return null; } return retVal; Loading @@ -82,6 +91,10 @@ public class SingleSpaceCandGeneratorAsync extends SingleSpaceCandGenerator { } } /** * * @throws NoSuchElementException */ private void moveFromQueueToCache() throws NoSuchElementException { while (! priorityQueue.isEmpty() && (priorityQueue.peek() instanceof RankableLocators) && !readingFinished) { try { Loading Loading
pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ <groupId>mindex</groupId> <artifactId>ppp-codes</artifactId> <version>1.2.4-DEVEL</version> <version>1.2.5-DEVEL</version> <packaging>jar</packaging> <name>ppp-codes</name> Loading
src/main/java/pppcodes/processors/ApproxNavProcessorPPPCodes.java +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ public abstract class ApproxNavProcessorPPPCodes implements AsynchronousNavigati return new Callable<RankingSingleQueryOperation>() { @Override public RankingSingleQueryOperation call() throws InterruptedException, CloneNotSupportedException, AlgorithmMethodException { // the single navigation processor CANNOT be executed in threads // the single navigation processor CANNOT be executed in threads (that is why pass 'null' to the .execute method) NavigationProcessors.execute(null, processor); return originalOperation; } Loading
src/main/java/pppcodes/processors/SingleSpaceCandGeneratorAsync.java +13 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,14 @@ public class SingleSpaceCandGeneratorAsync extends SingleSpaceCandGenerator { objectCache = new ArrayBlockingQueue<>(CACHE_SIZE); } /** * This method reads from the priority queue {@link #priorityQueue} next leaf node of the PPP-Tree. * The underlying {@link ApproxNavigationProcessor} processes any internal nodes that would be on the top of the * priority queue. If data objects (object IDs, instances of {@link RankableLocators}) are at the top of the queue, * they are moved to the cache {@link #objectCache}. * @param isAsynchronous flag, if the processing of this processor is realized in threads (it should not be in case of this class) * @return leaf cell or null, if the reading is finished (the PPP-Codes merging thread has finished) */ @Override protected RankableCell getNextProcessingItem(boolean isAsynchronous) { RankableCell retVal = null; Loading @@ -63,6 +71,7 @@ public class SingleSpaceCandGeneratorAsync extends SingleSpaceCandGenerator { moveFromQueueToCache(); } if (readingFinished) { retVal.getCell().readUnLock(); return null; } return retVal; Loading @@ -82,6 +91,10 @@ public class SingleSpaceCandGeneratorAsync extends SingleSpaceCandGenerator { } } /** * * @throws NoSuchElementException */ private void moveFromQueueToCache() throws NoSuchElementException { while (! priorityQueue.isEmpty() && (priorityQueue.peek() instanceof RankableLocators) && !readingFinished) { try { Loading