HBase
  1. HBase
  2. HBASE-2051

Use builder pattern to improve usability of client API

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      From Paul Smith up on hbase-user@:

      I think a good collection of useful builders and utilities that handle the 80% case will help HBase gain much more traction. As an person starting with HBase, there are a lot of concepts to get, Bytes definitely get in the way of seeing the real underlying patterns. I'm a total believer in understanding the internals to get the best out of a product, but that often comes after experimentation, and these high-level libraries grease the wheels for faster 'grok'ing the concepts.

      Thinking out loud here, but something like this may be useful:

      PutBuilder builder = new PutBuilder(hTable);
      // first Row
      builder.withRowKey(1stRowKey).withColumnFamily("foo")
          .put("columnA", valueA)
          .put("columnB",valueB);
      // secondRow
      builder.withRowKey(2ndRowKey).withColumnFamily("eek")
          .put("columnC", valueC)
          .put("columnD",valueD);
      ..
      builder.putAll();
      

      Perhaps we could use the Builder pattern to achieve simplification (e.g. HBASE-1990) and API support for multicalls (HBASE-1986, HBASE-1845) at the same time. Method variants should accept byte[] or String for keys or values, and lists.

        Issue Links

          Activity

          Andrew Purtell made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          stack made changes -
          Fix Version/s 0.92.0 [ 12314223 ]
          Jeff Hammerbacher made changes -
          Link This issue relates to HBASE-2609 [ HBASE-2609 ]
          Jonathan Gray made changes -
          Link This issue relates to HBASE-2597 [ HBASE-2597 ]
          stack made changes -
          Fix Version/s 0.22.0 [ 12314223 ]
          Fix Version/s 0.21.0 [ 12313607 ]
          Paul Smith made changes -
          Attachment aconex-hbase-utils.zip [ 12428254 ]
          Andrew Purtell made changes -
          Link This issue relates to HBASE-1839 [ HBASE-1839 ]
          Andrew Purtell made changes -
          Link This issue relates to HBASE-1986 [ HBASE-1986 ]
          Andrew Purtell made changes -
          Link This issue relates to HBASE-1845 [ HBASE-1845 ]
          Andrew Purtell made changes -
          Field Original Value New Value
          Link This issue relates to HBASE-1990 [ HBASE-1990 ]
          Andrew Purtell created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Andrew Purtell
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development