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

HBaseTestingUtility.truncateTable() not acting like CLI

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.94.3
    • Fix Version/s: 2.0.0
    • Component/s: test
    • Labels:
    • Hadoop Flags:
      Incompatible change, Reviewed
    • Release Note:
      Hide
      HBaseTestingUtility now uses the truncate API added in HBASE-8332 so that calls to HBTU.truncateTable will behave like the shell command: effectively dropping the table and recreating a new one with the same split points.

      Previously, HBTU.truncateTable instead issued deletes for all the data already in the table. If you wish to maintain the same behavior, you should use the newly added HBTU.deleteTableData method.
      Show
      HBaseTestingUtility now uses the truncate API added in HBASE-8332 so that calls to HBTU.truncateTable will behave like the shell command: effectively dropping the table and recreating a new one with the same split points. Previously, HBTU.truncateTable instead issued deletes for all the data already in the table. If you wish to maintain the same behavior, you should use the newly added HBTU.deleteTableData method.

      Description

      I would like to discuss the behavior of the truncateTable() method of HBaseTestingUtility. It's currently only removing the data through a scan/delete pattern.

      However, the truncate command in CLI is doing additional things: it disables the tables, drop, creates (with similar column descriptors) and then enables the table.

      I think the truncateTable() method is misleading; for example I used it to force a coprocessor to be reloaded, but it did not. Of course I can disable and enable the table by myself within my unit test, but perhaps it deserves to be discussed?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                busbey Sean Busbey
                Reporter:
                cf357 Adrien Mogenet
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: