[12/21] phoenix git commit: PHOENIX-4605 Support running multiple transaction providers
http://git-wip-us.apache.org/repos/asf/phoenix/blob/8eaca121/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java deleted file mode 100644 index c191d8d..000 --- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.phoenix.transaction; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.Append; -import org.apache.hadoop.hbase.client.Delete; -import org.apache.hadoop.hbase.client.Durability; -import org.apache.hadoop.hbase.client.Get; -import org.apache.hadoop.hbase.client.HTableInterface; -import org.apache.hadoop.hbase.client.Increment; -import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.client.Result; -import org.apache.hadoop.hbase.client.ResultScanner; -import org.apache.hadoop.hbase.client.Row; -import org.apache.hadoop.hbase.client.RowMutations; -import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.client.coprocessor.Batch.Call; -import org.apache.hadoop.hbase.client.coprocessor.Batch.Callback; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; -import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; -import org.apache.tephra.TxConstants; -import org.apache.tephra.hbase.TransactionAwareHTable; -import org.apache.phoenix.schema.PTable; -import org.apache.phoenix.schema.PTableType; - -import com.google.protobuf.Descriptors.MethodDescriptor; -import com.google.protobuf.Message; -import com.google.protobuf.Service; -import com.google.protobuf.ServiceException; - -public class TephraTransactionTable implements PhoenixTransactionalTable { - -private TransactionAwareHTable transactionAwareHTable; - -private TephraTransactionContext tephraTransactionContext; - -public TephraTransactionTable(PhoenixTransactionContext ctx, HTableInterface hTable) { -this(ctx, hTable, null); -} - -public TephraTransactionTable(PhoenixTransactionContext ctx, HTableInterface hTable, PTable pTable) { - -assert(ctx instanceof TephraTransactionContext); - -tephraTransactionContext = (TephraTransactionContext) ctx; - -transactionAwareHTable = new TransactionAwareHTable(hTable, (pTable != null && pTable.isImmutableRows()) ? TxConstants.ConflictDetection.NONE : TxConstants.ConflictDetection.ROW); - -tephraTransactionContext.addTransactionAware(transactionAwareHTable); - -if (pTable != null && pTable.getType() != PTableType.INDEX) { -tephraTransactionContext.markDMLFence(pTable); -} -} - -@Override -public Result get(Get get) throws IOException { -return transactionAwareHTable.get(get); -} - -@Override -public void put(Put put) throws IOException { -transactionAwareHTable.put(put); -} - -@Override -public void delete(Delete delete) throws IOException { -transactionAwareHTable.delete(delete); -} - -@Override -public ResultScanner getScanner(Scan scan) throws IOException { -return transactionAwareHTable.getScanner(scan); -} - -@Override -public byte[] getTableName() { -return transactionAwareHTable.getTableName(); -} - -@Override -public Configuration getConfiguration() { -return transactionAwareHTable.getConfiguration(); -} - -@Override -public HTableDescriptor getTableDescriptor() throws IOException { -return transactionAwareHTable.getTableDescriptor(); -} - -@Override -public boolean exists(Get get) throws IOException { -return transactionAwareHTable.exists(get); -} - -@Override -public Result[] get(List gets) throws IOException {
[12/21] phoenix git commit: PHOENIX-4605 Support running multiple transaction providers
http://git-wip-us.apache.org/repos/asf/phoenix/blob/8eaca121/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java deleted file mode 100644 index c191d8d..000 --- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.phoenix.transaction; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.Append; -import org.apache.hadoop.hbase.client.Delete; -import org.apache.hadoop.hbase.client.Durability; -import org.apache.hadoop.hbase.client.Get; -import org.apache.hadoop.hbase.client.HTableInterface; -import org.apache.hadoop.hbase.client.Increment; -import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.client.Result; -import org.apache.hadoop.hbase.client.ResultScanner; -import org.apache.hadoop.hbase.client.Row; -import org.apache.hadoop.hbase.client.RowMutations; -import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.client.coprocessor.Batch.Call; -import org.apache.hadoop.hbase.client.coprocessor.Batch.Callback; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; -import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; -import org.apache.tephra.TxConstants; -import org.apache.tephra.hbase.TransactionAwareHTable; -import org.apache.phoenix.schema.PTable; -import org.apache.phoenix.schema.PTableType; - -import com.google.protobuf.Descriptors.MethodDescriptor; -import com.google.protobuf.Message; -import com.google.protobuf.Service; -import com.google.protobuf.ServiceException; - -public class TephraTransactionTable implements PhoenixTransactionalTable { - -private TransactionAwareHTable transactionAwareHTable; - -private TephraTransactionContext tephraTransactionContext; - -public TephraTransactionTable(PhoenixTransactionContext ctx, HTableInterface hTable) { -this(ctx, hTable, null); -} - -public TephraTransactionTable(PhoenixTransactionContext ctx, HTableInterface hTable, PTable pTable) { - -assert(ctx instanceof TephraTransactionContext); - -tephraTransactionContext = (TephraTransactionContext) ctx; - -transactionAwareHTable = new TransactionAwareHTable(hTable, (pTable != null && pTable.isImmutableRows()) ? TxConstants.ConflictDetection.NONE : TxConstants.ConflictDetection.ROW); - -tephraTransactionContext.addTransactionAware(transactionAwareHTable); - -if (pTable != null && pTable.getType() != PTableType.INDEX) { -tephraTransactionContext.markDMLFence(pTable); -} -} - -@Override -public Result get(Get get) throws IOException { -return transactionAwareHTable.get(get); -} - -@Override -public void put(Put put) throws IOException { -transactionAwareHTable.put(put); -} - -@Override -public void delete(Delete delete) throws IOException { -transactionAwareHTable.delete(delete); -} - -@Override -public ResultScanner getScanner(Scan scan) throws IOException { -return transactionAwareHTable.getScanner(scan); -} - -@Override -public byte[] getTableName() { -return transactionAwareHTable.getTableName(); -} - -@Override -public Configuration getConfiguration() { -return transactionAwareHTable.getConfiguration(); -} - -@Override -public HTableDescriptor getTableDescriptor() throws IOException { -return transactionAwareHTable.getTableDescriptor(); -} - -@Override -public boolean exists(Get get) throws IOException { -return transactionAwareHTable.exists(get); -} - -@Override -public Result[] get(List gets) throws IOException {
[12/21] phoenix git commit: PHOENIX-4605 Support running multiple transaction providers
http://git-wip-us.apache.org/repos/asf/phoenix/blob/8eaca121/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java b/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java deleted file mode 100644 index c191d8d..000 --- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionTable.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.phoenix.transaction; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.Append; -import org.apache.hadoop.hbase.client.Delete; -import org.apache.hadoop.hbase.client.Durability; -import org.apache.hadoop.hbase.client.Get; -import org.apache.hadoop.hbase.client.HTableInterface; -import org.apache.hadoop.hbase.client.Increment; -import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.client.Result; -import org.apache.hadoop.hbase.client.ResultScanner; -import org.apache.hadoop.hbase.client.Row; -import org.apache.hadoop.hbase.client.RowMutations; -import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.client.coprocessor.Batch.Call; -import org.apache.hadoop.hbase.client.coprocessor.Batch.Callback; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; -import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; -import org.apache.tephra.TxConstants; -import org.apache.tephra.hbase.TransactionAwareHTable; -import org.apache.phoenix.schema.PTable; -import org.apache.phoenix.schema.PTableType; - -import com.google.protobuf.Descriptors.MethodDescriptor; -import com.google.protobuf.Message; -import com.google.protobuf.Service; -import com.google.protobuf.ServiceException; - -public class TephraTransactionTable implements PhoenixTransactionalTable { - -private TransactionAwareHTable transactionAwareHTable; - -private TephraTransactionContext tephraTransactionContext; - -public TephraTransactionTable(PhoenixTransactionContext ctx, HTableInterface hTable) { -this(ctx, hTable, null); -} - -public TephraTransactionTable(PhoenixTransactionContext ctx, HTableInterface hTable, PTable pTable) { - -assert(ctx instanceof TephraTransactionContext); - -tephraTransactionContext = (TephraTransactionContext) ctx; - -transactionAwareHTable = new TransactionAwareHTable(hTable, (pTable != null && pTable.isImmutableRows()) ? TxConstants.ConflictDetection.NONE : TxConstants.ConflictDetection.ROW); - -tephraTransactionContext.addTransactionAware(transactionAwareHTable); - -if (pTable != null && pTable.getType() != PTableType.INDEX) { -tephraTransactionContext.markDMLFence(pTable); -} -} - -@Override -public Result get(Get get) throws IOException { -return transactionAwareHTable.get(get); -} - -@Override -public void put(Put put) throws IOException { -transactionAwareHTable.put(put); -} - -@Override -public void delete(Delete delete) throws IOException { -transactionAwareHTable.delete(delete); -} - -@Override -public ResultScanner getScanner(Scan scan) throws IOException { -return transactionAwareHTable.getScanner(scan); -} - -@Override -public byte[] getTableName() { -return transactionAwareHTable.getTableName(); -} - -@Override -public Configuration getConfiguration() { -return transactionAwareHTable.getConfiguration(); -} - -@Override -public HTableDescriptor getTableDescriptor() throws IOException { -return transactionAwareHTable.getTableDescriptor(); -} - -@Override -public boolean exists(Get get) throws IOException { -return transactionAwareHTable.exists(get); -} - -@Override -public Result[] get(List gets) throws IOException {