@Test public void getUnusedWhere() throws Exception { String query = purgeUnusedSnapshotsFacet.getUnusedWhere(bucketId); assertThat(query, equalTo( "(bucket = #1:1 AND component = $a[0]) OR (bucket = #1:1 AND component = $a[1]) OR (bucket = #1:1 AND component = $a[2]) OR (bucket = #1:1 AND component = $a[3]) OR (bucket = #1:1 AND component = $a[4]) OR (bucket = #1:1 AND component = $a[5]) OR (bucket = #1:1 AND component = $a[6]) OR (bucket = #1:1 AND component = $a[7]) OR (bucket = #1:1 AND component = $a[8]) OR (bucket = #1:1 AND component = $a[9])")); }
@VisibleForTesting String getUnusedWhere(final ORID bucketId) { return IntStream.range(0, findUnusedLimit) .mapToObj(i -> format(UNUSED_WHERE_QUERY, bucketId, i)) .collect(Collectors.joining(" OR ")); }
PurgeUnusedSnapshotsFacetImpl extends FacetSupport implements PurgeUnusedSnapshotsFacet { @VisibleForTesting String getUnusedWhere(final ORID bucketId) { return IntStream.range(0, findUnusedLimit) .mapToObj(i -> format(UNUSED_WHERE_QUERY, bucketId, i)) .collect(Collectors.joining(" OR ")); } }
PurgeUnusedSnapshotsFacetImpl extends FacetSupport implements PurgeUnusedSnapshotsFacet { @VisibleForTesting String getUnusedWhere(final ORID bucketId) { return IntStream.range(0, findUnusedLimit) .mapToObj(i -> format(UNUSED_WHERE_QUERY, bucketId, i)) .collect(Collectors.joining(" OR ")); } @Inject  PurgeUnusedSnapshotsFacetImpl(
      final ComponentEntityAdapter componentEntityAdapter,
      @Named(GroupType.NAME) final Type groupType,
      @Named(HostedType.NAME) final Type hostedType,
      @Named("${nexus.tasks.purgeUnusedSnapshots.findUnusedLimit:-50}") int findUnusedLimit); }
PurgeUnusedSnapshotsFacetImpl extends FacetSupport implements PurgeUnusedSnapshotsFacet { @VisibleForTesting String getUnusedWhere(final ORID bucketId) { return IntStream.range(0, findUnusedLimit) .mapToObj(i -> format(UNUSED_WHERE_QUERY, bucketId, i)) .collect(Collectors.joining(" OR ")); } @Inject  PurgeUnusedSnapshotsFacetImpl(
      final ComponentEntityAdapter componentEntityAdapter,
      @Named(GroupType.NAME) final Type groupType,
      @Named(HostedType.NAME) final Type hostedType,
      @Named("${nexus.tasks.purgeUnusedSnapshots.findUnusedLimit:-50}") int findUnusedLimit); @Override @Guarded(by = STARTED) void purgeUnusedSnapshots(final int numberOfDays); }
PurgeUnusedSnapshotsFacetImpl extends FacetSupport implements PurgeUnusedSnapshotsFacet { @VisibleForTesting String getUnusedWhere(final ORID bucketId) { return IntStream.range(0, findUnusedLimit) .mapToObj(i -> format(UNUSED_WHERE_QUERY, bucketId, i)) .collect(Collectors.joining(" OR ")); } @Inject  PurgeUnusedSnapshotsFacetImpl(
      final ComponentEntityAdapter componentEntityAdapter,
      @Named(GroupType.NAME) final Type groupType,
      @Named(HostedType.NAME) final Type hostedType,
      @Named("${nexus.tasks.purgeUnusedSnapshots.findUnusedLimit:-50}") int findUnusedLimit); @Override @Guarded(by = STARTED) void purgeUnusedSnapshots(final int numberOfDays);  }