You're welcome!
SegmentInfo exposes a sizeInBytes() method, so you can sum up that
result for all segments in the merge.
But NOTE: your merge scheduler must be located in the
org.apache.lucene.index package (this API is currently package
private).
Mike
On Fri, May 15, 2009 at 4:56 PM, Dan OConn
Jason,
Thanks for the reply.
As I was reading the code, it said that if the concurrent merge scheduler ran
out of threads, it ran the merge in the foreground.
Does that mean the foreground of the merge thread or the indexwriter thread?
The former would be good. The later would seem to be bad
Mike,
Thank for the reply.
A follow up question.
How can I tell the big merges from the small ones?
Regards,
Dan
- Original Message -
From: Michael McCandless
To: java-user@lucene.apache.org
Sent: Fri May 15 16:50:27 2009
Subject: Re: is there a way to control when merges happen?
You should try to share a single IndexWriter instance across "Build
Indices" and "Application". Also, you shouldn't open a new
IndexWriter for each document added (nor, call optimize), if possible.
Lucene doesn't allow more than one IndexWriter to be open at once on
the same index (the write lock
I think you could subclass ConcurrentMergeScheduler, overriding
merge() to only call super.merge() if the time is right? (And just
return right away if it's not the right time).
Though you might want to allow small merges to run in real-time, and
big merges to wait until after hours.
Mike
On Fr
Hi Dan,
You are looking to throttle the merging? I'd recommend setting
ConcurrentMergeScheduler.setMaxThreadCount(1). This way IW.addDocument
doesn't wait while a merge occurs (like SerialMergeScheduler) however it
should not use as much CPU as only one merge will occur at a time.
In regards to
I am trying to build my indices file while still allowing my application to add
new information and I my application cannot obtain the lock.
Here is a little pseudo code on what I am trying to do:
Build Indicies:
1. For each element (i.e. I have n elements I want to add to the index)
2.
First, kudos for making this test and attaching it. If nothing else that
makesme curious to see whether I really understand what's going on or not.
I think you're looking at the wrong tab in Luke ... I modified your test
to
write to an FSDir. When you look at the "overview" tab, you'll see three
t