Skip to content

Commit

Permalink
Pass transaction type when loading transaction from body store
Browse files Browse the repository at this point in the history
  • Loading branch information
patchwork01 committed Jan 10, 2025
1 parent 33866b3 commit 120ad26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package sleeper.core.statestore.transactionlog;

import sleeper.core.statestore.transactionlog.transactions.TransactionType;

/**
* A store of the bodies of transactions that will be referenced in a transaction log. Used by
* {@link TransactionLogStateStore} for transactions that are too large to be held directly in
Expand All @@ -36,5 +38,5 @@ public interface TransactionBodyStore {
* @param pointer a pointer to the location
* @return the transaction
*/
<T extends StateStoreTransaction<?>> T getBody(TransactionBodyPointer pointer);
<T extends StateStoreTransaction<?>> T getBody(TransactionBodyPointer pointer, TransactionType transactionType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public StateStoreTransaction<?> getTransactionOrLoadFromPointer(TransactionBodyS
if (transaction != null) {
return transaction;
} else {
return bodyStore.getBody(bodyPointer);
return bodyStore.getBody(bodyPointer, transactionType);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package sleeper.core.statestore.transactionlog;

import sleeper.core.statestore.transactionlog.transactions.TransactionType;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
Expand All @@ -32,7 +34,7 @@ public void store(TransactionBodyPointer pointer, StateStoreTransaction<?> trans
}

@Override
public <T extends StateStoreTransaction<?>> T getBody(TransactionBodyPointer pointer) {
public <T extends StateStoreTransaction<?>> T getBody(TransactionBodyPointer pointer, TransactionType transactionType) {
return (T) Objects.requireNonNull(transactionByPointer.get(pointer));
}

Expand Down

0 comments on commit 120ad26

Please sign in to comment.