phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samarthjain <...@git.apache.org>
Subject [GitHub] phoenix pull request: PHOENIX-1674 Snapshot isolation transaction ...
Date Sat, 21 Nov 2015 01:44:03 GMT
Github user samarthjain commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/131#discussion_r45538874
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java ---
    @@ -301,28 +476,80 @@ public void remove() {
                 
             };
         }
    +
    +	private void generateMutations(final TableRef tableRef, long timestamp,
    +			final Map<ImmutableBytesPtr, RowMutationState> values,
    +			final List<Mutation> mutationList,
    +			final List<Mutation> mutationsPertainingToIndex) {
    +		final PTable table = tableRef.getTable();
    +        boolean tableWithRowTimestampCol = table.getRowTimestampColPos() != -1;
    +		Iterator<Map.Entry<ImmutableBytesPtr,RowMutationState>> iterator = values.entrySet().iterator();
    +		long timestampToUse = timestamp;
    +        while (iterator.hasNext()) {
    +        	Map.Entry<ImmutableBytesPtr, RowMutationState> rowEntry = iterator.next();
    +            ImmutableBytesPtr key = rowEntry.getKey();
    +            RowMutationState state = rowEntry.getValue();
    +            if (tableWithRowTimestampCol) {
    +                RowTimestampColInfo rowTsColInfo = state.getRowTimestampColInfo();
    +                if (rowTsColInfo.useServerTimestamp()) {
    +                    // regenerate the key with this timestamp.
    +                    key = getNewRowKeyWithRowTimestamp(key, timestampToUse, table);
    +                } else {
    +                    if (rowTsColInfo.getTimestamp() != null) {
    +                        timestampToUse = rowTsColInfo.getTimestamp();
    +                    }
    +                }
    +            }
    +			PRow row = tableRef.getTable().newRow(connection.getKeyValueBuilder(), timestampToUse,
key);
    --- End diff --
    
    Very minor: indentation seems a bit off here.


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