Github user elilevine commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/37#discussion_r24844090
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java ---
@@ -488,7 +490,55 @@ public void rollback(PhoenixConnection connection)
throws SQLException {
numRows = 0;
}
+ private Set<Integer> getOrderOfUncommittedStatements() {
+ Set<Integer> result = newHashSet();
+ for (Map<ImmutableBytesPtr, RowMutationState> rowMutations :
mutations.values()) {
+ for (RowMutationState rowMutationState :
rowMutations.values()) {
+
result.addAll(rowMutationState.getOrderOfStatementsInConnection());
+ }
+ }
+ return result;
+ }
+
@Override
public void close() throws SQLException {
}
+
+ public static class RowMutationState {
+ private Map<PColumn,byte[]> columnValues;
+ private Set<Integer> orderOfStatementsInConnection;
--- End diff --
Hmm. I guess I'm not too concerned about memory here, since the size of
this set is going to be proportional to the number of executed statements on a
connection, which is going to be thousands at the high end for realistic use
cases IMHO.
---
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.
---