com.atlassian.greenhopper.service.charts
Class IssueStatusHistoryCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by com.atlassian.greenhopper.service.charts.IssueStatusHistoryCollector

public class IssueStatusHistoryCollector
extends org.apache.lucene.search.Collector

Lucene collector for status changes on the change history index. Will push all changes to the provided callback implementation.

Author:
ahennecke

Nested Class Summary
static class IssueStatusHistoryCollector.STATUS_CHANGE
          There are two search keys we are interested in : status.ch_from and status.ch_to.
 
Constructor Summary
IssueStatusHistoryCollector(org.apache.lucene.search.Searchable searcher, org.apache.lucene.document.FieldSelector fieldSelector, IssueStatusHistoryCallback statusHistoryCallback, com.atlassian.jira.issue.status.Status status, IssueStatusHistoryCollector.STATUS_CHANGE change, java.util.BitSet filter)
           
 
Method Summary
 boolean acceptsDocsOutOfOrder()
           
 void collect(int doc)
          This gets called back for each history change that matches the query.
 void setNextReader(org.apache.lucene.index.IndexReader reader, int docBase)
           
 void setScorer(org.apache.lucene.search.Scorer scorer)
           
static org.joda.time.DateTime unformatDateTime(java.lang.String formattedValue)
          Do not use Joda's DateTimeFormat here, since it takes more than twice as long as manual parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IssueStatusHistoryCollector

public IssueStatusHistoryCollector(org.apache.lucene.search.Searchable searcher,
                                   org.apache.lucene.document.FieldSelector fieldSelector,
                                   IssueStatusHistoryCallback statusHistoryCallback,
                                   com.atlassian.jira.issue.status.Status status,
                                   IssueStatusHistoryCollector.STATUS_CHANGE change,
                                   java.util.BitSet filter)
Method Detail

collect

public void collect(int doc)
             throws java.io.IOException
This gets called back for each history change that matches the query. Due to Lucenes obscure way of filtering, we can't actually use the filter bitset in the searcher directly, but rather have to do our own filtering here.

Specified by:
collect in class org.apache.lucene.search.Collector
Throws:
java.io.IOException

setNextReader

public void setNextReader(org.apache.lucene.index.IndexReader reader,
                          int docBase)
                   throws java.io.IOException
Specified by:
setNextReader in class org.apache.lucene.search.Collector
Throws:
java.io.IOException

acceptsDocsOutOfOrder

public boolean acceptsDocsOutOfOrder()
Specified by:
acceptsDocsOutOfOrder in class org.apache.lucene.search.Collector

setScorer

public void setScorer(org.apache.lucene.search.Scorer scorer)
               throws java.io.IOException
Specified by:
setScorer in class org.apache.lucene.search.Collector
Throws:
java.io.IOException

unformatDateTime

public static org.joda.time.DateTime unformatDateTime(java.lang.String formattedValue)
Do not use Joda's DateTimeFormat here, since it takes more than twice as long as manual parsing.



Copyright © 2007-2012 Atlassian. All Rights Reserved.