@InterfaceAudience.Private public class ZKTableStateManager extends Object implements TableStateManager
ZKTableStateClientSideReader instead.
To save on trips to the zookeeper ensemble, internally we cache table state.
| Constructor and Description |
|---|
ZKTableStateManager(ZooKeeperWatcher zkw) |
public ZKTableStateManager(ZooKeeperWatcher zkw) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void setTableState(TableName tableName, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State state) throws CoordinatedStateException
setTableState in interface TableStateManagertableName - table to processstate - new state of this tableCoordinatedStateException - if error happened when trying to set table statepublic boolean setTableStateIfInStates(TableName tableName, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State newState, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State... states) throws CoordinatedStateException
setTableStateIfInStates in interface TableStateManagertableName - table to processnewState - new state for the tablestates - table should be in one of these states for the operation
to be performedCoordinatedStateException - if error happened while performing operationpublic boolean setTableStateIfNotInStates(TableName tableName, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State newState, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State... states) throws CoordinatedStateException
setTableStateIfNotInStates in interface TableStateManagertableName - table to processnewState - new state for the tablestates - table should NOT be in one of these states for the operation
to be performedCoordinatedStateException - if error happened while performing operationpublic boolean isTableState(TableName tableName, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State... states)
isTableState in interface TableStateManagerpublic boolean isTableState(TableName tableName, boolean checkSource, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State... states)
isTableState in interface TableStateManagerpublic void setDeletedTable(TableName tableName) throws CoordinatedStateException
setDeletedTable in interface TableStateManagertableName - table to be deletedCoordinatedStateException - if error happened while performing operationpublic boolean isTablePresent(TableName tableName)
isTablePresent in interface TableStateManagertableName - table we're working onpublic Set<TableName> getTablesInStates(org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State... states) throws InterruptedIOException, CoordinatedStateException
getTablesInStates in interface TableStateManagerCoordinatedStateException - if error happened in underlying coordination engineInterruptedIOExceptionpublic void checkAndRemoveTableState(TableName tableName, org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Table.State states, boolean deletePermanentState) throws CoordinatedStateException
checkAndRemoveTableState in interface TableStateManagertableName - table we're working onstates - if table isn't in any one of these states, operation abortsdeletePermanentState - if true, reset the permanent flagCoordinatedStateException - if error happened in underlying coordination engineCopyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.