Hi siraj,

There is now way to find out the free space on a partition using Java 5
(Lucene 3.0) or Java 1.4 (Lucene 2.9) without any native JNI calls. So
Lucene cannot calculate it before optimizing.

With Java 6 it would be possible, but Lucene 3.0 is only allowed to use Java
5: File#getUsableSpace()
A workaround would be to only check it conditionally using reflection on
File.class.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: Siraj Haider [mailto:si...@jobdiva.com]
> Sent: Monday, November 30, 2009 11:58 PM
> To: java-user@lucene.apache.org
> Subject: Re: Disk full while optimizing an index
> 
> Jason,
> Thank you for your suggestion.  That is what I am planning to do, but I
> overheard or read somewhere that the new lucene version can take care of
> that internally, so I was just trying to see if somebody know something
> about it.
> 
> regards
> -siraj
> 
> Jason Rutherglen wrote:
> > Siraj,
> >
> > You could estimate the maximum size used during optimization at 2.5 (a
> > sort of rough maximum) times your current index size, and not optimize
> > if your index (at 2.5 times) would exceed your allowable disk space.
> >
> > Jason
> >
> > On Mon, Nov 30, 2009 at 2:50 PM, Siraj Haider <si...@jobdiva.com> wrote:
> >
> >> Index optimization fails if we don't have enough space on the drive and
> >> leaves the hard drive almost full.  Is there a way not to even start
> >> optimization if we don't have enough space on drive?
> >>
> >> regards
> >> -siraj
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> >> For additional commands, e-mail: java-user-h...@lucene.apache.org
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> > For additional commands, e-mail: java-user-h...@lucene.apache.org
> >
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to