Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/239#discussion_r118312938
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/iterate/DefaultParallelScanGrouper.java
 ---
    @@ -17,46 +17,79 @@
      */
     package org.apache.phoenix.iterate;
     
    +import java.sql.SQLException;
     import java.util.List;
     
    +import com.google.common.base.Preconditions;
    +import org.apache.hadoop.hbase.HRegionLocation;
     import org.apache.hadoop.hbase.client.Scan;
     import org.apache.phoenix.compile.QueryPlan;
    +import org.apache.phoenix.compile.StatementContext;
     import org.apache.phoenix.schema.PTable;
     import org.apache.phoenix.schema.PTable.IndexType;
     import org.apache.phoenix.schema.SaltingUtil;
    +import org.apache.phoenix.schema.TableRef;
     import org.apache.phoenix.util.ScanUtil;
     
     /**
      * Default implementation that creates a scan group if a plan is row key 
ordered (which requires a merge sort),
    - * or if a scan crosses a region boundary and the table is salted or a 
local index.   
    + * or if a scan crosses a region boundary and the table is salted or a 
local index.
      */
     public class DefaultParallelScanGrouper implements ParallelScanGrouper {
    -   
    -   private static final DefaultParallelScanGrouper INSTANCE = new 
DefaultParallelScanGrouper();
     
    -    public static DefaultParallelScanGrouper getInstance() {
    -        return INSTANCE;
    -    }
    -    
    -    private DefaultParallelScanGrouper() {}
    -
    -   @Override
    -   public boolean shouldStartNewScan(QueryPlan plan, List<Scan> scans, 
byte[] startKey, boolean crossedRegionBoundary) {
    -           PTable table = plan.getTableRef().getTable();
    -           boolean startNewScanGroup = false;
    -        if (!plan.isRowKeyOrdered()) {
    -            startNewScanGroup = true;
    -        } else if (crossedRegionBoundary) {
    -            if (table.getIndexType() == IndexType.LOCAL) {
    -                startNewScanGroup = true;
    -            } else if (table.getBucketNum() != null) {
    -                startNewScanGroup = scans.isEmpty() ||
    -                        ScanUtil.crossesPrefixBoundary(startKey,
    -                                
ScanUtil.getPrefix(scans.get(scans.size()-1).getStartRow(), 
SaltingUtil.NUM_SALTING_BYTES), 
    -                                SaltingUtil.NUM_SALTING_BYTES);
    -            }
    -        }
    -        return startNewScanGroup;
    +  private static DefaultParallelScanGrouper INSTANCE = new 
DefaultParallelScanGrouper();
    --- End diff --
    
    I don't think that DefaultParallelScanGrouper can be a singleton with the 
state of context and tableName inside of it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to