phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-2361 Use single byte value for empty key value
Date Mon, 02 Nov 2015 09:47:55 GMT
Repository: phoenix
Updated Branches:
  refs/heads/txn fd917af8c -> 164ea3c76


PHOENIX-2361 Use single byte value for empty key value


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

Branch: refs/heads/txn
Commit: 164ea3c76486737f769c13019cd975c5db8ff5c0
Parents: fd917af
Author: James Taylor <jtaylor@salesforce.com>
Authored: Mon Nov 2 01:45:06 2015 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Mon Nov 2 01:45:06 2015 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/query/QueryConstants.java | 6 +++++-
 .../src/main/java/org/apache/phoenix/schema/PTableImpl.java    | 3 +--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/164ea3c7/phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
index 3b5abaa..0ae089c 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
@@ -160,9 +160,13 @@ public interface QueryConstants {
     public static final String EMPTY_COLUMN_NAME = "_0";
     // For transactional tables, the value of our empty key value can no longer be empty
     // since empty values are treated as column delete markers.
-    public static final byte[] EMPTY_COLUMN_BYTES = Bytes.toBytes("x");
+    public static final byte[] EMPTY_COLUMN_BYTES = Bytes.toBytes(EMPTY_COLUMN_NAME);
     public static final ImmutableBytesPtr EMPTY_COLUMN_BYTES_PTR = new ImmutableBytesPtr(
             EMPTY_COLUMN_BYTES);
+    public final static String EMPTY_COLUMN_VALUE = "x";
+    public final static byte[] EMPTY_COLUMN_VALUE_BYTES = Bytes.toBytes(EMPTY_COLUMN_VALUE);
+    public static final ImmutableBytesPtr EMPTY_COLUMN_VALUE_BYTES_PTR = new ImmutableBytesPtr(
+            EMPTY_COLUMN_VALUE_BYTES);
 
     public static final String DEFAULT_COLUMN_FAMILY = "0";
     public static final byte[] DEFAULT_COLUMN_FAMILY_BYTES = Bytes.toBytes(DEFAULT_COLUMN_FAMILY);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/164ea3c7/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 fcd25f4..2d2d593 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,8 +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 value to the empty column name
-                    QueryConstants.EMPTY_COLUMN_BYTES_PTR));
+                    QueryConstants.EMPTY_COLUMN_VALUE_BYTES_PTR));
                 mutations.add(setValues);
                 if (!unsetValues.isEmpty()) {
                     mutations.add(unsetValues);


Mime
View raw message