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

truncate on disabled table should throw TableNotEnabledException.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.98.0, 0.94.7, 0.95.0
    • Admin
    • None
    • Reviewed

    Description

      presently truncate on disabled table is deleting existing table and recreating(ENABLED)
      disable(table_name) call in truncate returing if table is disabled without nofifying to user.

          def disable(table_name)
            tableExists(table_name)
            return if disabled?(table_name)
            @admin.disableTable(table_name)
          end
      

      one more thing is we are calling tableExists in disable(table_name) as well as drop(table_name) which is un necessary.
      Any way below HTable object creation will check whether table exists or not.

      h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
      

      We can change it to

            h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
            table_description = h_table.getTableDescriptor()
            yield 'Disabling table...' if block_given?
            @admin.disableTable(table_name)
      
            yield 'Dropping table...' if block_given?
            @admin.deleteTable(table_name)
      
            yield 'Creating table...' if block_given?
            @admin.createTable(table_description)
      

      Attachments

        1. HBASE-7961_94.patch
          0.8 kB
          rajeshbabu
        2. HBASE-7961.patch
          0.9 kB
          rajeshbabu

        Activity

          People

            rajesh23 rajeshbabu
            rajesh23 rajeshbabu
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: