Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

Obtain IndexCommits from directory

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


jason.rutherglen at gmail

Jun 16, 2008, 5:35 PM

Post #1 of 3 (267 views)
Permalink
Obtain IndexCommits from directory

Need to be able to get a list of IndexCommits for a directory. Also open an
IndexReader for each IndexCommit. Am thinking of API such as. I suppose
this could cause problems for reopen.

IndexCommit[] commits = IndexReader.listCommitPoints(Directory directory);

and

IndexReader.open(IndexCommit commit, Directory directory);


lucene at mikemccandless

Jun 17, 2008, 2:39 AM

Post #2 of 3 (239 views)
Permalink
Re: Obtain IndexCommits from directory [In reply to]

This API doesn't yet exist.

I do agree it would be useful (necessary) for users who have a
customized deletion policy that keeps around certain prior commits,
and wants to selectively open readers against these past commits. I
like your proposed methods; I can take this.

On reopen(): I think if you call this on an IndexReader explicitly
opened against a prior commit, it should just upgrade to the latest
commit?

Also, if you open an explicit commit, it's entirely possible you'll
hit an IOException because that commit was deleted after you listed it
and before you opened it. Normally, IndexReader.open would retry in
such a case (to get the new commit), but it would not do so, and just
throw the IOException, if given an explicit commit to open.

Mike

Jason Rutherglen wrote:

> Need to be able to get a list of IndexCommits for a directory. Also
> open an IndexReader for each IndexCommit. Am thinking of API such
> as. I suppose this could cause problems for reopen.
>
> IndexCommit[] commits = IndexReader.listCommitPoints(Directory
> directory);
>
> and
>
> IndexReader.open(IndexCommit commit, Directory directory);
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe[at]lucene.apache.org
For additional commands, e-mail: java-dev-help[at]lucene.apache.org


jason.rutherglen at gmail

Jun 17, 2008, 4:00 AM

Post #3 of 3 (238 views)
Permalink
Re: Obtain IndexCommits from directory [In reply to]

> reopen should just upgrade to the latest commit?

Makes sense

> commit was deleted IOException

Seems like proper behavior


On Tue, Jun 17, 2008 at 5:39 AM, Michael McCandless <
lucene[at]mikemccandless.com> wrote:

>
> This API doesn't yet exist.
>
> I do agree it would be useful (necessary) for users who have a customized
> deletion policy that keeps around certain prior commits, and wants to
> selectively open readers against these past commits. I like your proposed
> methods; I can take this.
>
> On reopen(): I think if you call this on an IndexReader explicitly opened
> against a prior commit, it should just upgrade to the latest commit?
>
> Also, if you open an explicit commit, it's entirely possible you'll hit an
> IOException because that commit was deleted after you listed it and before
> you opened it. Normally, IndexReader.open would retry in such a case (to
> get the new commit), but it would not do so, and just throw the IOException,
> if given an explicit commit to open.
>
> Mike
>
>
> Jason Rutherglen wrote:
>
> Need to be able to get a list of IndexCommits for a directory. Also open
>> an IndexReader for each IndexCommit. Am thinking of API such as. I suppose
>> this could cause problems for reopen.
>>
>> IndexCommit[] commits = IndexReader.listCommitPoints(Directory directory);
>>
>> and
>>
>> IndexReader.open(IndexCommit commit, Directory directory);
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe[at]lucene.apache.org
> For additional commands, e-mail: java-dev-help[at]lucene.apache.org
>
>

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.