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:
[email protected]


With regards,
Apache Git Services

Reply via email to