Skip to content

Commit

Permalink
Default method for new check of state before
Browse files Browse the repository at this point in the history
  • Loading branch information
rtjd6554 committed Feb 20, 2025
1 parent 1ee06a0 commit 5de500d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package sleeper.core.statestore.transactionlog.transaction;

import sleeper.core.statestore.StateStore;
import sleeper.core.statestore.StateStoreException;

import java.time.Instant;
Expand All @@ -41,4 +42,12 @@ public interface StateStoreTransaction<T> {
* @param updateTime the time that the update was added to the state store
*/
void apply(T state, Instant updateTime);

/**
* Checks the present state of the state store.
*
* @param stateStore the state store
*/
default void checkBefore(StateStore stateStore) throws StateStoreException {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import sleeper.core.partition.Partition;
import sleeper.core.partition.PartitionsFromSplitPoints;
import sleeper.core.schema.Schema;
import sleeper.core.statestore.StateStore;
import sleeper.core.statestore.StateStoreException;
import sleeper.core.statestore.transactionlog.state.StateStorePartitions;
import sleeper.core.statestore.transactionlog.transaction.PartitionTransaction;

Expand Down Expand Up @@ -79,4 +81,9 @@ public boolean equals(Object obj) {
public String toString() {
return "InitialisePartitionsTransaction{partitions=" + partitions + "}";
}

@Override
public void checkBefore(StateStore stateStore) throws StateStoreException {
}

}

0 comments on commit 5de500d

Please sign in to comment.