belliottsmith commented on code in PR #87:
URL: https://github.com/apache/cassandra-accord/pull/87#discussion_r1598312752


##########
accord-core/src/main/java/accord/impl/InMemoryCommandStore.java:
##########
@@ -388,20 +395,32 @@ private void loadCommandsForKey(RoutableKey key,
         timestampsForKey.put(key, timestampsForKey((Key) 
key).createSafeReference());
     }
 
+    protected void validateRead(Command current) {}
+
     protected final InMemorySafeStore createSafeStore(PreLoadContext context, 
RangesForEpoch ranges)
     {
         Map<TxnId, InMemorySafeCommand> commands = new HashMap<>();
         Map<RoutableKey, InMemorySafeCommandsForKey> commandsForKey = new 
HashMap<>();
         Map<RoutableKey, InMemorySafeTimestampsForKey> timestampsForKey = new 
HashMap<>();
 
         context.forEachId(txnId -> commands.put(txnId, lazyReference(txnId)));
+        for (InMemorySafeCommand safe : commands.values())
+        {
+            GlobalCommand global = safe.unsafeGlobal();
+            if (global == null) continue;
+            Command current = global.value();
+            if (current == null) continue;
+            validateRead(current);
+        }
 
         for (Seekable seekable : context.keys())
         {
             switch (seekable.domain())
             {
                 case Key:
                     RoutableKey key = (RoutableKey) seekable;
+                    if (context.keyHistory() == KeyHistory.NONE)

Review Comment:
   Currently in C* we only load _either_ timestamps _or_ commands. So we should 
apply the same logic here too.



-- 
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