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

Add how to rename a table in the docbook

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.94.7, 0.95.0
    • 0.98.0, 0.94.8, 0.95.1
    • documentation
    • None

    Description

      Add a section "how to rename a table" in the doc book.

      The current easy solution without adding extra code in 94/95 is to use snapshots

      hbase shell> disable 'tableName'
      hbase shell> snapshot 'tableName', 'tableSnapshot'
      hbase shell> clone 'tableSnapshot', 'newTableName'
      hbase shell> delete_snapshot 'tableSnapshot'
      
      void rename(HBaseAdmin admin, String oldTableName, String newTableName) {
          String snapshotName = randomName();
          admin.snapshot(snapshotName, oldTableName);
          admin.cloneSnapshot(snapshotName, newTableName);
          admin.deleteSnapshot(snapshotName);
          admin.deleteTable(oldTableName)
      }
      

      Attachments

        Activity

          People

            mbertozzi Matteo Bertozzi
            mbertozzi Matteo Bertozzi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: