Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 36105 invoked from network); 11 Sep 2008 17:30:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 17:30:38 -0000 Received: (qmail 6321 invoked by uid 500); 11 Sep 2008 17:30:32 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 6286 invoked by uid 500); 11 Sep 2008 17:30:32 -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 6277 invoked by uid 99); 11 Sep 2008 17:30:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 10:30:32 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 17:29:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9A3F4234C1E4 for ; Thu, 11 Sep 2008 10:29:44 -0700 (PDT) Message-ID: <219463140.1221154184630.JavaMail.jira@brutus> Date: Thu, 11 Sep 2008 10:29:44 -0700 (PDT) From: "Otis Gospodnetic (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-112) [PATCH] Add an IndexReader implementation that frees resources when idle and refreshes itself when stale MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630265#action_12630265 ] Otis Gospodnetic commented on LUCENE-112: ----------------------------------------- +1 for closing it. Half a decade ago.... > [PATCH] Add an IndexReader implementation that frees resources when idle and refreshes itself when stale > -------------------------------------------------------------------------------------------------------- > > Key: LUCENE-112 > URL: https://issues.apache.org/jira/browse/LUCENE-112 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: CVS Nightly - Specify date in submission > Environment: Operating System: All > Platform: All > Reporter: Eric Isakson > Priority: Minor > Attachments: IdleTimeoutRefreshingIndexReader.html, IdleTimeoutRefreshingIndexReader.java > > > Here is a little something I worked on this weekend that I wanted to contribute > back as I think others might find it very useful. > I extended IndexReader and added support for configuring an idle timeout and > refresh interval. > It uses a monitoring thread to watch for the reader going idle. When the reader > goes idle it is closed. When the index is read again it is re-opened. > It uses another thread to periodically check when the reader needs to be > refreshed due to a change to index. When the reader is stale, it closes the > reader and reopens the index. > It is acually delegating all the work to another IndexReader implementation and > just handling the threading and synchronization. When it closes a reader, it > delegates the close to another thread that waits a bit (configurable how long) > before actually closing the reader it was delegating to. This gives any > consumers of the original reader a chance to finish up their last action on the > reader. > This implementation sacrifices a little bit of speed since there is a bit more > synchroniztion to deal with and the delegation model puts extra calls on the > stack, but it should provide long running applications that have idle periods > or frequently changing indices from having to open and close readers all the > time or hold open unused resources. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org