Repository: phoenix Updated Branches: refs/heads/txn 35bcb3246 -> 5ff3fca2c
Add comment regarding immutable index maintainer Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5ff3fca2 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5ff3fca2 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5ff3fca2 Branch: refs/heads/txn Commit: 5ff3fca2c774123b6b033a49fc86fd05cbfe8934 Parents: 35bcb32 Author: James Taylor <[email protected]> Authored: Wed May 20 15:55:31 2015 -0700 Committer: James Taylor <[email protected]> Committed: Wed May 20 15:55:31 2015 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/phoenix/index/PhoenixIndexCodec.java | 4 ++++ .../org/apache/phoenix/index/PhoenixTransactionalIndexer.java | 4 ++++ 2 files changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/5ff3fca2/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexCodec.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexCodec.java b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexCodec.java index e78df56..14f8a1f 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexCodec.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexCodec.java @@ -86,6 +86,10 @@ public class PhoenixIndexCodec extends BaseIndexCodec { ptr.set(state.getCurrentRowKey()); List<IndexUpdate> indexUpdates = Lists.newArrayList(); for (IndexMaintainer maintainer : indexMaintainers) { + // Check both immutable and local, as for transactional tables, we use an index maintainer + // to aid in rollback if there's a KeyValue column in the index. The alternative would be + // to hold on to all uncommitted index row keys (even ones already sent to HBase) on the + // client side. if (maintainer.isImmutableRows() && maintainer.isLocalIndex()) { continue; } http://git-wip-us.apache.org/repos/asf/phoenix/blob/5ff3fca2/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java index dad93e3..39f885b 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java @@ -213,6 +213,10 @@ public class PhoenixTransactionalIndexer extends BaseRegionObserver { List<IndexMaintainer> indexMaintainers = indexMetaData.getIndexMaintainers(); Set<ColumnReference> mutableColumns = Sets.newHashSetWithExpectedSize(indexMaintainers.size() * 10); for (IndexMaintainer indexMaintainer : indexMaintainers) { + // Check both immutable and local, as for transactional tables, we use an index maintainer + // to aid in rollback if there's a KeyValue column in the index. The alternative would be + // to hold on to all uncommitted index row keys (even ones already sent to HBase) on the + // client side. if (!indexMaintainer.isImmutableRows() || !indexMaintainer.isLocalIndex()) { mutableColumns.addAll(indexMaintainer.getAllColumns()); }
