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-2560 PhoenixMetricsIT test failures
Date Mon, 04 Jan 2016 16:00:56 GMT
Repository: phoenix
Updated Branches:
  refs/heads/master 48e589773 -> 5c237dd8b


PHOENIX-2560 PhoenixMetricsIT test failures


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

Branch: refs/heads/master
Commit: 5c237dd8b2f9962ff45f10ee66c11a2697eb41f0
Parents: 48e5897
Author: James Taylor <jtaylor@salesforce.com>
Authored: Mon Jan 4 08:00:47 2016 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Mon Jan 4 08:00:47 2016 -0800

----------------------------------------------------------------------
 .../MutatingParallelIteratorFactory.java        | 18 +-------------
 .../phoenix/iterate/BaseResultIterators.java    |  3 +++
 .../iterate/MergeSortResultIterator.java        | 25 +-------------------
 .../query/ConnectionQueryServicesImpl.java      |  4 +++-
 4 files changed, 8 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5c237dd8/phoenix-core/src/main/java/org/apache/phoenix/compile/MutatingParallelIteratorFactory.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/MutatingParallelIteratorFactory.java
b/phoenix-core/src/main/java/org/apache/phoenix/compile/MutatingParallelIteratorFactory.java
index 630760c..ed421a7 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/MutatingParallelIteratorFactory.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/MutatingParallelIteratorFactory.java
@@ -32,9 +32,6 @@ import org.apache.phoenix.iterate.ParallelIteratorFactory;
 import org.apache.phoenix.iterate.PeekingResultIterator;
 import org.apache.phoenix.iterate.ResultIterator;
 import org.apache.phoenix.jdbc.PhoenixConnection;
-import org.apache.phoenix.query.ConnectionQueryServices;
-import org.apache.phoenix.query.QueryServices;
-import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.tuple.SingleKeyValueTuple;
 import org.apache.phoenix.schema.tuple.Tuple;
 import org.apache.phoenix.schema.types.PLong;
@@ -64,20 +61,7 @@ public abstract class MutatingParallelIteratorFactory implements ParallelIterato
         long totalRowCount = state.getUpdateCount();
         if (clonedConnection.getAutoCommit()) {
             clonedConnection.getMutationState().join(state);
-            clonedConnection.commit();
-            ConnectionQueryServices services = clonedConnection.getQueryServices();
-            int maxSize = services.getProps().getInt(QueryServices.MAX_MUTATION_SIZE_ATTRIB,
QueryServicesOptions.DEFAULT_MAX_MUTATION_SIZE);
-            /*
-             * Everything that was mutated as part of the clonedConnection has been committed.
However, we want to
-             * report the mutation work done using this clonedConnection as part of the overall
mutation work of the
-             * parent connection. So we need to set those metrics in the empty mutation state
so that they could be
-             * combined with the parent connection's mutation metrics (as part of combining
mutation state) in the
-             * close() method of the iterator being returned. Don't combine the read metrics
in parent context yet
-             * though because they are possibly being concurrently modified by other threads
at this stage. Instead we
-             * will get hold of the read metrics when all the mutating iterators are done.
-             */
-            state = MutationState.emptyMutationState(maxSize, clonedConnection);
-            state.getMutationMetricQueue().combineMetricQueues(clonedConnection.getMutationState().getMutationMetricQueue());
+            state = clonedConnection.getMutationState();
         }
         final MutationState finalState = state;
         

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5c237dd8/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index 2806acd..715e7c4 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -700,6 +700,9 @@ public abstract class BaseResultIterators extends ExplainTable implements
Result
 
     @Override
     public void close() throws SQLException {
+        if (allFutures.isEmpty()) {
+            return;
+        }
         // Don't call cancel on already started work, as it causes the HConnection
         // to get into a funk. Instead, just cancel queued work.
         boolean cancelledWork = false;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5c237dd8/phoenix-core/src/main/java/org/apache/phoenix/iterate/MergeSortResultIterator.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/MergeSortResultIterator.java
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/MergeSortResultIterator.java
index e076a40..961e766 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/MergeSortResultIterator.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/MergeSortResultIterator.java
@@ -24,8 +24,6 @@ import java.util.PriorityQueue;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.schema.tuple.Tuple;
-import org.apache.phoenix.util.SQLCloseables;
-import org.apache.phoenix.util.ServerUtil;
 
 /**
  * Base class for a ResultIterator that does a merge sort on the list of iterators provided.
@@ -43,28 +41,7 @@ public abstract class MergeSortResultIterator implements PeekingResultIterator
{
 
     @Override
     public void close() throws SQLException {
-        SQLException toThrow = null;
-        try {
-            if (resultIterators != null) {
-                resultIterators.close();
-            }
-        } catch (Exception e) {
-            toThrow = ServerUtil.parseServerException(e);
-        } finally {
-            try {
-                if (minHeap != null) {
-                    SQLCloseables.closeAllQuietly(minHeap);
-                }
-            } catch (Exception e) {
-                if (toThrow == null) {
-                    toThrow = ServerUtil.parseServerException(e);
-                } else {
-                    toThrow.setNextException(ServerUtil.parseServerException(e));
-                }
-            } finally {
-                if (toThrow != null) { throw toThrow; }
-            }
-        }
+        resultIterators.close();
     }
 
     abstract protected int compare(Tuple t1, Tuple t2);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5c237dd8/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index 93efc1a..f792c02 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -2482,7 +2482,9 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices
implement
     
     @Override
     public MutationState updateData(MutationPlan plan) throws SQLException {
-        return plan.execute();
+        MutationState state = plan.execute();
+        plan.getContext().getConnection().commit();
+        return state;
     }
 
     @Override


Mime
View raw message