NNProcessor { public void remove(final ByteArray id) { final Set<PartitionData> partitionSet = idsToPartition.remove(id); if (partitionSet != null) { for (final PartitionData pd : partitionSet) { final Set<ByteArray> idSet = partitionsToIds.get(pd); if (idSet != null) { idSet.remove(id); } } } primaries.remove(id); others.remove(id); if (index != null) { index.empty(id); } } NNProcessor(
      final Partitioner<Object> partitioner,
      final TypeConverter<STORE_VALUE> typeConverter,
      final DistanceProfileGenerateFn<?, STORE_VALUE> distanceProfileFn,
      final double maxDistance,
      final PartitionData parentPartition); void remove(final ByteArray id); void add(final ByteArray id, final boolean isPrimary, final PARTITION_VALUE partitionValue); int size(); boolean trimSmallPartitions(final int size); void process(
      final NeighborListFactory<STORE_VALUE> listFactory,
      final CompleteNotifier<STORE_VALUE> notification); int getUpperBoundPerPartition(); void setUpperBoundPerPartition(final int upperBoundPerPartition); static final int DEFAULT_UPPER_BOUND_PARTIION_SIZE; }
@Test public void testNormalOp() throws IOException, InterruptedException { runProcess(buildProcessor(), new CompleteNotifier<Integer>() { @Override public void complete( final ByteArray id, final Integer value, final NeighborList<Integer> list) throws IOException, InterruptedException { final Iterator<Entry<ByteArray, Integer>> it = list.iterator(); final List<Integer> expectedResultSet = new ArrayList<>(expectedResults.get(value)); assertNotNull(expectedResultSet); while (it.hasNext()) { final Integer result = it.next().getValue(); assertTrue("" + value + " with " + result, expectedResultSet.remove(result)); } assertTrue(expectedResultSet.isEmpty()); } }); }
@Test public void testRemoveOp() throws IOException, InterruptedException { final NNProcessor<Integer, Integer> processor = buildProcessor(); runProcess(processor, new CompleteNotifier<Integer>() { @Override public void complete( final ByteArray id, final Integer value, final NeighborList<Integer> list) throws IOException, InterruptedException { processor.remove(id); } }); }