ctubbsii commented on code in PR #6435:
URL: https://github.com/apache/accumulo/pull/6435#discussion_r3562623898


##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader11to12.java:
##########
@@ -1014,4 +1030,108 @@ void moveTableProperties(ServerContext context) {
     LOG.info(
         "Moving table properties from system configuration to namespace 
configurations complete.");
   }
+
+  @VisibleForTesting
+  public void deleteCompactionTempFiles(final ServerContext ctx, final 
DeleteStats stats,
+      final Collection<Path> deletedFiles) {
+
+    final String pattern = "/tables/*/*/*.rf_tmp";
+    final Collection<Volume> vols = ctx.getVolumeManager().getVolumes();
+    final ExecutorService svc = Executors.newFixedThreadPool(vols.size());
+    final List<Future<Void>> futures = new ArrayList<>(vols.size());
+    final Set<Path> oldCompactionTmpFiles = ConcurrentHashMap.newKeySet();
+
+    for (Volume vol : vols) {
+      final Path volPattern = new Path(vol.getBasePath() + pattern);
+      LOG.info("Looking for old compaction tmp files that match pattern: {}", 
volPattern);
+      futures.add(svc.submit(() -> {
+        try {
+          FileStatus[] files = vol.getFileSystem().globStatus(volPattern,
+              (p) -> (p.getName().startsWith("" + 
FilePrefix.FULL_COMPACTION.getPrefix())
+                  || p.getName().startsWith("" + 
FilePrefix.COMPACTION.getPrefix()))
+                  && p.getName().endsWith(".rf_tmp"));

Review Comment:
   This last check for the suffix is still unnecessary. That's what I was 
getting at with the suggestion to use the more specific glob pattern.



-- 
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]

Reply via email to