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
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate final MasterServicesprivate final ConcurrentMap<TableName,TableState.State> private final IdReadWriteLock<TableName> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTablesInStates(TableState.State... states) Return all tables in given states.getTableState(TableName tableName) booleanisTablePresent(TableName tableName) booleanisTableState(TableName tableName, TableState.State... states) private TableStatereadMetaState(TableName tableName) voidsetDeletedTable(TableName tableName) voidsetTableState(TableName tableName, TableState.State newState) Set table state to provided.private voidupdateMetaState(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
-