You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ArbaazKhan1 (via GitHub)" <gi...@apache.org> on 2026/07/09 15:38:50 UTC

[PR] New Presplit utility for Fate table [accumulo]

ArbaazKhan1 opened a new pull request, #6471:
URL: https://github.com/apache/accumulo/pull/6471

   closes [issue #4979 ](https://github.com/apache/accumulo/issues/4979)
   
   Added support for pre-splitting Fate tables via accumulo admin command. 
   
   -  `--numSplits` option generates split points using the same partitioning logic as in `FateManager.getDesiredPartitions`. The logic ensures that  pre-split boundires align with how the manger expects transaction IDs to be distributed. The split utility produces raw UUID row strings which should allow it be also be used by scan_ref.
   
   -  `--splitsFile` flag writes the generated splits to a file. 


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] New Presplit utility for Fate table [accumulo]

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #6471:
URL: https://github.com/apache/accumulo/pull/6471#discussion_r3614393929


##########
server/base/src/main/java/org/apache/accumulo/server/util/adminCommand/Fate.java:
##########
@@ -267,6 +287,39 @@ public void execute(JCommander cl, FateOpts options) throws Exception {
     }
   }
 
+  private void preSplitFateTable(FateOpts options) throws Exception {

Review Comment:
   ```suggestion
     private void generateFateTableSplits(FateOpts options) throws Exception {
   ```
   
   Suggest changing the name as this is generating the splits, not applying them to the table.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] New Presplit utility for Fate table [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #6471:
URL: https://github.com/apache/accumulo/pull/6471#discussion_r3574203594


##########
server/base/src/main/java/org/apache/accumulo/server/util/adminCommand/Fate.java:
##########
@@ -152,6 +160,14 @@ static class FateOpts extends ServerOpts {
     @Parameter(names = {"-i", "--info"},
         description = "Includes detailed transaction information when printing")
     boolean printDetails;
+
+    @Parameter(names = {"-n", "--numSplits"},
+        description = "Generate N split points for the fate table and print to stdout. N should always be greater than 1.")

Review Comment:
   ```suggestion
       @Parameter(names = {"-n", "--num-splits"},
           description = "Generate N split points for the fate table and print to stdout. N must be >= 1.")
   ```



##########
server/base/src/main/java/org/apache/accumulo/server/util/adminCommand/Fate.java:
##########
@@ -267,6 +287,38 @@ public void execute(JCommander cl, FateOpts options) throws Exception {
     }
   }
 
+  private void preSplitFateTable(FateOpts options) throws Exception {
+    List<String> splits = generateSplits(options.numSplits);
+
+    if (options.splitsFile != null) {
+      try (PrintWriter writer = new PrintWriter(new BufferedWriter(
+          new OutputStreamWriter(Files.newOutputStream(Path.of(options.splitsFile)), UTF_8)))) {

Review Comment:
   I usually try not to nest constructors in a try-with-resources block. Usually things work out okay but putting each object constructed on its own line makes it more certain that each object will be cleaned up properly in the try-with-resources block as opposed to relying on the closure of the outmost object to cascade down and close the rest. 



##########
server/base/src/main/java/org/apache/accumulo/server/util/adminCommand/Fate.java:
##########
@@ -152,6 +160,14 @@ static class FateOpts extends ServerOpts {
     @Parameter(names = {"-i", "--info"},
         description = "Includes detailed transaction information when printing")
     boolean printDetails;
+
+    @Parameter(names = {"-n", "--numSplits"},
+        description = "Generate N split points for the fate table and print to stdout. N should always be greater than 1.")
+    int numSplits = 1;

Review Comment:
   ```suggestion
       int numSplits = -1;
   ```
   I think we need to default to -1 here so that split generation is opt-in. If we leave it as `1`, every fate invocation takes the numSplits > 0 branch and returns before normal commands like `--print`, `--cancel`, etc. can run



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] New Presplit utility for Fate table [accumulo]

Posted by "ArbaazKhan1 (via GitHub)" <gi...@apache.org>.
ArbaazKhan1 commented on PR #6471:
URL: https://github.com/apache/accumulo/pull/6471#issuecomment-5208641112

   > Is it useful to have this utility focus exclusively on the Fate table? Would it be better to generalize it to generate splits for any table, or is this necessarily tied to the fate table for some reason?
   
   The split generation logic is tied to the Fate table. The algorithm is modeled after [getDesiredPartitions](https://github.com/apache/accumulo/blob/94363afcf443b54ba72b04618878d6b2c72355ab/server/manager/src/main/java/org/apache/accumulo/manager/fate/FateManager.java#L356-L360), to produce UUIDs whose string representations align with how Fate maps transaction Ids to tablet rows. I was trying to keep the work done scoped to just Fate since in original issue was asking to generate splits for the FATE table that evenly distribute FATE operations across tablets.
   
   However; I could look into creating a more general purpose split logic if that's more desirable. 


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org