Github user elilevine commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/37#discussion_r24923602
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java ---
@@ -78,7 +87,11 @@
private PhoenixConnection connection;
private final long maxSize;
private final ImmutableBytesPtr tempPtr = new ImmutableBytesPtr();
- private final Map<TableRef,
Map<ImmutableBytesPtr,Map<PColumn,byte[]>>> mutations =
Maps.newHashMapWithExpectedSize(3); // TODO: Sizing?
+ /**
+ * Use {@link TreeMap} for {@link #mutations} below to enforce a
deterministic ordering for easier testing of partial failures.
+ * @see PartialCommitIT
+ */
+ private final Map<TableRef, Map<ImmutableBytesPtr,RowMutationState>>
mutations = Maps.newTreeMap(new TableRefComparator());
--- End diff --
They are being sorted here to allow for consistent partial commit
verification in tests. Without a predictable sorting here it is impossible to
write robust tests for partial commits.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---