Repository: phoenix Updated Branches: refs/heads/txn f90ee1a5c -> 893ba09b7
Force tephra to ignore deletes from UngroupedAggregateRegionObserver Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/893ba09b Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/893ba09b Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/893ba09b Branch: refs/heads/txn Commit: 893ba09b7b762f5d169f3a06623a52f9625d4b6d Parents: f90ee1a Author: Thomas <[email protected]> Authored: Mon May 4 17:14:02 2015 -0700 Committer: Thomas <[email protected]> Committed: Mon May 4 17:14:02 2015 -0700 ---------------------------------------------------------------------- .../it/java/org/apache/phoenix/transactions/TransactionIT.java | 1 + .../phoenix/coprocessor/UngroupedAggregateRegionObserver.java | 6 ++++++ .../main/java/org/apache/phoenix/index/IndexMaintainer.java | 2 +- .../src/main/java/org/apache/phoenix/schema/PTableImpl.java | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/893ba09b/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java index 78b7875..a5b80bb 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java @@ -254,6 +254,7 @@ public class TransactionIT extends BaseHBaseManagedTimeIT { } finally { conn1.close(); + conn2.close(); } } http://git-wip-us.apache.org/repos/asf/phoenix/blob/893ba09b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java index 72a0a64..05d018c 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java @@ -95,6 +95,8 @@ import org.apache.phoenix.util.TimeKeeper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import co.cask.tephra.TxConstants; + import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -291,6 +293,8 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver{ Delete delete = new Delete(firstKV.getRowArray(), firstKV.getRowOffset(), firstKV.getRowLength(),ts); mutations.add(delete); + // force tephra to ignore this deletes + delete.setAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY, new byte[0]); } else if (isUpsert) { Arrays.fill(values, null); int i = 0; @@ -350,6 +354,8 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver{ results.get(0).getRowOffset(), results.get(0).getRowLength()); delete.deleteColumns(deleteCF, deleteCQ, ts); + // force tephra to ignore this deletes + delete.setAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY, new byte[0]); mutations.add(delete); } } http://git-wip-us.apache.org/repos/asf/phoenix/blob/893ba09b/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java b/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java index dbfca7b..b6df8a5 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java @@ -760,7 +760,7 @@ public class IndexMaintainer implements Writable, Iterable<ColumnReference> { // add the keyvalue for the empty row put.add(kvBuilder.buildPut(new ImmutableBytesPtr(indexRowKey), this.getEmptyKeyValueFamily(), QueryConstants.EMPTY_COLUMN_BYTES_PTR, ts, - // set the vakue to the empty column name + // set the value to the empty column name QueryConstants.EMPTY_COLUMN_BYTES_PTR)); put.setDurability(!indexWALDisabled ? Durability.USE_DEFAULT : Durability.SKIP_WAL); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/893ba09b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java index 4f2c796..2971eff 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java @@ -654,7 +654,7 @@ public class PTableImpl implements PTable { addQuietly(setValues, kvBuilder, kvBuilder.buildPut(keyPtr, SchemaUtil.getEmptyColumnFamilyPtr(PTableImpl.this), QueryConstants.EMPTY_COLUMN_BYTES_PTR, ts, - // set the vakue to the empty column name + // set the value to the empty column name QueryConstants.EMPTY_COLUMN_BYTES_PTR)); mutations.add(setValues); if (!unsetValues.isEmpty()) {
