keith-turner commented on issue #5160:
URL: https://github.com/apache/accumulo/issues/5160#issuecomment-2614050772

   Looked into how this could be done and came up with one possible way that 
seems like it could break into two PRs.  First could modify FateStore to remove 
the following method.
   
   ```java
     Optional<FateId> seedTransaction(Fate.FateOperation txName, FateKey 
fateKey, Repo<T> repo,
         boolean autoCleanUp);
   ```
   
   and replace it with the following
   
   ```java
     interface Seeder<T> extends AutoCloseable {
       // For UserFateStore this would create a conditional mutation and add it 
to the conditional writer
       void attemptToSeedTransaction(Fate.FateOperation txName, FateKey 
fateKey, Repo<T> repo,
                       boolean autoCleanUp);
       // This would check the status of all added conditional mutations, retry 
unknown, and then close the conditional writer.
       void close();
     }
   
     // Creates a conditional writer for the user fate store.  For Zookeeper 
all this code will probably do the same thing its currently doing as zookeeper 
does not support multi-node operations.
     public Seeder<T> beginSeeding();
   ```
   
   
   The current code in the manager could be left as is to be changed in a 
second PR.  The way that code is structured it only knows about a single thing 
to seed at a time, so it would go through the three step process with a single 
thing and have the same behavior until the second PR is done.
   
   In a second PR the manager code could be modified from adding single task to 
a thread pool to instead add task to a queue and have a single background 
thread that takes batches of task of the thread pool and uses the new fate 
store API to write them all at once. There are a few different way this could 
be done. Would be nice to preserve the current behavior of not concurrently 
seeding the same thing in order to avoid unnecessary work.


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