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 2019/07/25 18:20:14 UTC

[GitHub] [accumulo] hkeebler commented on issue #1043: Support stable ~del split points and avoid ~del hotspots

hkeebler commented on issue #1043: Support stable ~del split points and avoid ~del hotspots 
URL: https://github.com/apache/accumulo/issues/1043#issuecomment-515158439
 
 
   I was reviewing what I think is the related code set for this ticket.  I believe its GC that actually does the deletion of the Metadata tablet file entries and files.  To address your concern about the sorting difference it looks as though the SGC expects the dir to be first in the sort but previous to this the prefix is removed and data resorted so I don't think its an issue.  The only other side effect is that if memory is low before all the deletion candidates can be retrieved then the directory may not be in that set but who cares.  Everything will still work. 
   
   The hash would need to be a known size or delimited from the <path>.
   
   In GarbageCollectinAlgorithm the following piece of code was intriguing, for lack of a better word.  I haven't had a chance to really go through and understand it's necessity but holy moly!  There may be a very good reason for all it does.
   ```
    private String makeRelative(String path, int expectedLen) {
       String relPath = path;
   
       if (relPath.startsWith("../"))
         relPath = relPath.substring(3);
   
       while (relPath.endsWith("/"))
         relPath = relPath.substring(0, relPath.length() - 1);
   
       while (relPath.startsWith("/"))
         relPath = relPath.substring(1);
   
       String[] tokens = relPath.split("/");
   
       // handle paths like a//b///c
       boolean containsEmpty = false;
       for (String token : tokens) {
         if (token.equals("")) {
           containsEmpty = true;
           break;
         }
       }
   
       if (containsEmpty) {
         ArrayList<String> tmp = new ArrayList<>();
         for (String token : tokens) {
           if (!token.equals("")) {
             tmp.add(token);
           }
         }
   
         tokens = tmp.toArray(new String[tmp.size()]);
       }
   
       if (tokens.length > 3 && path.contains(":")) {
         if (tokens[tokens.length - 4].equals(ServerConstants.TABLE_DIR)
             && (expectedLen == 0 || expectedLen == 3)) {
           relPath = tokens[tokens.length - 3] + "/" + tokens[tokens.length - 2] + "/"
               + tokens[tokens.length - 1];
         } else if (tokens[tokens.length - 3].equals(ServerConstants.TABLE_DIR)
             && (expectedLen == 0 || expectedLen == 2)) {
           relPath = tokens[tokens.length - 2] + "/" + tokens[tokens.length - 1];
         } else {
           throw new IllegalArgumentException(path);
         }
       } else if (tokens.length == 3 && (expectedLen == 0 || expectedLen == 3)
           && !path.contains(":")) {
         relPath = tokens[0] + "/" + tokens[1] + "/" + tokens[2];
       } else if (tokens.length == 2 && (expectedLen == 0 || expectedLen == 2)
           && !path.contains(":")) {
         relPath = tokens[0] + "/" + tokens[1];
       } else {
         throw new IllegalArgumentException(path);
       }
   
       return relPath;
     }
   ```

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