Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-9245 Remove dead or deprecated code from hbase 0.96
  3. HBASE-9262

Make KeyValue.KEY_COMPARATOR default for HFile WriterFactory

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.98.0, 0.95.2
    • 0.98.0, 0.96.0
    • None
    • None
    • Reviewed
    • Hide
      Previously, when using a WriterFactory to create an HFile writer, the HFile Writer would default to using a raw byte array comparator instead of one that was aware of the a KV's Key structure. All actual instances of HFileWriter creation required the specification of a KEY_COMPARATOR. With this modification the KEY_COMPARATOR becomes the default, and we add a special comparator for unit tests that required the rare old default semantics.
      Show
      Previously, when using a WriterFactory to create an HFile writer, the HFile Writer would default to using a raw byte array comparator instead of one that was aware of the a KV's Key structure. All actual instances of HFileWriter creation required the specification of a KEY_COMPARATOR. With this modification the KEY_COMPARATOR becomes the default, and we add a special comparator for unit tests that required the rare old default semantics.

    Description

      This takes completed work mentioned in HBASE-9247 as a reasonably sized patch to build upon.

      • Fixed defaults in HFile.Writer factory to default to Key-format-aware comparator (KeyComparator, later converted to KVComparator) instead of a Key-format oblivious byte[] comparator. (Essentially all instances require specifying KEY_COMPARATOR – why not just make it the default).
        • Found that TestSeekTo, TestReseekTo and a handful of others depend on a different comparator because – HBASE-7845 "breaks" assumptions in these tests.
      • Moved getComparator into TableName. (removed an instanceof bad smell)

      Attachments

        1. hbase-9262.v2.95.patch
          33 kB
          Jonathan Hsieh
        2. hbase-9262.v2.patch
          36 kB
          Jonathan Hsieh
        3. hbase-9262.patch
          33 kB
          Jonathan Hsieh

        Activity

          People

            jmhsieh Jonathan Hsieh
            jmhsieh Jonathan Hsieh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: