Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      In LUCENE-3539 we fixed IndexInput.toString to always include the resourceDescription.

      I think we should do the same for IndexOutput?

      I don't think Lucene currently uses/relies on IndexOutput.toString, but e.g. at least Elasticsearch does, and likely others, so I think it can only help if you can see which path is open by this IndexOutput.

      1. LUCENE-6084.patch
        10 kB
        Michael McCandless
      2. LUCENE-6084.patch
        8 kB
        Michael McCandless

        Activity

        Hide
        Michael McCandless added a comment -

        Simple patch.

        I left RAMOutputStream as allowing "noname" since we use it in many places for temporary in-memory writing ... but I fixed RAMDirectory to pass it the name.

        Show
        Michael McCandless added a comment - Simple patch. I left RAMOutputStream as allowing "noname" since we use it in many places for temporary in-memory writing ... but I fixed RAMDirectory to pass it the name.
        Hide
        Robert Muir added a comment -

        +1

        Can we look at Lucene50PostingsWriter flushing and corruptindexexception? I know for example, this one (possibly other codecs) try to do some minimal checks against their input (like docid >= 0), but then have a hard time throwing corruptindexexception. this can be a followup issue

        Show
        Robert Muir added a comment - +1 Can we look at Lucene50PostingsWriter flushing and corruptindexexception? I know for example, this one (possibly other codecs) try to do some minimal checks against their input (like docid >= 0), but then have a hard time throwing corruptindexexception. this can be a followup issue
        Hide
        Michael McCandless added a comment -

        New patch, just accepting DataOutput also in CorruptIndexException, and fixing Lucene50PostingsWriter to pass that directly (instead of doing the .toString()) itself ... I couldn't find any other callers that "wanted" to pass a DataOutput.

        Show
        Michael McCandless added a comment - New patch, just accepting DataOutput also in CorruptIndexException, and fixing Lucene50PostingsWriter to pass that directly (instead of doing the .toString()) itself ... I couldn't find any other callers that "wanted" to pass a DataOutput.
        Hide
        Robert Muir added a comment -

        +1, thank you!

        Show
        Robert Muir added a comment - +1, thank you!
        Hide
        ASF subversion and git services added a comment -

        Commit 1642761 from Michael McCandless in branch 'dev/trunk'
        [ https://svn.apache.org/r1642761 ]

        LUCENE-6084: add reasonable IndexOutput.toString

        Show
        ASF subversion and git services added a comment - Commit 1642761 from Michael McCandless in branch 'dev/trunk' [ https://svn.apache.org/r1642761 ] LUCENE-6084 : add reasonable IndexOutput.toString
        Hide
        ASF subversion and git services added a comment -

        Commit 1642762 from Michael McCandless in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1642762 ]

        LUCENE-6084: add reasonable IndexOutput.toString

        Show
        ASF subversion and git services added a comment - Commit 1642762 from Michael McCandless in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1642762 ] LUCENE-6084 : add reasonable IndexOutput.toString
        Hide
        Hoss Man added a comment -

        i think this broke compilation in backward-codecs on 5x?

        Show
        Hoss Man added a comment - i think this broke compilation in backward-codecs on 5x?
        Hide
        Michael McCandless added a comment -

        Argh, you're right! Sorry I'll fix.

        Show
        Michael McCandless added a comment - Argh, you're right! Sorry I'll fix.
        Hide
        Hoss Man added a comment -

        I was about to commit this (didn't see you on IRC) but i'll defer to you as the expert...

        Index: lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40CompoundWriter.java
        ===================================================================
        --- lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40CompoundWriter.java	(revision 1642776)
        +++ lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40CompoundWriter.java	(working copy)
        @@ -306,7 +306,7 @@
         
             DirectCFSIndexOutput(IndexOutput delegate, FileEntry entry,
                 boolean isSeparate) {
        -      super();
        +      super("DirectCFSIndexOutput("+delegate.toString()+",entry=\""+entry.toString()+"\",isSeparate=\""+isSeparate+")");
               this.delegate = delegate;
               this.entry = entry;
               entry.offset = offset = delegate.getFilePointer();
        
        Show
        Hoss Man added a comment - I was about to commit this (didn't see you on IRC) but i'll defer to you as the expert... Index: lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40CompoundWriter.java =================================================================== --- lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40CompoundWriter.java (revision 1642776) +++ lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40CompoundWriter.java (working copy) @@ -306,7 +306,7 @@ DirectCFSIndexOutput(IndexOutput delegate, FileEntry entry, boolean isSeparate) { - super(); + super("DirectCFSIndexOutput("+delegate.toString()+",entry=\""+entry.toString()+"\",isSeparate=\""+isSeparate+")"); this.delegate = delegate; this.entry = entry; entry.offset = offset = delegate.getFilePointer();
        Hide
        ASF subversion and git services added a comment -

        Commit 1642783 from Michael McCandless in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1642783 ]

        LUCENE-6084: add reasonable IndexOutput.toString

        Show
        ASF subversion and git services added a comment - Commit 1642783 from Michael McCandless in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1642783 ] LUCENE-6084 : add reasonable IndexOutput.toString
        Hide
        ASF subversion and git services added a comment -

        Commit 1642785 from Michael McCandless in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1642785 ]

        LUCENE-6084: what Hoss said

        Show
        ASF subversion and git services added a comment - Commit 1642785 from Michael McCandless in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1642785 ] LUCENE-6084 : what Hoss said
        Hide
        Michael McCandless added a comment -

        Thanks Hoss, I committed your version!

        Show
        Michael McCandless added a comment - Thanks Hoss, I committed your version!
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development