You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2023/01/16 12:46:37 UTC

[GitHub] [cassandra] iamaleksey commented on a diff in pull request #2076: (Accord) TxnId should be more succinct, and permit encoding of flags for dependencies

iamaleksey commented on code in PR #2076:
URL: https://github.com/apache/cassandra/pull/2076#discussion_r1071189410


##########
src/java/org/apache/cassandra/service/accord/AccordPartialCommand.java:
##########
@@ -97,7 +95,7 @@ public Status status()
 
     public Txn.Kind kind()

Review Comment:
   Method can be dropped now.



##########
test/unit/org/apache/cassandra/service/accord/AccordTestUtils.java:
##########
@@ -90,19 +91,19 @@ public static Id localNodeId()
         @Override public void waiting(TxnId blockedBy, Known blockedUntil, Unseekables<?, ?> blockedOn) {}
     };
 
-    public static TxnId txnId(long epoch, long real, int logical, long node)
+    public static TxnId txnId(long epoch, long real, long node)

Review Comment:
   real -> hlc? Here and in three methods below.



##########
src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:
##########
@@ -119,7 +114,6 @@ public int serializedSize()
         {
             return TypeSizes.LONG_SIZE +  // ts.epoch
                    TypeSizes.LONG_SIZE +  // ts.real

Review Comment:
   Should update the comments to ts.msb, ts.lsb.



##########
src/java/org/apache/cassandra/service/accord/AccordCommandsForKey.java:
##########
@@ -168,7 +168,7 @@ public Stream<T> before(Timestamp timestamp, TestKind testKind, TestDep testDep,
         public Stream<T> after(Timestamp timestamp, TestKind testKind, TestDep testDep, @Nullable TxnId depId, TestStatus testStatus, @Nullable Status status)
         {
             return idsToCommands(map.getView().tailMap(timestamp, false).values())
-                   .filter(cmd -> testKind == RorWs || cmd.kind() == WRITE)
+                   .filter(cmd -> testKind == RorWs || cmd.txnId().rw() == Write)

Review Comment:
   `txnId().isWrite()` to simplify?



##########
src/java/org/apache/cassandra/service/accord/AccordCommandsForKey.java:
##########
@@ -158,7 +158,7 @@ public boolean isEmpty()
         public Stream<T> before(Timestamp timestamp, TestKind testKind, TestDep testDep, @Nullable TxnId depId, TestStatus testStatus, @Nullable Status status)
         {
             return idsToCommands(map.getView().headMap(timestamp, false).values())
-                   .filter(cmd -> testKind == RorWs || cmd.kind() == WRITE)
+                   .filter(cmd -> testKind == RorWs || cmd.txnId().rw() == Write)

Review Comment:
   `txnId().isWrite()` to simplify?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org