From java-dev-return-25973-apmail-lucene-java-dev-archive=lucene.apache.org@lucene.apache.org Tue Jun 17 11:01:02 2008 Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 39607 invoked from network); 17 Jun 2008 11:01:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jun 2008 11:01:02 -0000 Received: (qmail 71609 invoked by uid 500); 17 Jun 2008 11:00:58 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 71547 invoked by uid 500); 17 Jun 2008 11:00:57 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 71533 invoked by uid 99); 17 Jun 2008 11:00:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jun 2008 04:00:57 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jason.rutherglen@gmail.com designates 209.85.198.227 as permitted sender) Received: from [209.85.198.227] (HELO rv-out-0506.google.com) (209.85.198.227) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jun 2008 11:00:08 +0000 Received: by rv-out-0506.google.com with SMTP id f6so6197255rvb.5 for ; Tue, 17 Jun 2008 04:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=ZGR6cO0hYZEcnNYfT2DmhaL9IBG1cwbwj94vBJjBL9Y=; b=jFKbF796ma36teNBs5EEDvWLZRbMt20XwpQWyRKFuyGLu4BtlWrpwW68Ha5HQSpZmw 3e1YLZZaSU/ulu3CMSkF7WaBMe8d4dp6j3rL9VcO3rLrUm2uAnJPbiuQH8cxkVQMI2HU baOerYnqn7aY9CFFk05E9XzDM0rmqtabicdz4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=CfZqpzfMTRVFV5mPzPdX83A8ZvBDq2u0y4eI2EyWSyPeYTcZpGeGFRGpu++EYUsCWa mdw8LFN/y/8r3XCEtuVBePvF6NFuUwAOTDoFg6SvXd053ppP5SU1GyO5YTcB9WQoDmNt 3OBroCl4ysy++e7BHlPn9Vmg69hQge7UYEyUM= Received: by 10.114.130.1 with SMTP id c1mr7608393wad.152.1213700425760; Tue, 17 Jun 2008 04:00:25 -0700 (PDT) Received: by 10.114.182.2 with HTTP; Tue, 17 Jun 2008 04:00:25 -0700 (PDT) Message-ID: <85d3c3b60806170400n1ad6abc1ud5233958e47a9b2a@mail.gmail.com> Date: Tue, 17 Jun 2008 07:00:25 -0400 From: "Jason Rutherglen" To: java-dev@lucene.apache.org Subject: Re: Obtain IndexCommits from directory In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36998_27891135.1213700425757" References: <85d3c3b60806161735o207a3238sa2e6c415171a8019@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_36998_27891135.1213700425757 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > 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 > > ------=_Part_36998_27891135.1213700425757 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > 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


------=_Part_36998_27891135.1213700425757--