[jira] [Assigned] (HBASE-21066) Improve isTableState() method to ensure caller gets correct info

2018-08-17 Thread Xu Cang (JIRA)


 [ 
https://issues.apache.org/jira/browse/HBASE-21066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xu Cang reassigned HBASE-21066:
---

Assignee: (was: Xu Cang)

> Improve isTableState() method to ensure caller gets correct info
> 
>
> Key: HBASE-21066
> URL: https://issues.apache.org/jira/browse/HBASE-21066
> Project: HBase
>  Issue Type: Improvement
>Affects Versions: 3.0.0, 1.3.0, 2.0.0
>Reporter: Xu Cang
>Priority: Minor
> Attachments: HBASE-21066.master.001.patch, 
> HBASE-21066.master.002.patch
>
>
>  
> {code:java}
> public boolean isTableState(TableName tableName, TableState.State... states) {
>  try {
>  TableState tableState = getTableState(tableName);
>  return tableState.isInStates(states);
>  } catch (IOException e) {
>  LOG.error("Unable to get table " + tableName + " state", e);
>  // XXX: is it safe to just return false here?
>  return false;
>  }
>  }
>  
> {code}
>  
> When cannot get table state, returning false is not always safe or correct.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (HBASE-21066) Improve isTableState() method to ensure caller gets correct info

2018-08-17 Thread Xu Cang (JIRA)


 [ 
https://issues.apache.org/jira/browse/HBASE-21066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xu Cang reassigned HBASE-21066:
---

Assignee: Xu Cang

> Improve isTableState() method to ensure caller gets correct info
> 
>
> Key: HBASE-21066
> URL: https://issues.apache.org/jira/browse/HBASE-21066
> Project: HBase
>  Issue Type: Improvement
>Affects Versions: 3.0.0
>Reporter: Xu Cang
>Assignee: Xu Cang
>Priority: Minor
>
> {{public boolean isTableState(TableName tableName, TableState.State... 
> states) {}}
> {{try {}}
> {{TableState tableState = getTableState(tableName);}}
> {{return tableState.isInStates(states);}}
> {{} catch (IOException e) {}}
> {{LOG.error("Unable to get table " + tableName + " state", e);}}
> {{// XXX: is it safe to just return false here?}}
> {{return false;}}
> {{}}}
> {{}}}
>  
> When cannot get table state, returning false is not always safe or correct.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)