phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject [5/8] git commit: PHOENIX-29
Date Mon, 24 Feb 2014 05:42:55 GMT
PHOENIX-29


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

Branch: refs/heads/master
Commit: 6ba276be0169e08f0894940651a4f990c7df4c58
Parents: 51f8a00
Author: anoopsjohn <anoopsamjohn@gmail.com>
Authored: Mon Feb 24 01:13:12 2014 +0530
Committer: anoopsjohn <anoopsamjohn@gmail.com>
Committed: Mon Feb 24 01:13:12 2014 +0530

----------------------------------------------------------------------
 .../apache/phoenix/iterate/ExplainTable.java    | 33 ++++++++------------
 1 file changed, 13 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/6ba276be/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java b/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
index d72f124..6075007 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
@@ -18,27 +18,17 @@
 package org.apache.phoenix.iterate;
 
 import java.text.Format;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
+import java.util.*;
 
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.hbase.filter.FilterList;
-import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
-import org.apache.hadoop.hbase.filter.PageFilter;
+import org.apache.hadoop.hbase.filter.*;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.compile.GroupByCompiler.GroupBy;
-import org.apache.phoenix.compile.ScanRanges;
-import org.apache.phoenix.compile.StatementContext;
+import org.apache.phoenix.compile.*;
 import org.apache.phoenix.query.KeyRange;
 import org.apache.phoenix.query.KeyRange.Bound;
-import org.apache.phoenix.schema.PDataType;
-import org.apache.phoenix.schema.RowKeySchema;
-import org.apache.phoenix.schema.SortOrder;
-import org.apache.phoenix.schema.TableRef;
+import org.apache.phoenix.schema.*;
 import org.apache.phoenix.util.StringUtil;
 
 import com.google.common.collect.Iterators;
@@ -116,9 +106,7 @@ public abstract class ExplainTable {
                     }
                     if (filterList.size() > offset+1) {
                         filterDesc = filterList.get(offset+1).toString();
-                        if (filterList.size() > offset+2) {
-                            pageFilter = (PageFilter) filterList.get(offset+2);
-                        }
+                        pageFilter = getPageFilter(filterList);
                     }
                 }
             } else if (filter instanceof FilterList) {
@@ -129,9 +117,7 @@ public abstract class ExplainTable {
                 }
                 if (filterList.size() > offset) {
                     filterDesc = filterList.get(offset).toString();
-                    if (filterList.size() > offset+1) {
-                        pageFilter = (PageFilter) filterList.get(offset+1);
-                    }
+                    pageFilter = getPageFilter(filterList);
                 }
             } else {
                 if (filter instanceof FirstKeyOnlyFilter) {
@@ -152,6 +138,13 @@ public abstract class ExplainTable {
         groupBy.explain(planSteps);
     }
 
+    private PageFilter getPageFilter(List<Filter> filterList) {
+        for (Filter filter : filterList) {
+            if (filter instanceof PageFilter) return (PageFilter)filter;
+        }
+        return null;
+    }
+
     private void appendPKColumnValue(StringBuilder buf, byte[] range, Boolean isNull, int
slotIndex) {
         if (Boolean.TRUE.equals(isNull)) {
             buf.append("null");


Mime
View raw message