lowka commented on code in PR #3335:
URL: https://github.com/apache/ignite-3/pull/3335#discussion_r1516042840
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/DestinationFactory.java:
##########
@@ -91,21 +91,26 @@ Destination<RowT> createDestination(IgniteDistribution
distribution, ColocationG
assert !nullOrEmpty(group.assignments()) && !nullOrEmpty(keys);
- List<String> assignments =
Commons.transform(group.assignments(), NodeWithConsistencyToken::name);
-
if (function.affinity()) {
int tableId = ((AffinityDistribution) function).tableId();
Supplier<PartitionCalculator> calculator =
dependencies.partitionCalculator(tableId);
TableDescriptor tableDescriptor =
dependencies.tableDescriptor(tableId);
var resolver = new
TablePartitionExtractor<>(calculator.get(), keys.toIntArray(), tableDescriptor,
rowHandler);
- return new Partitioned<>(assignments, resolver);
+ return new Partitioned<>(group.assignments(), resolver);
}
var resolver = new
RehashingPartitionExtractor<>(group.nodeNames().size(), keys.toIntArray(),
rowHandler);
- return new Partitioned<>(group.nodeNames(), resolver);
+ Int2ObjectMap<NodeWithConsistencyToken> assignments = new
Int2ObjectOpenHashMap<>();
+ int pos = 0;
+
+ for (String name : group.nodeNames()) {
+ assignments.put(pos++, new NodeWithConsistencyToken(name,
0));
Review Comment:
How can zero or any arbitrary value, created from thin air, can be a valid
for a `enlistmentConsistencyToken`?
Original values for `enlistmentConsistencyToken` are obtained from
`primaryReplica.getStartTime()`
(See `SqlQueryProcessor::primaryReplicas(IgniteTable)` ).
Maybe I am missing something but this is far from obvious.
--
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]