phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sama...@apache.org
Subject phoenix git commit: Fix test failures
Date Sat, 25 Feb 2017 21:51:33 GMT
Repository: phoenix
Updated Branches:
  refs/heads/encodecolumns2 8d91690d3 -> 8370f6ee3


Fix test failures


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

Branch: refs/heads/encodecolumns2
Commit: 8370f6ee38011ddf628d955733ff0d46af4d20a4
Parents: 8d91690
Author: Samarth <samarth.jain@salesforce.com>
Authored: Sat Feb 25 13:51:23 2017 -0800
Committer: Samarth <samarth.jain@salesforce.com>
Committed: Sat Feb 25 13:51:23 2017 -0800

----------------------------------------------------------------------
 .../it/java/org/apache/phoenix/end2end/StatsCollectorIT.java | 5 +++++
 .../phoenix/coprocessor/BaseScannerRegionObserver.java       | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8370f6ee/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
index 135bf09..040c92c 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java
@@ -92,6 +92,11 @@ public class StatsCollectorIT extends BaseUniqueNamesOwnClusterIT {
                 sb.append(",");
             }
             sb.append("COLUMN_ENCODED_BYTES=0");
+        } else {
+            if (sb.length()>0) {
+                sb.append(",");
+            }
+            sb.append("COLUMN_ENCODED_BYTES=4");
         }
         if (!mutable) {
             if (sb.length()>0) {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8370f6ee/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
index 6a815d4..01498ed 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
@@ -19,6 +19,7 @@ package org.apache.phoenix.coprocessor;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Set;
 
 import org.apache.hadoop.conf.Configuration;
@@ -554,14 +555,15 @@ abstract public class BaseScannerRegionObserver extends BaseRegionObserver
{
                 Cell rowKv = result.get(0);
                 for (KeyValueColumnExpression kvExp : arrayKVRefs) {
                     if (kvExp.evaluate(tuple, ptr)) {
-                        for (int idx = tuple.size() - 1; idx >= 0; idx--) {
-                            Cell kv = tuple.getValue(idx);
+                        ListIterator<Cell> itr = result.listIterator();
+                        while (itr.hasNext()) {
+                            Cell kv = itr.next();
                             if (Bytes.equals(kvExp.getColumnFamily(), 0, kvExp.getColumnFamily().length,
                                     kv.getFamilyArray(), kv.getFamilyOffset(), kv.getFamilyLength())
                                 && Bytes.equals(kvExp.getColumnQualifier(), 0, kvExp.getColumnQualifier().length,
                                         kv.getQualifierArray(), kv.getQualifierOffset(),
kv.getQualifierLength())) {
                                 // remove the kv that has the full array values.
-                                result.remove(idx);
+                                itr.remove();
                                 break;
                             }
                         }


Mime
View raw message