You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Wellington Chevreuil (Jira)" <ji...@apache.org> on 2019/11/17 10:43:00 UTC
[jira] [Commented] (HBASE-23306) Add sanity check for
Admin#deleteTables and other operations
[ https://issues.apache.org/jira/browse/HBASE-23306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975968#comment-16975968 ]
Wellington Chevreuil commented on HBASE-23306:
----------------------------------------------
Apart from _ listTableNames_, all these mentioned methods were deprecated and already been removed from *Admin* for the next major release. The *Admin* interface is mainly a client facade for *HMaster* admin methods, and if we look at [_HMaster.listTableNames_ javadoc description|https://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/master/HMaster.html#listTableNames-java.lang.String-java.lang.String-boolean-], it's pretty clear about the parameter behaviour:
{noformat}
public List<TableName> listTableNames(String namespace,
String regex,
boolean includeSysTables)
throws IOException
Returns the list of table names that match the specified request
Parameters:
regex - The regular expression to match against, or null if querying for all
namespace - the namespace to query, or null if querying for all
includeSysTables - False to match only against userspace tables
Returns:
the list of table names
Throws:
IOException
{noformat}
> Add sanity check for Admin#deleteTables and other operations
> ------------------------------------------------------------
>
> Key: HBASE-23306
> URL: https://issues.apache.org/jira/browse/HBASE-23306
> Project: HBase
> Issue Type: Bug
> Components: Admin
> Reporter: Rahul Kesharwani
> Priority: Minor
>
> h3. Description:
> After taking a brief observation, It seems to be the following operation behaves in the opposite manner of what they should be doing in case `null argument.
> *For example:* `Admin#listTables(Pattern)` If its argument is `null` then all the tables would be returned. Also this very method is being used by rest of the listed operation like `deleteTables()`, `enableTables()`, `disableTables()` etc.
> h3. Affected operation:
> * Admin.listTables(Pattern)
> * Admin.listTableNames(Pattern)
> * Admin.deleteTables(Pattern)
> * Admin.enableTables(Pattern)
> * Admin.disableTables(Pattern)
> This could be a very rare scenario but I think it should either throw an exception or behave opposite of what current behavior is.
> *If this was not intentional* then I can quickly put together a patch with precondition check for these operations.
>
> Note: I tried to look for answers but I was not able to find any relevant issue/comments hence logging this issue. Feel free to close if this is intentional behavior.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)