1. Ioan Eugen Stan
  2. wiki-indexer

Commits

Ioan Eugen Stan  committed 8b2ae1a

unknown

  • Participants
  • Parent commits e6c2301
  • Branches default
  • Tags schimbare

Comments (0)

Files changed (2)

File src/main/java/ro/ieugen/wikiindexer/processing/DocIndexer.java

View file
             terms.add(pageToIndex.getContribuitor());
 
             IndexFragment p = new IndexFragment(pageToIndex.getTitle(), ImmutableSet.copyOf(terms));
-            // add the index part to the que for processing. make sure we don't fail to add it.
-            boolean added;
-            do {
-                added = context.offer(p);
-            } while (!added);
+            // add the index part to the que for processing
+            context.offer(p);
         } catch (Exception e) {
             LOG.info("Exception indexing page {}", pageToIndex);
         }

File src/main/java/ro/ieugen/wikiindexer/processing/ProcessingPipeline.java

View file
     }
 
     public boolean offer(IndexFragment pageIndex) {
+        LOG.info("Queueing fragment {}", processingSubmitsCount());
         // stage 1 complete == ahutdown started, all documents have been indexed
         Preconditions.checkState(stage1Complete() == false);
+        boolean added;
+        do {
+            added = indexedDocuments.offer(pageIndex);
+        } while (!added);
         decrementProcessingSubmits();
-        return indexedDocuments.offer(pageIndex);
+        return added;
     }
 
     public IndexFragment take() throws InterruptedException {
+        LOG.info("De-queueing fragment");
         return indexedDocuments.take();
     }