Package org.apache.hadoop.hbase.master
Class TableStateManager
java.lang.Object
org.apache.hadoop.hbase.master.TableStateManager
This is a helper class used to manage table states. This class uses hbase:meta as its store for
table state so hbase:meta must be online before accessing its methods.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final MasterServices
private final ConcurrentMap<TableName,
TableState.State> private final IdReadWriteLock<TableName>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetTablesInStates
(TableState.State... states) Return all tables in given states.getTableState
(TableName tableName) boolean
isTablePresent
(TableName tableName) boolean
isTableState
(TableName tableName, TableState.State... states) private TableState
readMetaState
(TableName tableName) void
setDeletedTable
(TableName tableName) void
setTableState
(TableName tableName, TableState.State newState) Set table state to provided.private void
updateMetaState
(TableName tableName, TableState.State newState)
-
Field Details
-
LOG
-
tnLock
-
master
-
tableName2State
-
-
Constructor Details
-
TableStateManager
TableStateManager(MasterServices master)
-
-
Method Details
-
setTableState
Set table state to provided. Caller should lock table on write.- Parameters:
tableName
- table to change state fornewState
- new state- Throws:
IOException
-
isTableState
-
setDeletedTable
- Throws:
IOException
-
isTablePresent
- Throws:
IOException
-
getTablesInStates
Return all tables in given states.- Parameters:
states
- filter by states- Returns:
- tables in given states
- Throws:
IOException
-
getTableState
- Throws:
IOException
-
updateMetaState
- Throws:
IOException
-
readMetaState
- Throws:
IOException
-