Lucene - Core
  1. Lucene - Core
  2. LUCENE-5739

Add zig-zag encoding support to DataInput/DataOutput

    Details

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

      Description

      It would be convenient to have support for zig-zag-encoded integers in DataInput/DataOutput. There are not many places that use that feature today but I think it's quite common to need to read/write small signed values.

      1. LUCENE-5739.patch
        11 kB
        Adrien Grand
      2. LUCENE-5739.patch
        6 kB
        Adrien Grand

        Activity

        Hide
        Adrien Grand added a comment -

        Here is a patch.

        Show
        Adrien Grand added a comment - Here is a patch.
        Hide
        Adrien Grand added a comment -

        I know there is a long history of discussions around supporting negative values in writeVLong but I think it would be nice so that the whole long range could be readable/writable with zig-zag encoding?

        Show
        Adrien Grand added a comment - I know there is a long history of discussions around supporting negative values in writeVLong but I think it would be nice so that the whole long range could be readable/writable with zig-zag encoding?
        Hide
        Adrien Grand added a comment -

        Here is an updated patch:

        • more tests,
        • ZLong supports the whole long range but vLong still only supports positive values.
        Show
        Adrien Grand added a comment - Here is an updated patch: more tests, ZLong supports the whole long range but vLong still only supports positive values.
        Hide
        Robert Muir added a comment -

        Looks good, thanks Adrien.

        Show
        Robert Muir added a comment - Looks good, thanks Adrien.
        Hide
        ASF subversion and git services added a comment -

        Commit 1614870 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1614870 ]

        LUCENE-5739: Add DataInput.readZ(Int|Long) and DataOutput.writeZ(Int|Long).

        Show
        ASF subversion and git services added a comment - Commit 1614870 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1614870 ] LUCENE-5739 : Add DataInput.readZ(Int|Long) and DataOutput.writeZ(Int|Long).
        Hide
        ASF subversion and git services added a comment -

        Commit 1614873 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1614873 ]

        LUCENE-5739: Fix CHANGES version.

        Show
        ASF subversion and git services added a comment - Commit 1614873 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1614873 ] LUCENE-5739 : Fix CHANGES version.
        Hide
        ASF subversion and git services added a comment -

        Commit 1614874 from Adrien Grand in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1614874 ]

        LUCENE-5739: Add DataInput.readZ(Int|Long) and DataOutput.writeZ(Int|Long).

        Show
        ASF subversion and git services added a comment - Commit 1614874 from Adrien Grand in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1614874 ] LUCENE-5739 : Add DataInput.readZ(Int|Long) and DataOutput.writeZ(Int|Long).
        Hide
        Adrien Grand added a comment -

        Thanks Robert.

        Show
        Adrien Grand added a comment - Thanks Robert.

          People

          • Assignee:
            Adrien Grand
            Reporter:
            Adrien Grand
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development