dlmarion commented on code in PR #6443:
URL: https://github.com/apache/accumulo/pull/6443#discussion_r3560000727
##########
server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java:
##########
@@ -213,6 +243,110 @@ public boolean deleteRecursively(Path path) throws
IOException {
return getFileSystemByPath(path).delete(path, true);
}
+ @Override
+ public Map<Path,DeleteStatus> deleteBulk(Collection<Path> paths) throws
IOException {
+
+ requireNonNull(paths);
+
+ if (paths.isEmpty()) {
+ return Map.of();
+ }
+
+ if (paths.size() == 1) {
+ Path p = paths.iterator().next();
+ try {
+ if (delete(p)) {
+ return Map.of(p, DeleteStatus.TRUE);
+ } else {
+ return Map.of(p, DeleteStatus.FALSE);
+ }
+ } catch (IOException e) {
+ return Map.of(p, DeleteStatus.ERROR);
+ }
+ }
+
+ final Map<Volume,ArrayList<Path>> pathsSupportingBulkDelete = new
HashMap<>();
+ final List<Path> pathsNotSupportingBulkDelete = new ArrayList<>();
+ final Map<Path,DeleteStatus> results = new ConcurrentHashMap<>();
+ final List<Future<Void>> futures = new LinkedList<>();
+
+ for (Path p : paths) {
+ FileSystem fs = getFileSystemByPath(p);
+ Volume v = this.bulkDeleteFileSystems.get(fs);
Review Comment:
Updated in 74e00c8
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]