Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 77058 invoked from network); 26 Mar 2010 11:18:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Mar 2010 11:18:51 -0000 Received: (qmail 77638 invoked by uid 500); 26 Mar 2010 11:18:51 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 77450 invoked by uid 500); 26 Mar 2010 11:18:50 -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 77443 invoked by uid 99); 26 Mar 2010 11:18:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Mar 2010 11:18:50 +0000 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; Fri, 26 Mar 2010 11:18:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3E961234C4B2 for ; Fri, 26 Mar 2010 11:18:27 +0000 (UTC) Message-ID: <2061585330.507401269602307255.JavaMail.jira@brutus.apache.org> Date: Fri, 26 Mar 2010 11:18:27 +0000 (UTC) From: "Earwin Burrfoot (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2345) Make it possible to subclass SegmentReader In-Reply-To: <1758420852.467901269456087167.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850088#action_12850088 ] Earwin Burrfoot commented on LUCENE-2345: ----------------------------------------- bq. Earwin, can you post a patch w/ your current state, even if it's "rough"? Ahem. Right now it's more or less finished for Multi/Directory/MutableDirectory/WriterBackedDirectory-readers. But the SegmentReader is in shambles (i.e. does not compile yet). Should I post asis? > Make it possible to subclass SegmentReader > ------------------------------------------ > > Key: LUCENE-2345 > URL: https://issues.apache.org/jira/browse/LUCENE-2345 > Project: Lucene - Java > Issue Type: Wish > Components: Index > Reporter: Tim Smith > Fix For: 3.1 > > Attachments: LUCENE-2345_3.0.patch > > > I would like the ability to subclass SegmentReader for numerous reasons: > * to capture initialization/close events > * attach custom objects to an instance of a segment reader (caches, statistics, so on and so forth) > * override methods on segment reader as needed > currently this isn't really possible > I propose adding a SegmentReaderFactory that would allow creating custom subclasses of SegmentReader > default implementation would be something like: > {code} > public class SegmentReaderFactory { > public SegmentReader get(boolean readOnly) { > return readOnly ? new ReadOnlySegmentReader() : new SegmentReader(); > } > public SegmentReader reopen(SegmentReader reader, boolean readOnly) { > return newSegmentReader(readOnly); > } > } > {code} > It would then be made possible to pass a SegmentReaderFactory to IndexWriter (for pooled readers) as well as to SegmentReader.get() (DirectoryReader.open, etc) > I could prepare a patch if others think this has merit > Obviously, this API would be "experimental/advanced/will change in future" -- 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