Hi
Can someone explain the original design?
And I suggest to refactor the API (FetchedSegments.class) to
public String[] getSummary(HitDetails[] details, int hitStart, int
hitEnd, Query query) {
....
}
Does this make sense?
/Jack
On 2/20/06, Jack Tang <[EMAIL PROTECTED]> wrote:
> Hi Guys
>
> In FetchedSegments class, below code shows how to get the hit summaries.
>
> public String[] getSummary(HitDetails[] details, Query query)
> throws IOException {
> SummaryThread[] threads = new SummaryThread[details.length];
> for (int i = 0; i < threads.length; i++) {
> threads[i] = new SummaryThread(details[i], query);
> threads[i].start();
> }
> ......
> }
>
> It means if the hits are 1,000,000 items, then 1,000,000 threads
> should be spawned. But in fact we read the hits page by page, so why
> not ctor one thread pool whose size is page size and we retrieve the
> summary on demand? Is this sounds better?
>
> /Jack
>
> --
> Keep Discovering ... ...
> http://www.jroller.com/page/jmars
>
--
Keep Discovering ... ...
http://www.jroller.com/page/jmars