@Test public void shouldReturnInMemoryStrategy() throws Exception { DuplicateDetectionStrategy<Record> strategy = new DuplicateDetectionStrategyProvider(applicationDirectories, "HASH", MAX_HEAP_GB, MAX_DISK_SIZE_GB) .get(); assertThat(strategy, is(instanceOf(HashBasedDuplicateDetectionStrategy.class))); DuplicateDetectionStrategy<Record> strategyLowerCase = new DuplicateDetectionStrategyProvider( applicationDirectories, "hash", MAX_HEAP_GB, MAX_DISK_SIZE_GB) .get(); assertThat(strategyLowerCase, is(instanceOf(HashBasedDuplicateDetectionStrategy.class))); }
@Override public DuplicateDetectionStrategy<Record> get() { switch (getStrategy()) { case HASH: return new HashBasedDuplicateDetectionStrategy(); case DISK: return new DiskBackedDuplicateDetectionStrategy(applicationDirectories, maxHeapGb, maxDiskSizeGb); case BLOOM: default: return new BloomFilterDuplicateDetectionStrategy(); } }
DuplicateDetectionStrategyProvider extends ComponentSupport implements Provider<DuplicateDetectionStrategy<Record>> { @Override public DuplicateDetectionStrategy<Record> get() { switch (getStrategy()) { case HASH: return new HashBasedDuplicateDetectionStrategy(); case DISK: return new DiskBackedDuplicateDetectionStrategy(applicationDirectories, maxHeapGb, maxDiskSizeGb); case BLOOM: default: return new BloomFilterDuplicateDetectionStrategy(); } } }
DuplicateDetectionStrategyProvider extends ComponentSupport implements Provider<DuplicateDetectionStrategy<Record>> { @Override public DuplicateDetectionStrategy<Record> get() { switch (getStrategy()) { case HASH: return new HashBasedDuplicateDetectionStrategy(); case DISK: return new DiskBackedDuplicateDetectionStrategy(applicationDirectories, maxHeapGb, maxDiskSizeGb); case BLOOM: default: return new BloomFilterDuplicateDetectionStrategy(); } } @Inject  DuplicateDetectionStrategyProvider(
      final ApplicationDirectories applicationDirectories,
      @Named("${nexus.maven.duplicate.detection.strategy:-BLOOM}") final String strategy,
      @Named("${nexus.maven.duplicate.detection.heap.max.gb:-1}") final int maxHeapGb,
      @Named("${nexus.maven.duplicate.detection.disk.max.gb:-10}") final int maxDiskSizeGb); }
DuplicateDetectionStrategyProvider extends ComponentSupport implements Provider<DuplicateDetectionStrategy<Record>> { @Override public DuplicateDetectionStrategy<Record> get() { switch (getStrategy()) { case HASH: return new HashBasedDuplicateDetectionStrategy(); case DISK: return new DiskBackedDuplicateDetectionStrategy(applicationDirectories, maxHeapGb, maxDiskSizeGb); case BLOOM: default: return new BloomFilterDuplicateDetectionStrategy(); } } @Inject  DuplicateDetectionStrategyProvider(
      final ApplicationDirectories applicationDirectories,
      @Named("${nexus.maven.duplicate.detection.strategy:-BLOOM}") final String strategy,
      @Named("${nexus.maven.duplicate.detection.heap.max.gb:-1}") final int maxHeapGb,
      @Named("${nexus.maven.duplicate.detection.disk.max.gb:-10}") final int maxDiskSizeGb); @Override DuplicateDetectionStrategy<Record> get(); }
DuplicateDetectionStrategyProvider extends ComponentSupport implements Provider<DuplicateDetectionStrategy<Record>> { @Override public DuplicateDetectionStrategy<Record> get() { switch (getStrategy()) { case HASH: return new HashBasedDuplicateDetectionStrategy(); case DISK: return new DiskBackedDuplicateDetectionStrategy(applicationDirectories, maxHeapGb, maxDiskSizeGb); case BLOOM: default: return new BloomFilterDuplicateDetectionStrategy(); } } @Inject  DuplicateDetectionStrategyProvider(
      final ApplicationDirectories applicationDirectories,
      @Named("${nexus.maven.duplicate.detection.strategy:-BLOOM}") final String strategy,
      @Named("${nexus.maven.duplicate.detection.heap.max.gb:-1}") final int maxHeapGb,
      @Named("${nexus.maven.duplicate.detection.disk.max.gb:-10}") final int maxDiskSizeGb); @Override DuplicateDetectionStrategy<Record> get();  }