Skip to content

Commit

Permalink
New method for Loading transaction or pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
rtjd6554 committed Jan 10, 2025
1 parent c7eef11 commit 67fce2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ public Optional<StateStoreTransaction<?>> getTransaction() {
return Optional.ofNullable(transaction);
}

public StateStoreTransaction<?> getTransactionOrLoadFromPointer(TransactionBodyStore bodyStore) {
if (transaction != null) {
return transaction;
} else {
return bodyStore.getBody(bodyPointer);
}
}

@Override
public int hashCode() {
return Objects.hash(transactionNumber, transaction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private void applyTransaction(TransactionLogEntry entry) {
entry.getTransactionType());
return;
}
transactionType.cast(entry.getTransaction().orElseThrow())
transactionType.cast(entry.getTransactionOrLoadFromPointer(bodyStore))
.apply(state, entry.getUpdateTime());
lastTransactionNumber = entry.getTransactionNumber();
}
Expand Down

0 comments on commit 67fce2f

Please sign in to comment.