Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 32175 invoked from network); 17 Mar 2010 22:17:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Mar 2010 22:17:52 -0000 Received: (qmail 86205 invoked by uid 500); 17 Mar 2010 22:17:51 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 86162 invoked by uid 500); 17 Mar 2010 22:17:51 -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 86155 invoked by uid 99); 17 Mar 2010 22:17:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2010 22:17:51 +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; Wed, 17 Mar 2010 22:17:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 785E8234C4AB for ; Wed, 17 Mar 2010 22:17:27 +0000 (UTC) Message-ID: <979934230.325951268864247492.JavaMail.jira@brutus.apache.org> Date: Wed, 17 Mar 2010 22:17:27 +0000 (UTC) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2320) Add MergePolicy to IndexWriterConfig In-Reply-To: <1121402061.252911268552007313.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-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846619#action_12846619 ] Uwe Schindler commented on LUCENE-2320: --------------------------------------- In that case just remove the test in backwards. If you just replicate it in the same way like in trunk, it does not make sense. > Add MergePolicy to IndexWriterConfig > ------------------------------------ > > Key: LUCENE-2320 > URL: https://issues.apache.org/jira/browse/LUCENE-2320 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Reporter: Shai Erera > Assignee: Michael McCandless > Fix For: 3.1 > > Attachments: LUCENE-2320.patch, LUCENE-2320.patch, LUCENE-2320.patch, LUCENE-2320.patch > > > Now that IndexWriterConfig is in place, I'd like to move MergePolicy to it as well. The change is not straightforward and so I've kept it for a separate issue. MergePolicy requires in its ctor an IndexWriter, however none can be passed to it before an IndexWriter actually exists. And today IW may create an MP just for it to be overridden by the application one line afterwards. I don't want to make iw member of MP non-final, or settable by extending classes, however it needs to remain protected so they can access it directly. So the proposed changes are: > * Add a SetOnce object (to o.a.l.util), or Immutable, which can only be set once (hence its name). It'll have the signature SetOnce w/ *synchronized set* and *T get()*. T will be declared volatile, so that get() won't be synchronized. > * MP will define a *protected final SetOnce writer* instead of the current writer. *NOTE: this is a bw break*. any suggestions are welcomed. > * MP will offer a public default ctor, together with a set(IndexWriter). > * IndexWriter will set itself on MP using set(this). Note that if set will be called more than once, it will throw an exception (AlreadySetException - or does someone have a better suggestion, preferably an already existing Java exception?). > That's the core idea. I'd like to post a patch soon, so I'd appreciate your review and proposals. -- 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