Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

[jira] Commented: (LUCENE-1558) Make IndexReader/Searcher ctors readOnly=true by default

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


jira at apache

Nov 12, 2009, 12:26 PM

Post #1 of 3 (234 views)
Permalink
[jira] Commented: (LUCENE-1558) Make IndexReader/Searcher ctors readOnly=true by default

[ https://issues.apache.org/jira/browse/LUCENE-1558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777162#action_12777162 ]

Mark Miller commented on LUCENE-1558:
-------------------------------------

Ah - didn't see this issue and assumed Uwe's change was what we were going with so I updated the javadoc to reflect. If we change again, it will need another tweak (adding back that its the current default).

> Make IndexReader/Searcher ctors readOnly=true by default
> --------------------------------------------------------
>
> Key: LUCENE-1558
> URL: https://issues.apache.org/jira/browse/LUCENE-1558
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 2.4.1
> Reporter: Michael McCandless
> Assignee: Michael McCandless
> Fix For: 3.0
>
>
> Another "change the defaults" in 3.0.
> Right now you get a read/write reader from IndexReader.open and new IndexSearcher(...), and reserving the right to write causes thread contention (on isDeleted).
> In 3.0 let's make readOnly reader the default, but still allow opening a read/write IndexReader.

--
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 [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Nov 14, 2009, 2:09 AM

Post #2 of 3 (214 views)
Permalink
[jira] Commented: (LUCENE-1558) Make IndexReader/Searcher ctors readOnly=true by default [In reply to]

[ https://issues.apache.org/jira/browse/LUCENE-1558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777864#action_12777864 ]

Michael McCandless commented on LUCENE-1558:
--------------------------------------------

bq. Personally, I'm not so sure its a bad idea making the user specify as it is now

The thing is, I expect the vast majority of users use readOnly=true, and to those users they would be baffled that IndexReader even has a readOnly=false possibility. "Simple things should be simple". Also, the exception that's thrown if you attempt a write operation against a readOnly reader is pretty darned clear about what's gone wrong:

throw new UnsupportedOperationException("This IndexReader cannot make any changes to the index (it was opened with readOnly = true)");

(We can reword it to say something like "You must open the IndexReader with readOnly=false to make changes" or some such).

In other cases, I would agree we should force sneaky parameters to be explicit on construction, so users think about the choice. EG we did this with maxFieldLength to IndexWriter, because in that case the truncation was silent, actually resulted in losing indexed content, and we saw from our user's that it tripped people up far too often. But I don't think this case fits that same pattern...

> Make IndexReader/Searcher ctors readOnly=true by default
> --------------------------------------------------------
>
> Key: LUCENE-1558
> URL: https://issues.apache.org/jira/browse/LUCENE-1558
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 2.4.1
> Reporter: Michael McCandless
> Assignee: Michael McCandless
> Fix For: 3.0
>
>
> Another "change the defaults" in 3.0.
> Right now you get a read/write reader from IndexReader.open and new IndexSearcher(...), and reserving the right to write causes thread contention (on isDeleted).
> In 3.0 let's make readOnly reader the default, but still allow opening a read/write IndexReader.

--
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 [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Nov 14, 2009, 2:20 PM

Post #3 of 3 (207 views)
Permalink
[jira] Commented: (LUCENE-1558) Make IndexReader/Searcher ctors readOnly=true by default [In reply to]

[ https://issues.apache.org/jira/browse/LUCENE-1558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778005#action_12778005 ]

Uwe Schindler commented on LUCENE-1558:
---------------------------------------

I am +/- 0 for adding these defaults to the ctors.

Mike, do you have a patch? I think IndexSearcher.ctor and IndexReader.open() are the only affected code parts.

> Make IndexReader/Searcher ctors readOnly=true by default
> --------------------------------------------------------
>
> Key: LUCENE-1558
> URL: https://issues.apache.org/jira/browse/LUCENE-1558
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 2.4.1
> Reporter: Michael McCandless
> Assignee: Michael McCandless
> Fix For: 3.0
>
>
> Another "change the defaults" in 3.0.
> Right now you get a read/write reader from IndexReader.open and new IndexSearcher(...), and reserving the right to write causes thread contention (on isDeleted).
> In 3.0 let's make readOnly reader the default, but still allow opening a read/write IndexReader.

--
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 [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.