Accumulo
  1. Accumulo
  2. ACCUMULO-1897

Bug in MemKeyConversionIterator constructor

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0, 1.5.1
    • Fix Version/s: 1.5.2, 1.6.0
    • Component/s: tserver
    • Labels:
      None

      Description

      The constructor for InMemoryMap.MemKeyConversionIterator which takes a starting key does not correctly clone the key. The parameter to the constructor is startKey, but the code looks at the currKey field to check whether a key is available.

      if (currKey != null)  // <- should be startKey != null
              currKey = (MemKey) startKey.clone();
      

      This class was introduced in version 1.5.0, and is not present in 1.4.x.

        Activity

        Hide
        Sean Busbey added a comment -

        I believe this constructor can be removed.

        1. AFAICT, it's only used in the deepCopy implementation.
        2. the API for deepCopy says that it makes a copy as if seek() has not been called
        3. all of the other methods require a seek call before they can be used
        4. seek overwrites currKey

        Rather than add a test to express this error and fix it, we should pull the Constructor and update deepCopy to use the single argument constructor.

        Show
        Sean Busbey added a comment - I believe this constructor can be removed. AFAICT, it's only used in the deepCopy implementation. the API for deepCopy says that it makes a copy as if seek() has not been called all of the other methods require a seek call before they can be used seek overwrites currKey Rather than add a test to express this error and fix it, we should pull the Constructor and update deepCopy to use the single argument constructor.
        Hide
        Sean Busbey added a comment -

        Patch to remove incorrect constructor.

        Show
        Sean Busbey added a comment - Patch to remove incorrect constructor.
        Hide
        Mike Drob added a comment -

        +1

        Show
        Mike Drob added a comment - +1
        Hide
        ASF subversion and git services added a comment -

        Commit 75d62a46279aa448c386d7408a4268b0fe842c20 in accumulo's branch refs/heads/1.5.2-SNAPSHOT from Sean Busbey
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=75d62a4 ]

        ACCUMULO-1897 removes unneeded constructor for MemKeyConversionIterator.

        Signed-off-by: Mike Drob <mdrob@cloudera.com>

        Show
        ASF subversion and git services added a comment - Commit 75d62a46279aa448c386d7408a4268b0fe842c20 in accumulo's branch refs/heads/1.5.2-SNAPSHOT from Sean Busbey [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=75d62a4 ] ACCUMULO-1897 removes unneeded constructor for MemKeyConversionIterator. Signed-off-by: Mike Drob <mdrob@cloudera.com>
        Hide
        ASF subversion and git services added a comment -

        Commit 75d62a46279aa448c386d7408a4268b0fe842c20 in accumulo's branch refs/heads/1.6.0-SNAPSHOT from Sean Busbey
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=75d62a4 ]

        ACCUMULO-1897 removes unneeded constructor for MemKeyConversionIterator.

        Signed-off-by: Mike Drob <mdrob@cloudera.com>

        Show
        ASF subversion and git services added a comment - Commit 75d62a46279aa448c386d7408a4268b0fe842c20 in accumulo's branch refs/heads/1.6.0-SNAPSHOT from Sean Busbey [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=75d62a4 ] ACCUMULO-1897 removes unneeded constructor for MemKeyConversionIterator. Signed-off-by: Mike Drob <mdrob@cloudera.com>
        Hide
        ASF subversion and git services added a comment -

        Commit 75d62a46279aa448c386d7408a4268b0fe842c20 in accumulo's branch refs/heads/master from Sean Busbey
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=75d62a4 ]

        ACCUMULO-1897 removes unneeded constructor for MemKeyConversionIterator.

        Signed-off-by: Mike Drob <mdrob@cloudera.com>

        Show
        ASF subversion and git services added a comment - Commit 75d62a46279aa448c386d7408a4268b0fe842c20 in accumulo's branch refs/heads/master from Sean Busbey [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=75d62a4 ] ACCUMULO-1897 removes unneeded constructor for MemKeyConversionIterator. Signed-off-by: Mike Drob <mdrob@cloudera.com>
        Hide
        ASF subversion and git services added a comment -

        Commit bcc9e7e41c9a40cc36502fece266780c7cba0de8 in accumulo's branch refs/heads/master from Mike Drob
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=bcc9e7e ]

        ACCUMULO-1897 Move shell into new package and module

        Show
        ASF subversion and git services added a comment - Commit bcc9e7e41c9a40cc36502fece266780c7cba0de8 in accumulo's branch refs/heads/master from Mike Drob [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=bcc9e7e ] ACCUMULO-1897 Move shell into new package and module
        Hide
        Mike Drob added a comment -

        Commit bcc9e7 really belongs to ACCUMULO-1879.

        Show
        Mike Drob added a comment - Commit bcc9e7 really belongs to ACCUMULO-1879 .
        Hide
        ASF subversion and git services added a comment -

        Commit b2b985e240b90cb3645a9d7d4d8469d660961d1b in accumulo's branch refs/heads/master from Mike Drob
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=b2b985e ]

        Revert "ACCUMULO-1897 Move shell into new package and module"

        This reverts commit bcc9e7e41c9a40cc36502fece266780c7cba0de8.

        Show
        ASF subversion and git services added a comment - Commit b2b985e240b90cb3645a9d7d4d8469d660961d1b in accumulo's branch refs/heads/master from Mike Drob [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=b2b985e ] Revert " ACCUMULO-1897 Move shell into new package and module" This reverts commit bcc9e7e41c9a40cc36502fece266780c7cba0de8.

          People

          • Assignee:
            Sean Busbey
            Reporter:
            Bill Havanki
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development