@InterfaceAudience.Private public class TableStateManager extends Object
Constructor and Description |
---|
TableStateManager(MasterServices master) |
Modifier and Type | Method and Description |
---|---|
static void |
fixTableStates(TableDescriptors tableDescriptors,
Connection connection) |
Set<TableName> |
getTablesInStates(TableState.State... states)
Return all tables in given states.
|
TableState.State |
getTableState(TableName tableName) |
boolean |
isTablePresent(TableName tableName) |
boolean |
isTableState(TableName tableName,
TableState.State... states) |
protected TableState |
readMetaState(TableName tableName) |
void |
setDeletedTable(TableName tableName) |
void |
setTableState(TableName tableName,
TableState.State newState)
Set table state to provided.
|
TableState.State |
setTableStateIfInStates(TableName tableName,
TableState.State newState,
TableState.State... states)
Set table state to provided but only if table in specified states
Caller should lock table on write.
|
boolean |
setTableStateIfNotInStates(TableName tableName,
TableState.State newState,
TableState.State... states)
Set table state to provided but only if table not in specified states
Caller should lock table on write.
|
void |
start() |
protected void |
udpateMetaState(TableName tableName,
TableState.State newState) |
public TableStateManager(MasterServices master)
public void setTableState(TableName tableName, TableState.State newState) throws IOException
tableName
- table to change state fornewState
- new stateIOException
public TableState.State setTableStateIfInStates(TableName tableName, TableState.State newState, TableState.State... states) throws IOException
tableName
- table to change state fornewState
- new statestates
- states to check againstIOException
public boolean setTableStateIfNotInStates(TableName tableName, TableState.State newState, TableState.State... states) throws IOException
tableName
- table to change state fornewState
- new statestates
- states to check againstIOException
public boolean isTableState(TableName tableName, TableState.State... states)
public void setDeletedTable(TableName tableName) throws IOException
IOException
public boolean isTablePresent(TableName tableName) throws IOException
IOException
public Set<TableName> getTablesInStates(TableState.State... states) throws IOException
states
- filter by statesIOException
@NonNull public TableState.State getTableState(TableName tableName) throws IOException
IOException
protected void udpateMetaState(TableName tableName, TableState.State newState) throws IOException
IOException
@Nullable protected TableState readMetaState(TableName tableName) throws IOException
IOException
public void start() throws IOException
IOException
public static void fixTableStates(TableDescriptors tableDescriptors, Connection connection) throws IOException
IOException
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.