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

Convert KeyValue to Cell in hbase-client module - Result/Put/Delete, ColumnInterpreter

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.95.2
    • 0.98.0, 0.96.0
    • Client
    • None
    • Reviewed
    • Hide
      The signature for several methods on Put, Result, ColumnInterpreter, and BaseRegionObserver have been modified to use the Cell interface instead of KeyValues. Applications need to convert KeyValue and List<KeyValue> to Cell and List<Cell>. The changes are summarized here:

      Put:
      - public List<KeyValue> get(byte[] family, byte[] qualifier)
      + public List<Cell> get(byte[] family, byte[] qualifier)

      Result:
      - public KeyValue[] raw() {
      + public Cell[] raw() {

      - public List<KeyValue> list() {
      + public List<Cell> list() {

      - public List<KeyValue> getColumn(byte [] family, byte [] qualifier) {
      + public List<Cell> getColumn(byte [] family, byte [] qualifier) {

      - public KeyValue getColumnLatest(byte [] family, byte [] qualifier) {
      + public Cell getColumnLatest(byte [] family, byte [] qualifier) {

      - public KeyValue getColumnLatest(byte [] family, int foffset, int flength,
      + public Cell getColumnLatest(byte [] family, int foffset, int flength,
             byte [] qualifier, int qoffset, int qlength) {

      For extension interfaces BaseRegionObserver and ColumnInterpreter, we have kept both the old and new signature, including a shim that has the abstract implementation helper have the new call the old implementation. For the shim to handle the List<KeyValue> -> List<Cell> conversion, we use an expensive naive array copy. It is strongly recommended that the new coprocessors are updated to override the new undeprecated API.

      ColumnInterpreter: (abstract class)
      - public abstract T getValue(byte[] colFamily, byte[] colQualifier, KeyValue kv)
      + public abstract T getValue(byte[] colFamily, byte[] colQualifier, Cell kv)
       
      BaseRegionObserver: (abstract class)
      RegionObserver: (inteface)
         void preGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
      - final List<KeyValue> result)
      + final List<Cell> result)
           throws IOException;
         void postGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
      - final List<KeyValue> result)
      + final List<Cell> result)
           throws IOException;
      Show
      The signature for several methods on Put, Result, ColumnInterpreter, and BaseRegionObserver have been modified to use the Cell interface instead of KeyValues. Applications need to convert KeyValue and List<KeyValue> to Cell and List<Cell>. The changes are summarized here: Put: - public List<KeyValue> get(byte[] family, byte[] qualifier) + public List<Cell> get(byte[] family, byte[] qualifier) Result: - public KeyValue[] raw() { + public Cell[] raw() { - public List<KeyValue> list() { + public List<Cell> list() { - public List<KeyValue> getColumn(byte [] family, byte [] qualifier) { + public List<Cell> getColumn(byte [] family, byte [] qualifier) { - public KeyValue getColumnLatest(byte [] family, byte [] qualifier) { + public Cell getColumnLatest(byte [] family, byte [] qualifier) { - public KeyValue getColumnLatest(byte [] family, int foffset, int flength, + public Cell getColumnLatest(byte [] family, int foffset, int flength,        byte [] qualifier, int qoffset, int qlength) { For extension interfaces BaseRegionObserver and ColumnInterpreter, we have kept both the old and new signature, including a shim that has the abstract implementation helper have the new call the old implementation. For the shim to handle the List<KeyValue> -> List<Cell> conversion, we use an expensive naive array copy. It is strongly recommended that the new coprocessors are updated to override the new undeprecated API. ColumnInterpreter: (abstract class) - public abstract T getValue(byte[] colFamily, byte[] colQualifier, KeyValue kv) + public abstract T getValue(byte[] colFamily, byte[] colQualifier, Cell kv)   BaseRegionObserver: (abstract class) RegionObserver: (inteface)    void preGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get, - final List<KeyValue> result) + final List<Cell> result)      throws IOException;    void postGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get, - final List<KeyValue> result) + final List<Cell> result)      throws IOException;

    Description

      This path is the second half of eliminating KeyValue from the client interfaces. This percolated through quite a bit.

      Attachments

        1. hbase-9334-9359.v4.patch
          452 kB
          Jonathan Hsieh
        2. hbase-9359.patch
          362 kB
          Jonathan Hsieh
        3. hbase-9359.v2.patch
          371 kB
          Jonathan Hsieh
        4. hbase-9359.v3.patch
          375 kB
          Jonathan Hsieh
        5. hbase-9359.v5.patch
          381 kB
          Jonathan Hsieh
        6. hbase-9359.v6.patch
          378 kB
          Jonathan Hsieh
        7. hbase-9359-9334.v5.patch
          453 kB
          Jonathan Hsieh
        8. hbase-9359-9334.v6.patch
          456 kB
          Jonathan Hsieh

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: