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

Keith Turner commented on GORA-119:
-----------------------------------

I like option C.  Accumulo could support this too, it has server side iterators 
which support arbitrary filtering.  

I took a look at the patch, the strategy seems to be that the store has special 
case code where it checks the type of the filter and determines if it can 
optimize for it.  So the stores that ship w/ gora may support the filters that 
ship with gora.  However if a user writes their own filter, it will always be 
applied client side w/o any optimization. To address this maybe optimizations 
could for filters could be associated with the filter instead of the store.  
Then if a user writes a filter they could optionally write optimizations for 
the data stores they care about.  Below is sketch of how this might be done.

interface GoraFilter {
  public boolean filter(K key, T persistent);
  public QueryOptimizer getOptimizer(DataStore ds);
}

interface QueryOptimizer {
}

interface HBaseQueryOptimizer extends QueryOptimizer {
   void optimize(Scan scan, HBaseStore);
}

class SingleFieldValueFilter implements GoraFilter {
  public boolean filter(K key, T persistent){
     //generic implemetation for store w/o optimization
  }
  public QueryOptimizer getOptimizer(DataStore ds) {
     if(ds instanceof HBaseStore){
          return new HBaseQueryOptimizer(){...};
     } else if(ds instanceof AccumuloStore){
          return new AccumuloQueryOptimizer(){...};
     }
     return null;
  }
}



                
> implement a filter enabled scan in gora
> ---------------------------------------
>
>                 Key: GORA-119
>                 URL: https://issues.apache.org/jira/browse/GORA-119
>             Project: Apache Gora
>          Issue Type: Improvement
>    Affects Versions: 0.2
>         Environment: gora hbase gora-core gora-hbase
>            Reporter: raf shin
>              Labels: filter, gora-core, gora-hbase, scan
>             Fix For: 0.3
>
>         Attachments: GORA-119-v1.txt
>
>
> it'll be very of help to implement a filtered scan to reduce the time of scan 
> in gora-core and gora-hbase components.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to