Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-82

row keys should be array of bytes

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.2.0
    • None
    • None

    Description

      I have heard from several people that row keys in HBase should be less restricted than hadoop.io.Text.

      What do you think?

      At the very least, a row key has to be a WritableComparable. This would lead to the most general case being either hadoop.io.BytesWritable or hbase.io.ImmutableBytesWritable. The primary difference between these two classes is that hadoop.io.BytesWritable by default allocates 100 bytes and if you do not pay attention to the length, (BytesWritable.getSize()), converting a String to a BytesWritable and vice versa can become problematic.

      hbase.io.ImmutableBytesWritable, in contrast only allocates as many bytes as you pass in and then does not allow the size to be changed.

      If we were to change from Text to a non-text key, my preference would be for ImmutableBytesWritable, because it has a fixed size once set, and operations like get, etc do not have to something like System.arrayCopy where you specify the number of bytes to copy.

      Your comments, questions are welcome on this issue. If we receive enough feedback that Text is too restrictive, we are willing to change it, but we need to hear what would be the most useful thing to change it to as well.

      Attachments

        1. 82.patch
          227 kB
          Michael Stack
        2. 82-v12-ignore-ws.patch
          707 kB
          Michael Stack
        3. 82-v13-ignore-ws.patch
          717 kB
          Michael Stack
        4. 82-v2.patch
          242 kB
          Michael Stack
        5. 82-v3.patch
          354 kB
          Michael Stack
        6. 82-v4.patch
          448 kB
          Michael Stack
        7. 82-v5.patch
          611 kB
          Michael Stack
        8. 82-v7.patch
          649 kB
          Michael Stack
        9. 82-v8.patch
          695 kB
          Michael Stack
        10. 82-v9-ignore-ws.patch
          703 kB
          Michael Stack
        11. Perf.java
          2 kB
          Michael Stack

        Issue Links

          Activity

            People

              stack Michael Stack
              jimk Jim Kellerman
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: