You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "ramkrishna.s.vasudevan (JIRA)" <ji...@apache.org> on 2013/03/01 04:45:13 UTC
[jira] [Commented] (HBASE-7961) truncate on disabled table should
throw TableNotEnabledException.
[ https://issues.apache.org/jira/browse/HBASE-7961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13590212#comment-13590212 ]
ramkrishna.s.vasudevan commented on HBASE-7961:
-----------------------------------------------
I understand your patch
bq.h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
Where does this check for table exists?
> truncate on disabled table should throw TableNotEnabledException.
> -----------------------------------------------------------------
>
> Key: HBASE-7961
> URL: https://issues.apache.org/jira/browse/HBASE-7961
> Project: HBase
> Issue Type: Bug
> Components: Admin
> Reporter: rajeshbabu
> Assignee: rajeshbabu
> Fix For: 0.98.0, 0.94.7
>
> Attachments: HBASE-7961.patch
>
>
> 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.
> {code}
> def disable(table_name)
> tableExists(table_name)
> return if disabled?(table_name)
> @admin.disableTable(table_name)
> end
> {code}
> 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.
> {code}
> h_table = org.apache.hadoop.hbase.client.HTable.new(conf, table_name)
> {code}
> We can change it to
> {code}
> 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)
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira