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

RowResult containing or supporting more flexible data structures to access elements returned

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 0.2.0
    • 0.18.0
    • io
    • None

    Description

      Extracting actual data from a RowResult can be an ugly process when you don't know what you're looking for (to be able to query the Map).

      For example, if i want to get all columns in a family, or I pass a large number of columns each of which may or may not exist in the specified row, I need to go through the entire list of column/Cells. Currently this is done with something like:

      RowResult result = HTable.getRow(rowkey,columns)
      Set<Map.Entry<byte [], Cell>> cols = result.entrySet();

      From here I know how many entries are in the Set (cols.size()), but if I want to go through them, this requires another step change the Set into an Array or an Iterator.

      Iterator<Map.Entry<byte [], Cell>> iterator = cols.iterator();
      or
      Map.Entry<byte [], Cell> [] entries = cols.toArray(new RowResult.Entry[0])

      So going from what is returned from HBase, into something usable by the client, requires at least two additional lines and data structure conversions. The Map -> Set<Map.Entry> is very likely to be fast. I'm unsure about the speed of the Iterator or toArray. I would guess that the change to Iterator is fairly efficient (not requiring a copy of the memory), whereas toArray likely does.

      Attachments

        Activity

          People

            Unassigned Unassigned
            streamy Jonathan Gray
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: