dcapwell commented on code in PR #50:
URL: https://github.com/apache/cassandra-accord/pull/50#discussion_r1284888611
##########
accord-core/src/main/java/accord/local/CommandStores.java:
##########
@@ -474,40 +474,42 @@ public <O> void mapReduceConsume(PreLoadContext context,
IntStream commandStore
public <O> AsyncChain<O> mapReduce(PreLoadContext context, Routables<?>
keys, long minEpoch, long maxEpoch, MapReduce<? super SafeCommandStore, O>
mapReduce)
{
- AsyncChain<O> chain = null;
BiFunction<O, O, O> reducer = mapReduce::reduce;
Snapshot snapshot = current;
ShardHolder[] shards = snapshot.shards;
+ List<AsyncChain<? extends O>> chains = null;
Review Comment:
> abstract O complete(I[] results);
I thought about that, but went with not doing that as that is reinventing
`map`... so can delete all 3 classes in favor of reusing the existing `.map`
logic (and centralize the exception handling).
> This also maintains the benefit of not encapsulating when there's only one
async operation - which we expect to be the norm.
Yes, in the case where there is a single chain this is slightly more memory
than before. In this case the memory is short lived and stack local (so should
be relatively cheap).
--
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]