belliottsmith commented on code in PR #168:
URL: https://github.com/apache/cassandra-accord/pull/168#discussion_r1954106483
##########
accord-core/src/main/java/accord/coordinate/CoordinationAdapter.java:
##########
@@ -133,16 +136,33 @@ public static CoordinationAdapter<Result>
recoverExclusiveSyncPoint()
return RecoverExclusiveSyncPointAdapter.INSTANCE;
}
- public static abstract class AbstractTxnAdapter implements
CoordinationAdapter<Result>
+ public static class TxnAdapter implements CoordinationAdapter<Result>
{
+ static final TxnAdapter STANDARD = new TxnAdapter(Minimal);
+ static final TxnAdapter RECOVERY = new TxnAdapter(Maximal);
+
+ final Apply.Kind applyKind;
+ public TxnAdapter(Apply.Kind applyKind)
+ {
+ this.applyKind = applyKind;
+ }
+
@Override
public void propose(Node node, @Nullable Topologies
preacceptOrRecovery, FullRoute<?> route, Accept.Kind kind, Ballot ballot, TxnId
txnId, Txn txn, Timestamp executeAt, Deps deps, BiConsumer<? super Result,
Throwable> callback)
{
Topologies accept =
node.topology().reselect(preacceptOrRecovery,
QuorumEpochIntersections.preacceptOrRecover,
- route, txnId,
executeAt, QuorumEpochIntersections.accept);
+ route, txnId,
executeAt, SHARE, QuorumEpochIntersections.accept);
new ProposeTxn(node, accept, route, kind, ballot, txnId, txn,
executeAt, deps, callback).start();
}
+ @Override
+ public void proposeOnly(Node node, Route<?> require, Route<?>
sendTo, SelectNodeOwnership selectNodeOwnership, FullRoute<?> route,
Accept.Kind kind, Ballot ballot, TxnId txnId, Txn txn, Timestamp executeAt,
Deps deps, BiConsumer<? super Deps, Throwable> callback)
+ {
+ Topologies accept = node.topology().reselect(null,
QuorumEpochIntersections.preacceptOrRecover,
+ sendTo, txnId,
executeAt, selectNodeOwnership, QuorumEpochIntersections.accept);
+ new ProposeOnly(node, accept, sendTo, route, kind, ballot,
txnId, txn, executeAt, deps, callback).start();
Review Comment:
Normally I introduce such a static method, but in this case we only invoke
from an accessor class which basically serves that static method functionality.
But, I can add the extra hop if you like, pretty neutral on it.
--
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]