[1/2] phoenix git commit: PHOENIX-2657 Transactionally deleted cells become visible after few hours

2016-02-12 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 421ad309b -> fd757a055


PHOENIX-2657 Transactionally deleted cells become visible after few hours


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9d3e8efc
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9d3e8efc
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9d3e8efc

Branch: refs/heads/4.x-HBase-1.0
Commit: 9d3e8efc5ee54bfdc114843308300d372a74ae00
Parents: 421ad30
Author: James Taylor 
Authored: Fri Feb 12 09:38:43 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:05:26 2016 -0800

--
 .../apache/phoenix/filter/SkipScanFilter.java   | 47 +---
 .../phoenix/index/PhoenixIndexBuilder.java  |  4 +-
 .../index/PhoenixTransactionalIndexer.java  |  5 ++-
 3 files changed, 38 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9d3e8efc/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java 
b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
index 00320ce..c966d91 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
@@ -43,8 +43,6 @@ import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ScanUtil.BytesComparator;
 import org.apache.phoenix.util.SchemaUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
@@ -63,8 +61,6 @@ import com.google.common.hash.Hashing;
  * @since 0.1
  */
 public class SkipScanFilter extends FilterBase implements Writable {
-private static final Logger logger = 
LoggerFactory.getLogger(SkipScanFilter.class);
-
 private enum Terminate {AT, AFTER};
 // Conjunctive normal form of or-ed ranges or point lookups
 private List slots;
@@ -72,6 +68,7 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 private int[] slotSpan;
 // schema of the row key
 private RowKeySchema schema;
+private boolean includeMultipleVersions;
 // current position for each slot
 private int[] position;
 // buffer used for skip hint
@@ -94,19 +91,27 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 public SkipScanFilter() {
 }
 
+public SkipScanFilter(SkipScanFilter filter, boolean 
includeMultipleVersions) {
+this(filter.slots, filter.slotSpan, filter.schema, 
includeMultipleVersions);
+}
+
 public SkipScanFilter(List slots, RowKeySchema schema) {
 this(slots, ScanUtil.getDefaultSlotSpans(slots.size()), schema);
 }
 
 public SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema) {
-init(slots, slotSpan, schema);
+this(slots, slotSpan, schema, false);
+}
+
+private SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema, boolean includeMultipleVersions) {
+init(slots, slotSpan, schema, includeMultipleVersions);
 }
 
 public void setOffset(int offset) {
 this.offset = offset;
 }
 
-private void init(List slots, int[] slotSpan, RowKeySchema 
schema) {
+private void init(List slots, int[] slotSpan, RowKeySchema 
schema, boolean includeMultipleVersions) {
 for (List ranges : slots) {
 if (ranges.isEmpty()) {
 throw new IllegalStateException();
@@ -117,9 +122,10 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 this.schema = schema;
 this.maxKeyLength = SchemaUtil.getMaxKeyLength(schema, slots);
 this.position = new int[slots.size()];
-startKey = new byte[maxKeyLength];
-endKey = new byte[maxKeyLength];
-endKeyLength = 0;
+this.startKey = new byte[maxKeyLength];
+this.endKey = new byte[maxKeyLength];
+this.endKeyLength = 0;
+this.includeMultipleVersions = includeMultipleVersions;
 }
 
 // Exposed for testing.
@@ -345,15 +351,20 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 return i;
 }
 
+private ReturnCode getIncludeReturnCode() {
+return includeMultipleVersions ? ReturnCode.INCLUDE : 
ReturnCode.INCLUDE_AND_NEXT_COL;
+}
+
 @edu.umd.cs.findbugs.annotations.SuppressWarnings(
 value="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT", 
 justification="Assignment designed to work this 

[1/2] phoenix git commit: PHOENIX-2657 Transactionally deleted cells become visible after few hours

2016-02-12 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 cb5e30139 -> 03b1dd229


PHOENIX-2657 Transactionally deleted cells become visible after few hours


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/86222d87
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/86222d87
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/86222d87

Branch: refs/heads/4.x-HBase-0.98
Commit: 86222d87b4154a94c4d5b8cedf7490a0d0c9ceee
Parents: cb5e301
Author: James Taylor 
Authored: Fri Feb 12 09:38:43 2016 -0800
Committer: James Taylor 
Committed: Fri Feb 12 11:00:47 2016 -0800

--
 .../apache/phoenix/filter/SkipScanFilter.java   | 47 +---
 .../phoenix/index/PhoenixIndexBuilder.java  |  4 +-
 .../index/PhoenixTransactionalIndexer.java  |  5 ++-
 3 files changed, 38 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/86222d87/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java 
b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
index 00320ce..c966d91 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/filter/SkipScanFilter.java
@@ -43,8 +43,6 @@ import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ScanUtil.BytesComparator;
 import org.apache.phoenix.util.SchemaUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
@@ -63,8 +61,6 @@ import com.google.common.hash.Hashing;
  * @since 0.1
  */
 public class SkipScanFilter extends FilterBase implements Writable {
-private static final Logger logger = 
LoggerFactory.getLogger(SkipScanFilter.class);
-
 private enum Terminate {AT, AFTER};
 // Conjunctive normal form of or-ed ranges or point lookups
 private List slots;
@@ -72,6 +68,7 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 private int[] slotSpan;
 // schema of the row key
 private RowKeySchema schema;
+private boolean includeMultipleVersions;
 // current position for each slot
 private int[] position;
 // buffer used for skip hint
@@ -94,19 +91,27 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 public SkipScanFilter() {
 }
 
+public SkipScanFilter(SkipScanFilter filter, boolean 
includeMultipleVersions) {
+this(filter.slots, filter.slotSpan, filter.schema, 
includeMultipleVersions);
+}
+
 public SkipScanFilter(List slots, RowKeySchema schema) {
 this(slots, ScanUtil.getDefaultSlotSpans(slots.size()), schema);
 }
 
 public SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema) {
-init(slots, slotSpan, schema);
+this(slots, slotSpan, schema, false);
+}
+
+private SkipScanFilter(List slots, int[] slotSpan, 
RowKeySchema schema, boolean includeMultipleVersions) {
+init(slots, slotSpan, schema, includeMultipleVersions);
 }
 
 public void setOffset(int offset) {
 this.offset = offset;
 }
 
-private void init(List slots, int[] slotSpan, RowKeySchema 
schema) {
+private void init(List slots, int[] slotSpan, RowKeySchema 
schema, boolean includeMultipleVersions) {
 for (List ranges : slots) {
 if (ranges.isEmpty()) {
 throw new IllegalStateException();
@@ -117,9 +122,10 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 this.schema = schema;
 this.maxKeyLength = SchemaUtil.getMaxKeyLength(schema, slots);
 this.position = new int[slots.size()];
-startKey = new byte[maxKeyLength];
-endKey = new byte[maxKeyLength];
-endKeyLength = 0;
+this.startKey = new byte[maxKeyLength];
+this.endKey = new byte[maxKeyLength];
+this.endKeyLength = 0;
+this.includeMultipleVersions = includeMultipleVersions;
 }
 
 // Exposed for testing.
@@ -345,15 +351,20 @@ public class SkipScanFilter extends FilterBase implements 
Writable {
 return i;
 }
 
+private ReturnCode getIncludeReturnCode() {
+return includeMultipleVersions ? ReturnCode.INCLUDE : 
ReturnCode.INCLUDE_AND_NEXT_COL;
+}
+
 @edu.umd.cs.findbugs.annotations.SuppressWarnings(
 value="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT", 
 justification="Assignment designed to work this