You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Jason Rutherglen <ja...@gmail.com> on 2008/06/17 02:35:22 UTC
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);
Re: Obtain IndexCommits from directory
Posted by Jason Rutherglen <ja...@gmail.com>.
> 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@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@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
Re: Obtain IndexCommits from directory
Posted by Michael McCandless <lu...@mikemccandless.com>.
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org