Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ae21878
HDDS-13159. Refactor KeyManagerImpl for getting deleted subdirectorie…
swamirishi May 31, 2025
cd0157b
HDDS-13159. Static Import KeyValue
swamirishi May 31, 2025
4c73e3a
HDDS-13034. Refactor Directory Deleting Service to use ReclaimableDir…
swamirishi Jun 3, 2025
d14e83d
HDDS-13034. Fix pmd
swamirishi Jun 3, 2025
735903c
HDDS-13160. Remove SnapshotDirectoryCleaningService and refactor Abst…
swamirishi Jun 3, 2025
034585b
HDDS-13170. Reclaimable filter should always reclaim entries when buc…
swamirishi Jun 3, 2025
7eb2b98
HDDS-13160. Fix tests
swamirishi Jun 3, 2025
1fe3cfc
HDDS-13034. Fix find bugs
swamirishi Jun 3, 2025
99b61a2
HDDS-13034. Fix find bugs
swamirishi Jun 3, 2025
75c3891
Merge remote-tracking branch 'origin/HDDS-13034' into HEAD
swamirishi Jun 3, 2025
9df1494
HDDS-13160. Remove Snapshot directory cleaning service
swamirishi Jun 3, 2025
effdf71
HDDS-13160. Fix checkstyle
swamirishi Jun 3, 2025
29d2619
HDDS-13034. deprecate config instead of removing
swamirishi Jun 3, 2025
f18dcc2
Merge remote-tracking branch 'origin/HDDS-13034' into HEAD
swamirishi Jun 3, 2025
806111c
HDDS-13160. Fix function access
swamirishi Jun 3, 2025
4867d7d
HDDS-13035. Snapshot Deleting Service should hold write locks while p…
swamirishi Jun 3, 2025
6db570e
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 5, 2025
a9cd247
Merge remote-tracking branch 'origin/HDDS-13034' into HEAD
swamirishi Jun 5, 2025
3e8db11
Merge remote-tracking branch 'origin/HDDS-13160' into HEAD
swamirishi Jun 5, 2025
2db371d
HDDS-13034. refactor test case
swamirishi Jun 5, 2025
4fc7d34
Merge remote-tracking branch 'origin/HDDS-13034' into HEAD
swamirishi Jun 5, 2025
464e321
HDDS-13034. Fix test case
swamirishi Jun 5, 2025
0ecec31
HDDS-13034. Fix test case
swamirishi Jun 5, 2025
1e9896b
HDDS-13160. Suspend should wait
swamirishi Jun 6, 2025
968d90a
HDDS-13035. Fix test
swamirishi Jun 6, 2025
c12a36e
HDDS-13034. Fix test
swamirishi Jun 6, 2025
e8bdecc
Merge remote-tracking branch 'origin/HDDS-13034' into HEAD
swamirishi Jun 6, 2025
b53430a
Merge remote-tracking branch 'origin/HDDS-13160' into HEAD
swamirishi Jun 6, 2025
72fc541
HDDS-13034. Fix test
swamirishi Jun 6, 2025
a03d498
Merge remote-tracking branch 'origin/HDDS-13034' into HEAD
swamirishi Jun 6, 2025
847dab7
HDDS-13160. Fix test
swamirishi Jun 6, 2025
b77c025
HDDS-13160. Fix test
swamirishi Jun 6, 2025
d1de734
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 6, 2025
f4e9f4a
HDDS-13034. Address review comments
swamirishi Jun 6, 2025
7c47106
HDDS-13034. Address review comments
swamirishi Jun 8, 2025
428e46d
HDDS-13036. Address review comments
swamirishi Jun 9, 2025
248305c
Merge remote-tracking branch 'origin/HDDS-13034' into HEAD
swamirishi Jun 9, 2025
90c8746
HDDS-13160. Fix checkstyle
swamirishi Jun 9, 2025
50d783c
HDDS-13160. Remove unused
swamirishi Jun 9, 2025
029ca58
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 9, 2025
d7ea8f6
Merge remote-tracking branch 'apache/master' into HEAD
swamirishi Jun 9, 2025
6a9721f
HDDS-13160. Fix checkstyle
swamirishi Jun 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public abstract class BackgroundService {
private final int threadPoolSize;
private final String threadNamePrefix;
private final PeriodicalTask service;
private CompletableFuture<Void> future;

public BackgroundService(String serviceName, long interval,
TimeUnit unit, int threadPoolSize, long serviceTimeout) {
Expand All @@ -68,6 +69,11 @@ public BackgroundService(String serviceName, long interval,
this.threadNamePrefix = threadNamePrefix;
initExecutorAndThreadGroup();
service = new PeriodicalTask();
this.future = CompletableFuture.completedFuture(null);
}

protected CompletableFuture<Void> getFuture() {
return future;
}

@VisibleForTesting
Expand Down Expand Up @@ -138,7 +144,7 @@ public synchronized void run() {

while (!tasks.isEmpty()) {
BackgroundTask task = tasks.poll();
CompletableFuture.runAsync(() -> {
future = future.thenCombine(CompletableFuture.runAsync(() -> {
long startTime = System.nanoTime();
try {
BackgroundTaskResult result = task.call();
Expand All @@ -157,7 +163,7 @@ public synchronized void run() {
serviceName, endTime - startTime, serviceTimeoutInNanos);
}
}
}, exec);
}, exec), (Void1, Void) -> null);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.hadoop.fs.ozone;
package org.apache.hadoop.ozone.om.service;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_ENABLED;
Expand Down Expand Up @@ -77,8 +77,6 @@
import org.apache.hadoop.ozone.om.ratis.OzoneManagerDoubleBuffer;
import org.apache.hadoop.ozone.om.ratis.OzoneManagerStateMachine;
import org.apache.hadoop.ozone.om.request.file.OMFileRequest;
import org.apache.hadoop.ozone.om.service.DirectoryDeletingService;
import org.apache.hadoop.ozone.om.service.KeyDeletingService;
import org.apache.hadoop.ozone.om.snapshot.filter.ReclaimableDirFilter;
import org.apache.hadoop.ozone.om.snapshot.filter.ReclaimableKeyFilter;
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
* limitations under the License.
*/

package org.apache.hadoop.fs.ozone;
package org.apache.hadoop.ozone.om.service;

import static org.apache.hadoop.fs.ozone.TestDirectoryDeletingServiceWithFSO.assertSubPathsCount;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_ACL_ENABLED;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_ITERATE_BATCH_SIZE;
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_URI_DELIMITER;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_ADDRESS_KEY;
import static org.apache.hadoop.ozone.om.service.TestDirectoryDeletingServiceWithFSO.assertSubPathsCount;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -51,7 +51,6 @@
import org.apache.hadoop.ozone.om.helpers.BucketLayout;
import org.apache.hadoop.ozone.om.helpers.OmDirectoryInfo;
import org.apache.hadoop.ozone.om.helpers.OmKeyInfo;
import org.apache.hadoop.ozone.om.service.DirectoryDeletingService;
import org.apache.ozone.test.GenericTestUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.apache.commons.lang3.RandomStringUtils;
Expand Down Expand Up @@ -314,7 +315,8 @@ private void createFileKey(OzoneBucket bucket, String keyName)
* and purgeSnapshot in same batch.
*/
@Test
public void testKeyAndSnapshotDeletionService() throws IOException, InterruptedException, TimeoutException {
public void testKeyAndSnapshotDeletionService()
throws IOException, InterruptedException, TimeoutException, ExecutionException {
OzoneManager omLeader = cluster.getOMLeader();
OzoneManager omFollower;

Expand Down
Loading
Loading