static void performWork(final LuceneWork work, final LuceneBackendResources resources, final IndexWriterDelegate delegate, final IndexingMonitor monitor) { work.acceptIndexWorkVisitor( resources.getWorkVisitor(), null ).performWork( work, delegate, monitor ); }
static void performWork(final LuceneWork work, final LuceneBackendResources resources, final IndexWriterDelegate delegate, final IndexingMonitor monitor) { work.acceptIndexWorkVisitor( resources.getWorkVisitor(), null ).performWork( work, delegate, monitor ); }
public void doWork(final LuceneWork work, final IndexingMonitor monitor) { modificationLock.lock(); try { IndexWriterDelegate delegate = workspace.getIndexWriterDelegate(); if ( delegate == null ) { log.cannotOpenIndexWriterCausePreviousError(); return; } boolean errors = true; try { LuceneWorkExecutor executor = work.acceptIndexWorkVisitor( resources.getWorkVisitor(), null ); executor.performWork( work, delegate, monitor ); errors = false; } finally { workspace.afterTransactionApplied( errors, true ); } } finally { modificationLock.unlock(); } }
public void doWork(final LuceneWork work, final IndexingMonitor monitor) { modificationLock.lock(); try { IndexWriterDelegate delegate = workspace.getIndexWriterDelegate(); if ( delegate == null ) { log.cannotOpenIndexWriterCausePreviousError(); return; } boolean errors = true; try { LuceneWorkExecutor executor = work.acceptIndexWorkVisitor( resources.getWorkVisitor(), null ); executor.performWork( work, delegate, monitor ); errors = false; } finally { workspace.afterTransactionApplied( errors, true ); } } finally { modificationLock.unlock(); } }
private void assertEfficientIndexingUsed(SearchIntegrator searchIntegrator, Class<?> clazz) { DirectoryBasedIndexManager im = (DirectoryBasedIndexManager) searchIntegrator.getIndexBindings().get(clazz) .getIndexManagerSelector().all().iterator().next(); WorkspaceHolder workspaceHolder = im.getWorkspaceHolder(); LuceneBackendResources indexResources = workspaceHolder.getIndexResources(); IndexWorkVisitor<Void, LuceneWorkExecutor> visitor = indexResources.getWorkVisitor(); assertTrue(TestingUtil.extractField(visitor, "updateExecutor") instanceof ByTermUpdateWorkExecutor); } }