phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JamesRTaylor <...@git.apache.org>
Subject [GitHub] phoenix pull request: Surface partial saves in CommitExcepiton (PH...
Date Wed, 18 Feb 2015 01:59:48 GMT
Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/37#discussion_r24874135
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java ---
    @@ -488,7 +488,62 @@ public void rollback(PhoenixConnection connection) throws SQLException
{
             numRows = 0;
         }
         
    +    private Set<Integer> getUncommittedSattementIndexes() {
    +    	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 --
    
    Rename for consistency with CommitException to statementIndexes here and getter method.
I still think a Set is overkill. Can't it just be an int[] of size 1? Then the join can resize
it (in the somewhat unlikely event of a collision).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message