belliottsmith commented on code in PR #106:
URL: https://github.com/apache/cassandra-accord/pull/106#discussion_r1692252174
##########
accord-core/src/main/java/accord/local/CommandsForKey.java:
##########
@@ -111,32 +111,42 @@
* this replica's collection to decipher any fast path decision. Any other
replica must either do the same, or else
* will correctly record this transaction as present in any relevant deps of
later transactions.
*
- * TODO (expected): optimisations:
- * 3) consider storing a prefix of TxnId that are all NoInfo PreApplied
encoded as a BitStream as only required for computing missing collection
- * 4) consider storing (or caching) an int[] of records with an executeAt
that occurs out of order, sorted by executeAt
- *
* TODO (expected): maintain separate redundantBefore and closedBefore
timestamps, latter implied by any exclusivesyncpoint;
* advance former based on Applied status of all TxnId before
the latter
* TODO (expected): track whether a TxnId is a write on this key only for
execution (rather than globally)
* TODO (expected): merge with TimestampsForKey
- * TODO (expected): save bytes by encoding InternalStatus in TxnId.flags()
- * TODO (expected): migrate to BTree
+ * TODO (desired): save bytes by encoding InternalStatus in TxnId.flags()
* TODO (expected): remove a command that is committed to not intersect with
the key for this store (i.e. if accepted in a later epoch than committed on, so
ownership changes)
* TODO (expected): mark a command as notified once ready-to-execute or
applying
- * TODO (required): randomised testing
+ * TODO (required): more randomised testing
* TODO (required): linearizability violation detection
- * TODO (required): account for whether transactions should witness each other
for determining the missing collection
- * TODO (required): enforce that a transaction is not added with a key
dependency on a SyncPoint or ExclusiveSyncPoint;
- * also impose this invariant elsewhere, and create a
compile-time dependency between these code locations
*/
-public class CommandsForKey implements CommandsSummary
+public class CommandsForKey extends CommandsForKeyUpdate implements
CommandsSummary
{
- private static final boolean PRUNE_TRANSITIVE_DEPENDENCIES = true;
+ private static final Logger logger =
LoggerFactory.getLogger(CommandsForKey.class);
+ private static final boolean ELIDE_TRANSITIVE_DEPENDENCIES = true;
+
public static final RedundantBefore.Entry NO_REDUNDANT_BEFORE = new
RedundantBefore.Entry(null, Long.MIN_VALUE, Long.MAX_VALUE, TxnId.NONE,
TxnId.NONE, TxnId.NONE, null);
public static final TxnId[] NO_TXNIDS = new TxnId[0];
+ public static final TxnInfo NO_INFO = new TxnInfo(TxnId.NONE, HISTORICAL,
TxnId.NONE);
public static final TxnInfo[] NO_INFOS = new TxnInfo[0];
public static final Unmanaged[] NO_PENDING_UNMANAGED = new Unmanaged[0];
+ public static boolean manages(TxnId txnId)
+ {
+ return txnId.domain().isKey() && txnId.kind().isGloballyVisible();
+ }
+
+ public static boolean managesExecution(TxnId txnId)
Review Comment:
No, but perhaps needs renaming. This just a method that knows it's testing a
key, so can avoid performing the key test.
--
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]