aweisberg commented on code in PR #3694:
URL: https://github.com/apache/cassandra/pull/3694#discussion_r1854092724


##########
src/java/org/apache/cassandra/service/accord/txn/TxnRangeRead.java:
##########
@@ -161,44 +174,54 @@ public AsyncChain<Data> read(Seekable range, 
SafeCommandStore commandStore, Time
         return AsyncChains.reduce(results, Data::merge);
     }
 
-    private AsyncChain<Data> performLocalRead(PartitionRangeReadCommand 
command, Range r, int nowInSeconds)
+    public PartitionRangeReadCommand commandForSubrange(Range r, long 
nowInSeconds)
+    {
+        return commandForSubrange((PartitionRangeReadCommand) get(), r, 
nowInSeconds);
+    }
+
+    public PartitionRangeReadCommand 
commandForSubrange(PartitionRangeReadCommand command, Range r, long 
nowInSeconds)
+    {
+        AbstractBounds<PartitionPosition> bounds = 
command.dataRange().keyRange();
+        PartitionPosition startPP = bounds.left;
+        PartitionPosition endPP = bounds.right;
+        TokenKey startTokenKey = new TokenKey(command.metadata().id, 
startPP.getToken());
+        Token subRangeStartToken = 
((AccordRoutingKey)r.start()).asTokenKey().token();
+        Token subRangeEndToken = 
((AccordRoutingKey)r.end()).asTokenKey().token();

Review Comment:
   Actually can't use `MinTokenKey` on the right since we don't have the the 
max token. At least sort of we don't, it was added and used for 
`AccordRoutingKey.SentinelKey.toTokenKeyBroken` but I am not sure if that is 
something that should really be used.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to