You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/03/11 12:43:01 UTC

[GitHub] [accumulo] milleruntime commented on a change in pull request #1558: Resolve relative delete markers on upgrade. Closes #1463

milleruntime commented on a change in pull request #1558: Resolve relative delete markers on upgrade. Closes #1463
URL: https://github.com/apache/accumulo/pull/1558#discussion_r390943068
 
 

 ##########
 File path: server/master/src/main/java/org/apache/accumulo/master/upgrade/Upgrader9to10.java
 ##########
 @@ -430,26 +432,27 @@ public void upgradeFileDeletes(ServerContext ctx, Ample.DataLevel level) {
     }
   }
 
+  /**
+   * If path of file to delete is a directory, change it to all volumes. See {@link GcVolumeUtil}.
+   * For example: A directory "hdfs://localhost:9000/accumulo/tables/5a/t-0005" with depth = 4 will
+   * be switched to "agcav:/tables/5a/t-0005". A file
+   * "hdfs://localhost:9000/accumulo/tables/5a/t-0005/A0012.rf" with depth = 5 will be returned as
+   * is.
+   */
   @VisibleForTesting
-  static String switchToAllVolumes(String olddelete) {
-    Path relPath = VolumeManager.FileType.TABLE.removeVolume(new Path(olddelete));
-
-    if (relPath == null) {
-      // An old style relative delete marker of the form /<table id>/<tablet dir>[/<file>]
-      relPath = new Path("/" + VolumeManager.FileType.TABLE.getDirectory() + olddelete);
-      Preconditions.checkState(
-          olddelete.startsWith("/") && relPath.depth() == 3 || relPath.depth() == 4,
-          "Unrecongnized relative delete marker {}", olddelete);
-    }
-
-    if (relPath.depth() == 3 && !relPath.getName().startsWith(Constants.BULK_PREFIX)) {
-      return GcVolumeUtil.getDeleteTabletOnAllVolumesUri(TableId.of(relPath.getParent().getName()),
-          relPath.getName());
+  static String switchToAllVolumes(Path olddelete) {
+    // for directory, change volume to all volumes
+    if (olddelete.depth() == 4 && !olddelete.getName().startsWith(Constants.BULK_PREFIX)) {
 
 Review comment:
   Ah OK.  Then we still need to remove the volume before checking.  
   
   @ctubbsii I added a comment above the line and at the beginning of the method.  I will add the ```removeVolume``` call back and update the comments.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services