Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-14996 Some more API cleanup for 2.0
  3. HBASE-14997

Move compareOp and Comparators out of filter to client package

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 2.0.0-alpha-3, 2.0.0
    • None
    • None
    • Reviewed
    • Hide
      Deprecate checkAnd* APIs that take the filter CompareOp. Added new overrides that take a generic CompareOperator instead. CompareOperator will be used by checkAnd* in Table API and by filters going forward.

      Other nice improvements suggested by this issue have been moved out to HBASE-18774.
      Show
      Deprecate checkAnd* APIs that take the filter CompareOp. Added new overrides that take a generic CompareOperator instead. CompareOperator will be used by checkAnd* in Table API and by filters going forward. Other nice improvements suggested by this issue have been moved out to HBASE-18774 .

    Description

      Table.checkAndPut() and its cousins depend on CompareOp from the filter package. Originally, ComparaOp and ByteArrayComparable, and various "comparators" have been used in filters, so these are in the filter package. However, for checkAndPut(), etc we depend on the filter subpackage although these are not filter related operations. We can use some clean up.

        boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier,
          CompareFilter.CompareOp compareOp, byte[] value, Put put) throws IOException;
      

      Some ideas

      • Cleanup ByteArrayComparable interface (see the TODO at the class)
      • Maybe introduce a Condition or a similar concept and do checkAndPut(Condition condition, Put put) and change filters to use that as well.
      • Introducing Condition like thing will allow us to have an interface like: checkAndMutate(List<Condition> conditions, List<Mutation> mutations).
      • BinaryComparator, etc are not "Comparators", they are comparables.

      Attachments

        1. HBASE-14997.master.001.patch
          105 kB
          Michael Stack
        2. HBASE-14997.master.002.patch
          105 kB
          Michael Stack
        3. HBASE-14997.master.003.patch
          113 kB
          Michael Stack
        4. HBASE-14997.master.004.patch
          131 kB
          Michael Stack

        Issue Links

          Activity

            People

              stack Michael Stack
              enis Enis Soztutar
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: