Skip to content

Commit

Permalink
Implement functionality for checkBefore
Browse files Browse the repository at this point in the history
  • Loading branch information
rtjd6554 committed Feb 20, 2025
1 parent 695bda6 commit 2f2b034
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ public void fixPartitionUpdateTime(Instant now) {

@Override
public void addFilesTransaction(AddTransactionRequest request) {
request.getTransaction().checkBefore(this);
fileReferenceStore.addFilesTransaction(request);
}

@Override
public void addPartitionsTransaction(AddTransactionRequest request) {
request.getTransaction().checkBefore(this);
partitionStore.addPartitionsTransaction(request);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public void apply(StateStorePartitions stateStorePartitions, Instant updateTime)

@Override
public void checkBefore(StateStore stateStore) throws StateStoreException {
if (!stateStore.hasNoFiles()) {
throw new StateStoreException("Cannot initialise state store when files are present");
}
}

@Override
Expand Down

0 comments on commit 2f2b034

Please sign in to comment.