You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by if...@apache.org on 2024/08/27 10:17:53 UTC
(cassandra-accord) 01/01: Address Benedict's comments
This is an automated email from the ASF dual-hosted git repository.
ifesdjeen pushed a commit to branch CASSANDRA-19869
in repository https://gitbox.apache.org/repos/asf/cassandra-accord.git
commit f39fecd6d9d33844b9cb19db82690517a54184be
Author: Alex Petrov <ol...@gmail.com>
AuthorDate: Tue Aug 27 12:17:38 2024 +0200
Address Benedict's comments
---
accord-core/src/main/java/accord/local/PreLoadContext.java | 8 ++++----
accord-core/src/main/java/accord/local/Status.java | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/accord-core/src/main/java/accord/local/PreLoadContext.java b/accord-core/src/main/java/accord/local/PreLoadContext.java
index e12b19d7..a9cf6d40 100644
--- a/accord-core/src/main/java/accord/local/PreLoadContext.java
+++ b/accord-core/src/main/java/accord/local/PreLoadContext.java
@@ -141,17 +141,17 @@ public interface PreLoadContext
static PreLoadContext contextFor(TxnId primary, Collection<TxnId> additional, Seekables<?, ?> keys, KeyHistory keyHistory)
{
Invariants.checkState(!additional.contains(primary));
- return new Impl(primary, additional, keys, keyHistory);
+ return new SimplePreLoadContext(primary, additional, keys, keyHistory);
}
- static class Impl implements PreLoadContext
+ class SimplePreLoadContext implements PreLoadContext
{
private final TxnId primary;
private final Collection<TxnId> additional;
private final Seekables<?, ?> keys;
private final KeyHistory keyHistory;
- public Impl(TxnId primary, Collection<TxnId> additional, Seekables<?, ?> keys, KeyHistory keyHistory)
+ public SimplePreLoadContext(TxnId primary, Collection<TxnId> additional, Seekables<?, ?> keys, KeyHistory keyHistory)
{
this.primary = primary;
this.additional = additional;
@@ -161,7 +161,7 @@ public interface PreLoadContext
public String toString()
{
- return "Impl{" +
+ return "SimplePreLoadContext{" +
"primary=" + primary +
", additional=" + additional +
", keys=" + keys +
diff --git a/accord-core/src/main/java/accord/local/Status.java b/accord-core/src/main/java/accord/local/Status.java
index 5378a229..ccb5add4 100644
--- a/accord-core/src/main/java/accord/local/Status.java
+++ b/accord-core/src/main/java/accord/local/Status.java
@@ -882,7 +882,7 @@ public enum Status
public static Durability merge(Durability a, Durability b)
{
- int c = a == null ? -1 : a.compareTo(b);
+ int c = a.compareTo(b);
if (c < 0) { Durability tmp = a; a = b; b = tmp; }
// if we know we are applied, we can remove the OrInvalidated qualifier
if (a == UniversalOrInvalidated && (b == Majority || b == ShardUniversal || b == Local)) a = Universal;
@@ -894,7 +894,7 @@ public enum Status
public static Durability mergeAtLeast(Durability a, Durability b)
{
- int c = a == null ? -1 : a.compareTo(b);
+ int c = a.compareTo(b);
if (c < 0) { Durability tmp = a; a = b; b = tmp; }
if (a == UniversalOrInvalidated && (b == Majority || b == ShardUniversal || b == Local)) a = Universal;
return a;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org