@Test public void noCommitContext() throws Exception{ observer.contentChanged(EMPTY_NODE, CommitInfo.EMPTY); }
@Override public void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info) { if (info.isExternal()){ return; } CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME); if (commitContext == null){ return; } LuceneDocumentHolder holder = (LuceneDocumentHolder) commitContext.get(LuceneDocumentHolder.NAME); if (holder == null){ return; } commitContext.remove(LuceneDocumentHolder.NAME); int droppedCount = 0; for (LuceneDoc doc : holder.getNRTIndexedDocs()){ if (!docQueue.add(doc)) { droppedCount++; } } docQueue.addAllSynchronously(holder.getSyncIndexedDocs()); if (droppedCount > 0){ log.warn("Dropped [{}] docs from indexing as queue is full", droppedCount); } }
LocalIndexObserver implements Observer { @Override public void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info) { if (info.isExternal()){ return; } CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME); if (commitContext == null){ return; } LuceneDocumentHolder holder = (LuceneDocumentHolder) commitContext.get(LuceneDocumentHolder.NAME); if (holder == null){ return; } commitContext.remove(LuceneDocumentHolder.NAME); int droppedCount = 0; for (LuceneDoc doc : holder.getNRTIndexedDocs()){ if (!docQueue.add(doc)) { droppedCount++; } } docQueue.addAllSynchronously(holder.getSyncIndexedDocs()); if (droppedCount > 0){ log.warn("Dropped [{}] docs from indexing as queue is full", droppedCount); } } }
LocalIndexObserver implements Observer { @Override public void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info) { if (info.isExternal()){ return; } CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME); if (commitContext == null){ return; } LuceneDocumentHolder holder = (LuceneDocumentHolder) commitContext.get(LuceneDocumentHolder.NAME); if (holder == null){ return; } commitContext.remove(LuceneDocumentHolder.NAME); int droppedCount = 0; for (LuceneDoc doc : holder.getNRTIndexedDocs()){ if (!docQueue.add(doc)) { droppedCount++; } } docQueue.addAllSynchronously(holder.getSyncIndexedDocs()); if (droppedCount > 0){ log.warn("Dropped [{}] docs from indexing as queue is full", droppedCount); } } LocalIndexObserver(DocumentQueue docQueue, StatisticsProvider sp); }
LocalIndexObserver implements Observer { @Override public void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info) { if (info.isExternal()){ return; } CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME); if (commitContext == null){ return; } LuceneDocumentHolder holder = (LuceneDocumentHolder) commitContext.get(LuceneDocumentHolder.NAME); if (holder == null){ return; } commitContext.remove(LuceneDocumentHolder.NAME); int droppedCount = 0; for (LuceneDoc doc : holder.getNRTIndexedDocs()){ if (!docQueue.add(doc)) { droppedCount++; } } docQueue.addAllSynchronously(holder.getSyncIndexedDocs()); if (droppedCount > 0){ log.warn("Dropped [{}] docs from indexing as queue is full", droppedCount); } } LocalIndexObserver(DocumentQueue docQueue, StatisticsProvider sp); @Override void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info); }
LocalIndexObserver implements Observer { @Override public void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info) { if (info.isExternal()){ return; } CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME); if (commitContext == null){ return; } LuceneDocumentHolder holder = (LuceneDocumentHolder) commitContext.get(LuceneDocumentHolder.NAME); if (holder == null){ return; } commitContext.remove(LuceneDocumentHolder.NAME); int droppedCount = 0; for (LuceneDoc doc : holder.getNRTIndexedDocs()){ if (!docQueue.add(doc)) { droppedCount++; } } docQueue.addAllSynchronously(holder.getSyncIndexedDocs()); if (droppedCount > 0){ log.warn("Dropped [{}] docs from indexing as queue is full", droppedCount); } } LocalIndexObserver(DocumentQueue docQueue, StatisticsProvider sp); @Override void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info);  }