@Override public void performOperations(List<LuceneWork> queue, IndexingMonitor monitor) { backend.applyWork( queue, monitor ); }
/** * Send all operations stored so far to the backend to be performed, atomically and/or transactionally * if supported/enabled by each specific backend. * * @param monitor a {@link org.hibernate.search.backend.IndexingMonitor} object. */ public void commitOperations(IndexingMonitor monitor) { // FIXME move executor here to parallel work - optionally? See HSEARCH-826 for ( WorkPlan plan : queues.values() ) { plan.backendQueueProcessor.applyWork( plan.queue, monitor ); } }
/** * Send all operations stored so far to the backend to be performed, atomically and/or transactionally * if supported/enabled by each specific backend. * * @param monitor a {@link org.hibernate.search.backend.IndexingMonitor} object. */ public void commitOperations(IndexingMonitor monitor) { // FIXME move executor here to parallel work - optionally? See HSEARCH-826 for ( WorkPlan plan : queues.values() ) { plan.backendQueueProcessor.applyWork( plan.queue, monitor ); } }
@Override public void applyWork(List<LuceneWork> workList, IndexingMonitor monitor) { if ( selectionStrategy.isIndexOwnerLocal() ) { getOrCreateDelegate().applyWork( workList, monitor ); } else { if ( workList == null ) { throw new IllegalArgumentException( "workList should not be null" ); } jgroupsProcessor.sendLuceneWorkList( workList ); } }
@Test public void testCheckingForNullWork() { try { BackendQueueProcessor backend = new JndiJMSBackendQueueProcessor(); backend.applyWork( null, null ); } catch (IllegalArgumentException e2) { // this is ok, we just want to avoid other exceptions or NPEs } } }
private void checkBackendBehaviour(Backend backend) { try { WorkerBuildContext context = EasyMock.createNiceMock( WorkerBuildContext.class ); IndexManager indexManager = EasyMock.createNiceMock( IndexManager.class ); backend.initialize( new Properties(), context ); BackendQueueProcessor processor = backend.createQueueProcessor( indexManager, context ); processor.applyWork( null, null ); } catch (IllegalArgumentException e) { // this is ok, we just want to avoid other exceptions or NPEs } } }
@Test public void testCheckingForNullWork() { try { JGroupsBackendQueueTask queueTask = EasyMock.createNiceMock( JGroupsBackendQueueTask.class ); BackendQueueProcessor backend = new JGroupsBackendQueueProcessor( new SlaveNodeSelector(), queueTask, null ); backend.applyWork( null, null ); } catch (IllegalArgumentException e2) { // this is ok, we just want to avoid other exceptions or NPEs } }