lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Keegan <peterlkee...@gmail.com>
Subject Re: 2 phase commit with external data
Date Fri, 06 Nov 2009 16:22:05 GMT
>Can you use IndexWriter.getReader() to get the reader for step 2
Yes - perfect! I didn't think that would be different than refreshing or
recreating an IndexReader.

I don't need to keep the old commit alive. The goal is to keep the external
file in synch with the index, so a separate searcher process will see
consistent data. By postponing both commits, the window where they are out
of synch is very small (2 file renames). I record the Lucene index version
in the external file for checking synchcronization.

Thanks,
Peter


On Fri, Nov 6, 2009 at 11:02 AM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> Can you use IndexWriter.getReader() to get the reader for step 2?
>
> Failing that, you could simply commit the change, but use a deletion
> policy that keeps the old commit alive.  Then open a normal reader and
> read whatever you need for step 2, and commit the external file.  If
> an error happens and you need to rollback you can simply open a new
> IndexWriter on the old commit point -- this lets you rollback even if
> the commit has already happened.
>
> Mike
>
> On Fri, Nov 6, 2009 at 10:59 AM, Peter Keegan <peterlkeegan@gmail.com>
> wrote:
> > I'm trying to use a two phase commit involving a Lucene index and an
> > external file derived from the index.
> > Here are the steps:
> >
> > 1. prepare commit on Lucene index
> > 2. prepare commit on external file
> > 3. commit Lucene index
> > 4. commit external file
> >
> > Step 2 requires an IndexReader with access to the 'prepared' Lucene
> index,
> > but I don't see any methods for this. Is there a way to read the prepared
> > index? I really only need access to a stored field. I'm using Lucene-2.9
> >
> > Thanks,
> > Peter
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message