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

Replace "HTable" with "HTableInterface" where backwards-compatible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.99.0
    • None
    • None
    • Reviewed

    Description

      This is a refactor to move more of the code towards using interfaces for proper encapsulation of logic.

      The amount of code touched is large, but it should be fairly easy to review. It changes variable declarations from HTable to HTableInterface where the following holds:

      1. The declaration being updated won't break assignment
      2. The declaration change does not break the compile (eg trying to access non-interface methods)

      The two main situations are to change something like this:

      HTable h = new HTable(c, tn);
      

      to

      HTableInterface h = new HTable(c, tn);
      

      and this:

      public void doSomething(HTable h) { ... }
      

      to this:

      public void doSomething(HTableInterface h) { ... }
      

      This gets most of the obvious cases out of the way and prepares for more complicated interface refactors in the future. In method signatures, I changed parameters, but did not change any public or protected method return values, since that would violate criteria #1 above and break compatibility.

      Attachments

        1. HBASE_11679.patch
          489 kB
          Carter
        2. HBASE_11679.patch
          489 kB
          Michael Stack
        3. HBASE_11679_v3.patch
          483 kB
          Carter
        4. HBASE_11679_v4.patch
          578 kB
          Carter
        5. HBASE_11679_v5.patch
          576 kB
          Carter
        6. hbase-11679_v6.patch
          564 kB
          Enis Soztutar
        7. hbase-11679_v6-branch-1.patch
          559 kB
          Enis Soztutar

        Issue Links

          Activity

            People

              carterpage Carter
              carterpage Carter
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: