@InterfaceAudience.Private public class TableStateManager extends Object
start()
is called.Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
protected MasterServices |
master |
private static String |
MIGRATE_TABLE_STATE_FROM_ZK_KEY
Set this key to false in Configuration to disable migrating table state from zookeeper so
hbase:meta table.
|
private ConcurrentMap<TableName,TableState.State> |
tableName2State |
private IdReadWriteLock<TableName> |
tnLock |
Constructor and Description |
---|
TableStateManager(MasterServices master) |
Modifier and Type | Method and Description |
---|---|
protected void |
deleteZooKeeper(TableName tableName)
Deprecated.
Since 2.0.0. To be removed in hbase-3.0.0.
|
protected void |
fixTableState(TableState tableState)
For subclasses in case they want to do fixup post hbase:meta.
|
private void |
fixTableStates(TableDescriptors tableDescriptors,
Connection connection) |
(package private) Set<TableName> |
getTablesInStates(TableState.State... states)
Return all tables in given states.
|
TableState |
getTableState(TableName tableName) |
boolean |
isTablePresent(TableName tableName) |
boolean |
isTableState(TableName tableName,
TableState.State... states) |
protected void |
metaStateDeleted(TableName tableName) |
protected void |
metaStateUpdated(TableName tableName,
TableState.State newState) |
private void |
migrateZooKeeper()
Deprecated.
Since 2.0.0. Remove in hbase-3.0.0.
|
private TableState |
readMetaState(TableName tableName) |
void |
setDeletedTable(TableName tableName) |
void |
setTableState(TableName tableName,
TableState.State newState)
Set table state to provided.
|
void |
start() |
private void |
updateMetaState(TableName tableName,
TableState.State newState) |
private static final org.slf4j.Logger LOG
private static final String MIGRATE_TABLE_STATE_FROM_ZK_KEY
private final IdReadWriteLock<TableName> tnLock
protected final MasterServices master
private final ConcurrentMap<TableName,TableState.State> tableName2State
TableStateManager(MasterServices master)
public void setTableState(TableName tableName, TableState.State newState) throws IOException
tableName
- table to change state fornewState
- new stateIOException
public boolean isTableState(TableName tableName, TableState.State... states)
public void setDeletedTable(TableName tableName) throws IOException
IOException
public boolean isTablePresent(TableName tableName) throws IOException
IOException
Set<TableName> getTablesInStates(TableState.State... states) throws IOException
states
- filter by statesIOException
@NonNull public TableState getTableState(TableName tableName) throws IOException
IOException
private void updateMetaState(TableName tableName, TableState.State newState) throws IOException
IOException
protected void metaStateUpdated(TableName tableName, TableState.State newState) throws IOException
IOException
protected void metaStateDeleted(TableName tableName) throws IOException
IOException
@Nullable private TableState readMetaState(TableName tableName) throws IOException
IOException
public void start() throws IOException
IOException
private void fixTableStates(TableDescriptors tableDescriptors, Connection connection) throws IOException
IOException
protected void fixTableState(TableState tableState) throws IOException
IOException
@Deprecated private void migrateZooKeeper() throws IOException
MIGRATE_TABLE_STATE_FROM_ZK_KEY
flag. Original
form of this migration came in with HBASE-13032. It deleted all znodes when done. We can't do
that if we want to support hbase-1.x clients who need to be able to read table state out of zk.
See MirroringTableStateManager
.IOException
@Deprecated protected void deleteZooKeeper(TableName tableName)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.