Github user elilevine commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/37#discussion_r24777348
  
    --- 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;
    +           
    +           public RowMutationState(@NotNull Map<PColumn,byte[]> 
columnValues, int orderOfStatementInConnection) {
    +                   Preconditions.checkNotNull(columnValues);
    +                   
    +                   this.columnValues = columnValues;
    +                   this.orderOfStatementsInConnection = 
Sets.newHashSet(orderOfStatementInConnection);
    +           }
    +           
    +           public RowMutationState(@NotNull Map<PColumn,byte[]> 
columnValues, @NotNull Set<Integer> orderOfStatementsInConnection) {
    +                   Preconditions.checkNotNull(columnValues);
    +                   
Preconditions.checkNotNull(orderOfStatementsInConnection);
    +                   
    +                   this.columnValues = columnValues;
    +                   this.orderOfStatementsInConnection = 
orderOfStatementsInConnection;
    +           }
    +           
    +           public Map<PColumn, byte[]> getColumnValues() {
    +                   return columnValues;
    --- End diff --
    
    Will fix formatting


---
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.
---

Reply via email to