[ 
https://issues.apache.org/jira/browse/PHOENIX-6211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17251427#comment-17251427
 ] 

ASF GitHub Bot commented on PHOENIX-6211:
-----------------------------------------

kadirozde commented on a change in pull request #973:
URL: https://github.com/apache/phoenix/pull/973#discussion_r545506749



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/iterate/OffsetResultIterator.java
##########
@@ -32,17 +36,27 @@
 public class OffsetResultIterator extends DelegateResultIterator {
     private int rowCount;
     private int offset;
+    private long pageSizeMs = Long.MAX_VALUE;
 
     public OffsetResultIterator(ResultIterator delegate, Integer offset) {
         super(delegate);
         this.offset = offset == null ? -1 : offset;
     }
 
+    public OffsetResultIterator(ResultIterator delegate, Integer offset, long 
pageSizeMs) {
+        this(delegate, offset);
+        this.pageSizeMs = pageSizeMs;
+    }
     @Override
     public Tuple next() throws SQLException {
+        long startTime = EnvironmentEdgeManager.currentTimeMillis();
         while (rowCount < offset) {
-            if (super.next() == null) { return null; }
+            Tuple tuple = super.next();
+            if (tuple == null) { return null; }
             rowCount++;
+            if (EnvironmentEdgeManager.currentTimeMillis() - startTime >= 
pageSizeMs) {

Review comment:
       OffsetResultIterator is also used on the server side. When it is used on 
the client side, pageSizeMs is set to Long.MAX_VALUE in the constructor.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Paged scan filters
> ------------------
>
>                 Key: PHOENIX-6211
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6211
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.0.0, 4.14.3
>            Reporter: Kadir OZDEMIR
>            Assignee: Kadir OZDEMIR
>            Priority: Critical
>             Fix For: 4.16.0
>
>         Attachments: PHOENIX-6211.4.x.001.patch, PHOENIX-6211.4.x.002.patch, 
> PHOENIX-6211.master.001.patch, PHOENIX-6211.master.002.patch, 
> PHOENIX-6211.master.003.patch, PHOENIX-6211.master.004.patch, 
> PHOENIX-6211.master.005.patch, PHOENIX-6211.master.006.patch, 
> PHOENIX-6211.master.007.patch, PHOENIX-6211.master.008.patch, 
> PHOENIX-6211.master.009.patch
>
>
> Phoenix performs two main operations on the server side: aggregation and 
> filtering. However, currently there is no internal Phoenix paging capability, 
> and thus server side operations can take long enough to lead to HBase client 
> timeouts. PHOENIX-5998 and PHOENIX-6207 are for providing the paging 
> capability for ungrouped and grouped aggregate operations. This improvement 
> Jira is for adding the paging capability for scan filters. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to