Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 99736 invoked from network); 3 Dec 2010 09:23:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Dec 2010 09:23:34 -0000 Received: (qmail 53001 invoked by uid 500); 3 Dec 2010 09:23:33 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 52642 invoked by uid 500); 3 Dec 2010 09:23:32 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 52635 invoked by uid 99); 3 Dec 2010 09:23:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Dec 2010 09:23:31 +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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Dec 2010 09:23:31 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oB39NBew022962 for ; Fri, 3 Dec 2010 09:23:11 GMT Message-ID: <26000430.90811291368191102.JavaMail.jira@thor> Date: Fri, 3 Dec 2010 04:23:11 -0500 (EST) From: "Michael McCandless (JIRA)" To: dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2779) Use ConcurrentHashMap in RAMDirectory In-Reply-To: <10750696.314731290706214515.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966457#action_12966457 ] Michael McCandless commented on LUCENE-2779: -------------------------------------------- bq. If the assumption still stands that an IndexInput will not be opened on a "writing" / unclosed IndexOutput, then RAMFile can also be improved when it comes to concurrency. This assumption does still stand, and our unit tests now assert this -- MockDirWrapper throws an exception if we ever try to open an II when an IO is still open against that file. That said... we are considering relaxing this, because RT search needs to be able to access the doc stores with an II even as IO is appending to it. > Use ConcurrentHashMap in RAMDirectory > ------------------------------------- > > Key: LUCENE-2779 > URL: https://issues.apache.org/jira/browse/LUCENE-2779 > Project: Lucene - Java > Issue Type: Improvement > Components: Store > Reporter: Shai Erera > Assignee: Shai Erera > Priority: Minor > Fix For: 3.1, 4.0 > > Attachments: LUCENE-2779-backwardsfix.patch, LUCENE-2779.patch, LUCENE-2779.patch, LUCENE-2779.patch, LUCENE-2779.patch, TestCHM.java > > > RAMDirectory synchronizes on its instance in many places to protect access to map of RAMFiles, in addition to updating the sizeInBytes member. In many places the sync is done for 'read' purposes, while only in few places we need 'write' access. This looks like a perfect use case for ConcurrentHashMap > Also, syncing around sizeInBytes is unnecessary IMO, since it's an AtomicLong ... > I'll post a patch shortly. -- 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: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org