Skip to content

Commit 27eef1c

Browse files
committed
Modify FateStore to introduce a Seeder API
This adds a new Seeder API that can be used to seed transactions with a FateKey. The purpose of this new API is to allow for eventual batching of multiple seeding attempts together into one conditional mutation to improve performance. This change just updates the api and all calls to the seeder to attempt seeding will be performed individually. A future update will support the new functionality of batching and commiting all the changes together when the Seeder is closed. This change is for Part 1 of apache#5160
1 parent 75e3a00 commit 27eef1c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

core/src/main/java/org/apache/accumulo/core/fate/FateStore.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ public interface FateStore<T> extends ReadOnlyFateStore<T> {
5454
interface Seeder<T> extends AutoCloseable {
5555

5656
/**
57-
* Seeds a transaction with the given repo if it does not exist. A fateId will be derived from
58-
* the fateKey. If seeded, sets the following data for the fateId in the store.
57+
* Attempts to seed a transaction with the given repo if it does not exist. A fateId will be
58+
* derived from the fateKey. If seeded, sets the following data for the fateId in the store.
59+
*
60+
* TODO: Support completing futures later in close method The current version will always return
61+
* with a CompleteableFuture that is already completed. Future version will process will
62+
* complete in the close() method for the User store.
5963
*
6064
* <ul>
6165
* <li>Set the fate op</li>
@@ -70,13 +74,12 @@ interface Seeder<T> extends AutoCloseable {
7074
* and empty optional otherwise. If there was a failure this could return an empty
7175
* optional when it actually succeeded.
7276
*/
73-
// For UserFateStore this would create a conditional mutation and add it to the conditional
74-
// writer
7577
CompletableFuture<Optional<FateId>> attemptToSeedTransaction(Fate.FateOperation fateOp,
7678
FateKey fateKey, Repo<T> repo, boolean autoCleanUp);
7779

78-
// This would check the status of all added conditional mutations, retry unknown, and then close
79-
// the conditional writer.
80+
// TODO: Right now all implementations do nothing
81+
// Eventually this would check the status of all added conditional mutations,
82+
// retry unknown, and then close the conditional writer.
8083
void close();
8184
}
8285

0 commit comments

Comments
 (0)