You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (Created) (JIRA)" <ji...@apache.org> on 2011/11/06 17:00:51 UTC

[jira] [Created] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

rename IndexWriter.rollback to .rollbackAndClose
------------------------------------------------

                 Key: LUCENE-3564
                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
             Project: Lucene - Java
          Issue Type: Improvement
            Reporter: Michael McCandless
            Assignee: Michael McCandless
             Fix For: 3.5, 4.0


Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.

I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Michael McCandless (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3564:
---------------------------------------

    Fix Version/s:     (was: 3.6)
    
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145225#comment-13145225 ] 

Shai Erera commented on LUCENE-3564:
------------------------------------

I briefly looked at rollback impl, and found this comment:

{code}
        // Keep the same segmentInfos instance but replace all
        // of its SegmentInfo instances.  This is so the next
        // attempt to commit using this instance of IndexWriter
        // will always write to a new generation ("write
        // once").
{code}

But if this instance of IndexWriter is closed, this comment has no meaning right? Does it mean that once rollback() didn't close IW?
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Resolved] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-3564.
----------------------------------------

    Resolution: Won't Fix

Yeah I think so.  Naming is the hardest part :)
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 4.1
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145668#comment-13145668 ] 

Michael McCandless commented on LUCENE-3564:
--------------------------------------------


bq. I personally think that we're going overboard with these methods rename (including IR.openIfChanged !)

Actually I think the "traps" you've been pointing out have been
excellent examples of poorly named methods.  Please keep pointing them
out!

API design/naming is not easy, and generally developers are unable to
name things properly because we are too familiar with the code to see
what traps users.

The old IR.reopen has trapped users (two separate traps).  I think the
change in semantics (return null if there is no change), and rename
and cutover to static method, are important steps forward (addressed
the traps).

We can't anticipate all traps when we name our APIs but if users show
us over time that they are trappy we should try to address them when
possible.

bq. Is there a way to rollback without closing? That would seem far more useful.

There isn't today... I agree this would be useful.  I don't remember
off hand why the current one has to close after rollback...

Though, it's not so bad having to open a new writer afterwards?

Ie, unlike the commit case (before we had the commit method), where
having to do IW.close() to "commit" was bad because you may block
waiting for long merge(s) to complete, rollback() is fast since it
aborts all running merges.

bq. My personal preference for this API is the current simple and short name rollback().

I like short names too, but not if they are misleading/surprising (as
Shai pointed out, this one really is).

I guess it's OK to leave rollback as "short but misleading"; it's a
fairly expert API.  Also, it quickly becomes obvious to the user that
the IW was closed, so it's "fail fast" and the damage is not nearly as
bad as what we see when users don't understand the cost of optimize.

                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147388#comment-13147388 ] 

Michael McCandless commented on LUCENE-3564:
--------------------------------------------


bq. Sorry, I was confused with the IfNeeded from LUCENE-3454. But I don't like 'IfChanged' too . I think that should be part of the javadocs.

It sounds like we disagree on what's important/salient enough to
warrant inclusion in the name.

I think principle of least surprise applies here: it's surprising that
this API can return null, so the "ifChanged" conveys that there is
something conditional about it.

If anything is off I think it's that the current name (openIfChanged)
fails to convey the "sharing" that happens, ie, that this is a fast
operation because it shares sub-readers with the incoming reader.  But
trying to work that into the name (openSharedIfChanged?) is
awkward... any ideas?

bq. Here's a proposal – if we think our users find these names confusing, why don't we do a poll on java-user and get people to vote on whether they find these names confusing? Because it looks to me like it's a flavor thing - some of us prefer to read javadocs while others prefer methods names that tell us what they do, without reading javadocs.

We can certainly do this but I don't think the results will be very
useful (they will naturally suffer badly from sampling bias).  Ie, the
users who respond are the active ones, the more expert ones, ones
already familiar with the old naming, etc.  The more normal users, the
ones more likely to be trapped, rarely read the list.

I think user polls / focus groups / etc. are rarely useful.

So you're free to send such a poll; the results could be interesting,
but I don't think it's a good way for us to name methods in general.

bq. I don't find that openIfChanged saves me from reading the javadocs, because I still need to read them in order to know what will be returned if the reader hasn't changed.

Remember code is written only once and the
read/copied/refactored/shared many more times; the initial writing is
much less important than subsequent readability.

                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Yonik Seeley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145033#comment-13145033 ] 

Yonik Seeley commented on LUCENE-3564:
--------------------------------------

Is there a way to rollback without closing?  That would seem far more useful.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13146841#comment-13146841 ] 

Shai Erera commented on LUCENE-3564:
------------------------------------

Sorry, I was confused with the IfNeeded from LUCENE-3454. But I don't like 'IfChanged' too :). I think that should be part of the javadocs.

Here's a proposal -- if we think our users find these names confusing, why don't we do a poll on java-user and get people to vote on whether they find these names confusing? Because it looks to me like it's a flavor thing - some of us prefer to read javadocs while others prefer methods names that tell us what they do, without reading javadocs.

I don't find that openIfChanged saves me from reading the javadocs, because I still need to read them in order to know what will be returned if the reader hasn't changed.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Steven Rowe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457950#comment-13457950 ] 

Steven Rowe commented on LUCENE-3564:
-------------------------------------

bq. I guess it's OK to leave rollback as "short but misleading"; it's a
fairly expert API. Also, it quickly becomes obvious to the user that
the IW was closed, so it's "fail fast" and the damage is not nearly as
bad as what we see when users don't understand the cost of optimize.

Mike, should this issue be resolved as "won't fix"?
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 4.1
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151083#comment-13151083 ] 

Shai Erera commented on LUCENE-3564:
------------------------------------

Just a note: whatever we do here, we should also do to TwoPhaseCommit. This will happen automatically since IW implements it, but I thought to point it out since the change to TPC will also affect the facet's DirectoryTaxonmyWriter.

Also, let's not hold up this issue. Go on with the change.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13146667#comment-13146667 ] 

Michael McCandless commented on LUCENE-3564:
--------------------------------------------

bq. I fully agree with the change in semantics of the API, but why did we have to add the 'IfNeeded' part?

Actually it's 'ifChanged' not 'ifNeeded'.

bq. What's wrong with just reopen() (as static)?

Because reopen implies it's reopening the reader in-place, when it's
not (this tripped up some users).  It's opening a new reader, sharing
what it can with the old one.

bq. BTW, when I call an .open() API, I expect it to do it, and not 'IfNeeded', so I don't like it. We still have time to fix it before we release 3.5.

Right, and that's why we didn't name it just '.open'... the
'ifChanged' is conveying that no opening will take place if there has
been no change to the index.

                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13146103#comment-13146103 ] 

Shai Erera commented on LUCENE-3564:
------------------------------------

{quote}
The old IR.reopen has trapped users (two separate traps). I think the
change in semantics (return null if there is no change), and rename
and cutover to static method, are important steps forward (addressed
the traps).
{quote}

I fully agree with the change in semantics of the API, but why did we have to add the 'IfNeeded' part? What's wrong with just reopen() (as static)? BTW, when I call an .open() API, I expect it to do it, and not 'IfNeeded', so I don't like it. We still have time to fix it before we release 3.5.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145081#comment-13145081 ] 

Shai Erera commented on LUCENE-3564:
------------------------------------

Oh no, what have I done !? :)

I too agree we should not rename rollback to rollbackAndClose. And I second Yonik's question - why do we have to close when we rollback?

I personally think that we're going overboard with these methods rename (including IR.openIfChanged !), but if we're at "renaming methods with unexpected outcome", how about renaming addDocument to addDocumentButIfYouHitOOMYouShouldClose? ;)
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Mark Miller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145106#comment-13145106 ] 

Mark Miller commented on LUCENE-3564:
-------------------------------------

bq. My personal preference for this API is the current simple and short name rollback().

+1
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Mark Miller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145988#comment-13145988 ] 

Mark Miller commented on LUCENE-3564:
-------------------------------------

{quote} API design/naming is not easy, and generally developers are unable to
name things properly because we are too familiar with the code to see
what traps users. {quote}

I don't fully buy that. I think it generally makes us better at naming and that the supposed traps are generally a small percentage of the users running into problems because our javadoc has often sucked.

bq. I guess it's OK to leave rollback as "short but misleading"; 

It's not misleading if the javadoc explains the indexwriter is closed. Ive said it before, but its worth saying again - trying to design API's for those that doesn't read the javadoc is a poor move. Most of the problems we see can be traced back to not having javadoc that fully explains things, not poorly named methods.

bq. users don't understand the cost of optimize.

Users didn't understand the cost of optimize because the javadoc never explained the cost in the past. It simply said this makes things better. The method name was never the problem if you ask me. People read javadoc because only morons program by method name. Often our javadoc has not explained the problems that have been brought up well in the past.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Shai Erera (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13147576#comment-13147576 ] 

Shai Erera commented on LUCENE-3564:
------------------------------------

Ok, I think the API looks bad that way. If you don't want to do a poll on java-user, then perhaps we should let people vote on dev@ on the principle of naming. I don't suggest to call out a vote whenever we want to rename something. I feel that the way we're going will only make the API ugly-er. It's a style thing, so you and I can debate on it forever :), but I think that we both agree that it's important.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Comment Edited] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Steven Rowe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457950#comment-13457950 ] 

Steven Rowe edited comment on LUCENE-3564 at 9/19/12 3:56 AM:
--------------------------------------------------------------

{quote}
I guess it's OK to leave rollback as "short but misleading"; it's a
fairly expert API. Also, it quickly becomes obvious to the user that
the IW was closed, so it's "fail fast" and the damage is not nearly as
bad as what we see when users don't understand the cost of optimize.
{quote}

Mike, should this issue be resolved as "won't fix"?
                
      was (Author: steve_rowe):
    bq. I guess it's OK to leave rollback as "short but misleading"; it's a
fairly expert API. Also, it quickly becomes obvious to the user that
the IW was closed, so it's "fail fast" and the damage is not nearly as
bad as what we see when users don't understand the cost of optimize.

Mike, should this issue be resolved as "won't fix"?
                  
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 4.1
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Doron Cohen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145045#comment-13145045 ] 

Doron Cohen commented on LUCENE-3564:
-------------------------------------

My personal preference for this API is the current simple and short name *rollback()*.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3564) rename IndexWriter.rollback to .rollbackAndClose

Posted by "Mark Miller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145104#comment-13145104 ] 

Mark Miller commented on LUCENE-3564:
-------------------------------------

bq. Is there a way to rollback without closing? That would seem far more useful.

For a little while in one of my updatehandler patches I added code to open back up the IndexWriter after it closed in rollback - not sure if you could just not close super simply or not, so I just hacked around it - nice when you don't want to sync around the indexwriter and someone calls rollback - I didn't want to replace the IndexWriter with a new one after the rollback. Eventually I just went another route above Lucene though.
                
> rename IndexWriter.rollback to .rollbackAndClose
> ------------------------------------------------
>
>                 Key: LUCENE-3564
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3564
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>
> Spinoff from LUCENE-3454, where Shai noticed that rollback is trappy since it [unexpected] closes the IW.
> I think we should rename it to rollbackAndClose.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org