This is an automated email from the ASF dual-hosted git repository. ifesdjeen pushed a commit to branch CASSANDRA-19944-persistent-fields in repository https://gitbox.apache.org/repos/asf/cassandra-accord.git
commit c8603983ec450fd501be919106e12ca181cf7dac Author: Alex Petrov <[email protected]> AuthorDate: Fri Sep 27 08:55:03 2024 +0200 Overwrite reject before on every op --- accord-core/src/main/java/accord/local/CommandStore.java | 11 +++-------- accord-core/src/main/java/accord/local/SafeCommandStore.java | 5 +++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/accord-core/src/main/java/accord/local/CommandStore.java b/accord-core/src/main/java/accord/local/CommandStore.java index f107eac3..3f450c26 100644 --- a/accord-core/src/main/java/accord/local/CommandStore.java +++ b/accord-core/src/main/java/accord/local/CommandStore.java @@ -281,13 +281,6 @@ public abstract class CommandStore implements AgentExecutor redundantBefore = newRedundantBefore; } - protected void upsertRejectBefore(TxnId txnId, Ranges ranges) - { - ReducingRangeMap<Timestamp> newRejectBefore = rejectBefore != null ? rejectBefore : new ReducingRangeMap<>(); - newRejectBefore = ReducingRangeMap.add(newRejectBefore, ranges, txnId, Timestamp::max); - unsafeSetRejectBefore(newRejectBefore); - } - /** * This method may be invoked on a non-CommandStore thread */ @@ -330,7 +323,9 @@ public abstract class CommandStore implements AgentExecutor { // TODO (desired): narrow ranges to those that are owned Invariants.checkArgument(txnId.kind() == ExclusiveSyncPoint); - safeStore.upsertRejectBefore(txnId, ranges); + ReducingRangeMap<Timestamp> newRejectBefore = rejectBefore != null ? rejectBefore : new ReducingRangeMap<>(); + newRejectBefore = ReducingRangeMap.add(newRejectBefore, ranges, txnId, Timestamp::max); + safeStore.setRejectBefore(newRejectBefore); } public final void markExclusiveSyncPointLocallyApplied(SafeCommandStore safeStore, TxnId txnId, Ranges ranges) diff --git a/accord-core/src/main/java/accord/local/SafeCommandStore.java b/accord-core/src/main/java/accord/local/SafeCommandStore.java index 58bf15f2..3178aaa9 100644 --- a/accord-core/src/main/java/accord/local/SafeCommandStore.java +++ b/accord-core/src/main/java/accord/local/SafeCommandStore.java @@ -44,6 +44,7 @@ import accord.primitives.Txn.Kind.Kinds; import accord.primitives.TxnId; import accord.primitives.Unseekables; import accord.utils.Invariants; +import accord.utils.ReducingRangeMap; import static accord.local.Cleanup.NO; import static accord.local.KeyHistory.COMMANDS; @@ -274,9 +275,9 @@ public abstract class SafeCommandStore commandStore().unsafeSetRangesForEpoch(rangesForEpoch); } - public void upsertRejectBefore(TxnId txnId, Ranges ranges) + public void setRejectBefore(ReducingRangeMap<Timestamp> next) { - commandStore().upsertRejectBefore(txnId, ranges); + commandStore().unsafeSetRejectBefore(next); } public void updateCommandsForKey(Command prev, Command next) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
