@Override public void process( IndexEntryUpdate<?> update ) throws IndexEntryConflictException { delegate.process( update ); updates++; }
@Override public void process( IndexEntryUpdate<?> update ) throws IndexEntryConflictException { delegate.process( update ); } }
@Override public void process( IndexEntryUpdate<?> update ) { try { delegate.process( update ); } catch ( IndexEntryConflictException conflict ) { failures.add( conflict ); } }
private void processAll( IndexUpdater updater, IndexEntryUpdate<IndexDescriptor>[] updates ) throws IndexEntryConflictException { for ( IndexEntryUpdate<IndexDescriptor> update : updates ) { updater.process( update ); } }
@Override public void process( IndexEntryUpdate<?> update ) throws IndexEntryConflictException { actual.process( update ); updatesTarget.add( update ); }
@Override public void process( IndexEntryUpdate<?> update ) throws IndexEntryConflictException { actual.process( update ); if ( update.updateMode() != REMOVED ) { touchedTuples.add( ValueTuple.of( update.values() ) ); } }
private void updateAndCommit( IndexAccessor accessor, Iterable<IndexEntryUpdate<?>> updates ) throws IOException, IndexEntryConflictException { try ( IndexUpdater updater = accessor.newUpdater( IndexUpdateMode.ONLINE ) ) { for ( IndexEntryUpdate<?> update : updates ) { updater.process( update ); } } } }
private void processUpdate( IndexUpdaterMap updaterMap, IndexEntryUpdate<SchemaDescriptor> indexUpdate ) throws IndexEntryConflictException { IndexUpdater updater = updaterMap.getUpdater( indexUpdate.indexKey().schema() ); if ( updater != null ) { updater.process( indexUpdate ); } }
private void updateAndCommit( List<IndexEntryUpdate<?>> nodePropertyUpdates ) throws IOException, IndexEntryConflictException { try ( IndexUpdater updater = accessor.newUpdater( IndexUpdateMode.ONLINE ) ) { for ( IndexEntryUpdate<?> update : nodePropertyUpdates ) { updater.process( update ); } } } }
@SafeVarargs private final void processAll( IndexEntryUpdate<IndexDescriptor>... updates ) throws IndexEntryConflictException { try ( IndexUpdater updater = accessor.newUpdater( ONLINE ) ) { for ( IndexEntryUpdate<IndexDescriptor> update : updates ) { updater.process( update ); } } }
private void updateAndCommit( List<IndexEntryUpdate<?>> nodePropertyUpdates ) throws IOException, IndexEntryConflictException { try ( IndexUpdater updater = accessor.newUpdater( IndexUpdateMode.ONLINE ) ) { for ( IndexEntryUpdate<?> update : nodePropertyUpdates ) { updater.process( update ); } } } }
private void verifyAddWithCorrectUpdater( IndexUpdater correctPopulator, Value... numberValues ) throws IndexEntryConflictException, IOException { IndexEntryUpdate<LabelSchemaDescriptor> update = add( numberValues ); fusionIndexUpdater.process( update ); verify( correctPopulator, times( 1 ) ).process( update ); for ( IndexUpdater populator : aliveUpdaters ) { if ( populator != correctPopulator ) { verify( populator, never() ).process( update ); } } }
private void applyUpdates( ParallelNativeIndexPopulator<GenericKey,NativeIndexValue> populator, AtomicLong next ) throws IndexEntryConflictException { try ( IndexUpdater updater = populator.newPopulatingUpdater( mock( NodePropertyAccessor.class ) ) ) { for ( int i = 0; i < 5; i++ ) { updater.process( update( next.incrementAndGet() ) ); } } }
private void generateUpdates( LuceneIndexAccessor indexAccessor, int nodesToUpdate ) throws IOException, IndexEntryConflictException { try ( IndexUpdater updater = indexAccessor.newUpdater( IndexUpdateMode.ONLINE ) ) { for ( int nodeId = 0; nodeId < nodesToUpdate; nodeId++ ) { updater.process( add( nodeId, nodeId ) ); } } }
private void generateUpdates( LuceneIndexAccessor indexAccessor, int nodesToUpdate ) throws IOException, IndexEntryConflictException { try ( IndexUpdater updater = indexAccessor.newUpdater( IndexUpdateMode.ONLINE ) ) { for ( int nodeId = 0; nodeId < nodesToUpdate; nodeId++ ) { updater.process( add( nodeId, nodeId ) ); } } }
@Test public void testNonApplicableUpdaterDoNotUpdatePopulator() throws IndexEntryConflictException, FlipFailedKernelException { IndexUpdater indexUpdater1 = mock( IndexUpdater.class ); IndexPopulator indexPopulator1 = createIndexPopulator( indexUpdater1 ); addPopulator( indexPopulator1, 2 ); IndexUpdater multipleIndexUpdater = multipleIndexPopulator.newPopulatingUpdater( mock( NodePropertyAccessor.class ) ); IndexEntryUpdate<?> propertyUpdate = createIndexEntryUpdate( index1 ); multipleIndexUpdater.process( propertyUpdate ); verifyZeroInteractions( indexUpdater1 ); }
@Test( expected = IllegalStateException.class ) public void shouldNotUpdateBeforeCreate() throws Exception { // GIVEN IndexProxy inner = mockIndexProxy(); IndexProxy outer = newContractCheckingIndexProxy( inner ); // WHEN try ( IndexUpdater updater = outer.newUpdater( IndexUpdateMode.ONLINE ) ) { updater.process( null ); } }
@Test public void processMustThrowAfterClose() throws Exception { // given IndexUpdater updater = accessor.newUpdater( ONLINE ); updater.close(); // then expected.expect( IllegalStateException.class ); // when updater.process( simpleUpdate() ); }
@Test( expected = IllegalStateException.class ) public void shouldNotUpdateAfterClose() throws Exception { // GIVEN IndexProxy inner = mockIndexProxy(); IndexProxy outer = newContractCheckingIndexProxy( inner ); // WHEN outer.start(); outer.close(); try ( IndexUpdater updater = outer.newUpdater( IndexUpdateMode.ONLINE ) ) { updater.process( null ); } }
@Test public void shouldRemoveEntryForNodeThatHasAlreadyBeenIndexed() throws Exception { // given populator = newPopulator(); addUpdate( populator, 1, "value1" ); // when IndexUpdater updater = populator.newPopulatingUpdater( nodePropertyAccessor ); updater.process( remove( 1, schemaDescriptor, "value1" ) ); populator.close( true ); // then assertEquals( Collections.EMPTY_LIST, getAllNodes( getDirectory(), "value1" ) ); }