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-4745 Update Tephra version to 0.14.0-incubating
Date Fri, 25 May 2018 00:46:22 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 f312db350 -> 629a9175b


PHOENIX-4745 Update Tephra version to 0.14.0-incubating


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 629a9175b2c4a1e86b329a0c1829ec52883e7040
Parents: f312db3
Author: James Taylor <jtaylor@salesforce.com>
Authored: Thu May 24 16:10:52 2018 -0700
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Thu May 24 17:45:51 2018 -0700

----------------------------------------------------------------------
 .../phoenix/query/QueryServicesOptions.java     |  5 +-
 .../transaction/TephraTransactionContext.java   | 55 +++++++++++++++++++-
 pom.xml                                         |  2 +-
 3 files changed, 59 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/629a9175/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
index d708785..307c5dd 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
@@ -117,6 +117,7 @@ import org.apache.phoenix.trace.util.Tracing;
 import org.apache.phoenix.transaction.TransactionFactory;
 import org.apache.phoenix.util.DateUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.tephra.TxConstants;
 
 
 
@@ -440,7 +441,9 @@ public class QueryServicesOptions {
             .setIfUnset(UPLOAD_BINARY_DATA_TYPE_ENCODING, DEFAULT_UPLOAD_BINARY_DATA_TYPE_ENCODING)
             .setIfUnset(PHOENIX_ACLS_ENABLED,  DEFAULT_PHOENIX_ACLS_ENABLED)
             .setIfUnset(LOG_LEVEL,  DEFAULT_LOGGING_LEVEL)
-            .setIfUnset(LOG_SAMPLE_RATE,  DEFAULT_LOG_SAMPLE_RATE);
+            .setIfUnset(LOG_SAMPLE_RATE,  DEFAULT_LOG_SAMPLE_RATE)
+            .setIfUnset(TxConstants.TX_PRE_014_CHANGESET_KEY, Boolean.FALSE.toString())
+            ;
         // HBase sets this to 1, so we reset it to something more appropriate.
         // Hopefully HBase will change this, because we can't know if a user set
         // it to 1, so we'll change it.

http://git-wip-us.apache.org/repos/asf/phoenix/blob/629a9175/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionContext.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionContext.java
b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionContext.java
index 8b16210..7db54eb 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionContext.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionContext.java
@@ -26,7 +26,9 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
 import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.exception.SQLExceptionInfo;
@@ -391,9 +393,60 @@ public class TephraTransactionContext implements PhoenixTransactionContext
{
         return new TephraTransactionContext(context, subTask);
     }
     
+    public static class TransactionAwareHTableDelegate extends TransactionAwareHTable implements
HTableInterface  {
+        private final HTableInterface delegate;
+        
+        public TransactionAwareHTableDelegate(HTableInterface hTable, TxConstants.ConflictDetection
conflictLevel) {
+            super(hTable, conflictLevel);
+            delegate = hTable;
+        }
+        
+        @Override
+        public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long
amount, boolean writeToWAL)
+                throws IOException {
+            return delegate.incrementColumnValue(row, family, qualifier, amount, writeToWAL);
+        }
+
+        @Override
+        public Boolean[] exists(List<Get> gets) throws IOException {
+            return delegate.exists(gets);
+        }
+
+        @Override
+        public void setAutoFlush(boolean autoFlush) {
+            delegate.setAutoFlush(autoFlush);
+        }
+
+        @Override
+        public void setAutoFlush(boolean autoFlush, boolean clearBufferOnFail) {
+            delegate.setAutoFlush(autoFlush, clearBufferOnFail);
+        }
+
+        @Override
+        public void setAutoFlushTo(boolean autoFlush) {
+            delegate.setAutoFlushTo(autoFlush);
+        }
+
+        @Override
+        public boolean isAutoFlush() {
+            return delegate.isAutoFlush();
+        }
+
+        @Override
+        public void flushCommits() throws IOException {
+            delegate.flushCommits();
+        }
+
+        @Override
+        public Result getRowOrBefore(byte[] row, byte[] family) throws IOException {
+            return delegate.getRowOrBefore(row, family);
+        }
+        
+    }
+    
     @Override
     public HTableInterface getTransactionalTable(HTableInterface htable, boolean isImmutable)
{
-        TransactionAwareHTable transactionAwareHTable = new TransactionAwareHTable(htable,
isImmutable ? TxConstants.ConflictDetection.NONE : TxConstants.ConflictDetection.ROW);
+        TransactionAwareHTableDelegate transactionAwareHTable = new TransactionAwareHTableDelegate(htable,
isImmutable ? TxConstants.ConflictDetection.NONE : TxConstants.ConflictDetection.ROW);
         this.addTransactionAware(transactionAwareHTable);
         return transactionAwareHTable;
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/629a9175/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9d0fec2..c00204e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,7 +100,7 @@
     <joni.version>2.1.2</joni.version>
     <avatica.version>1.10.0</avatica.version>
     <jettyVersion>8.1.7.v20120910</jettyVersion>
-    <tephra.version>0.13.0-incubating</tephra.version>
+    <tephra.version>0.14.0-incubating</tephra.version>
     <spark.version>2.0.2</spark.version>
     <scala.version>2.11.8</scala.version>
     <scala.binary.version>2.11</scala.binary.version>


Mime
View raw message