On 9/13/06, Yonik Seeley <[EMAIL PROTECTED]> wrote:
On 9/13/06, Michael McCandless <[EMAIL PROTECTED]> wrote:
> Yonik Seeley wrote:
> >> But, I'm still renaming segments_N.new -> segments_N,
> >
> > Hmmm, remind me why you need the .new file?  Why can't you just create
> > segments_N after you are finished writing all of the segments?
>
> Because there could be a reader that tries to read the file before it's
> done being written.  It would hit EOF and throw an IOException.

Ahh, right... unlikely (the segments file is pretty small), but possible.

Another alternative (since this changes the index format anyway) is to
put something in the segments file to detect if it's partially
written... something like the size of the file or the number of
segments.  I don't know if the extra complexity would be worth saving
the creation time of an extra file or not...

Hey wait... the segments file already has the number of segments.
Can't you tell if it's not yet complete?

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to