Package org.apache.hadoop.hbase.master
Class TableNamespaceManager
java.lang.Object
org.apache.hadoop.hbase.master.TableNamespaceManager
- All Implemented Interfaces:
Stoppable
This is a helper class used internally to manage the namespace metadata that is stored in
TableName.NAMESPACE_TABLE_NAME. It also mirrors updates to the ZK store by forwarding updates to
ZKNamespaceManager. WARNING: Do not use. Go via the higher-level
ClusterSchema API instead. This manager is likely to go aways anyways.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configuration(package private) static final intprivate booleanstatic final Stringstatic final Stringprivate static final org.slf4j.Loggerprivate MasterServices(package private) static final Stringprivate Tableprivate booleanprivate ZKNamespaceManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidblock(MasterServices services, long procId) An ugly utility to be removed when refactor TableNamespaceManager.private voidblockingCreateNamespace(NamespaceDescriptor namespaceDescriptor) Create Namespace in a blocking manner.private voidcreateNamespaceTable(MasterServices masterServices) booleandoesNamespaceExist(String namespaceName) private NamespaceDescriptorstatic longstatic longprivate Tableprivate TableStatevoidbooleanReturns True ifStoppable.stop(String)has been closed.private booleanbooleanThis method checks if the namespace table is assigned and then tries to create its Table reference.private booleanprivate booleanlist()voidremoveFromNSTable(String namespaceName) voidremoveFromZKNamespaceManager(String namespaceName) voidstart()voidStop this service.voidvoid
-
Field Details
-
LOG
-
stopped
-
conf
-
masterServices
-
nsTable
-
zkNamespaceManager
-
initialized
-
KEY_MAX_REGIONS
- See Also:
-
KEY_MAX_TABLES
- See Also:
-
NS_INIT_TIMEOUT
- See Also:
-
DEFAULT_NS_INIT_TIMEOUT
- See Also:
-
-
Constructor Details
-
TableNamespaceManager
TableNamespaceManager(MasterServices masterServices)
-
-
Method Details
-
start
- Throws:
IOException
-
getNamespaceTable
- Throws:
IOException
-
doesNamespaceExist
- Throws:
IOException
-
get
- Throws:
IOException
-
get
- Throws:
IOException
-
insertIntoNSTable
- Throws:
IOException
-
updateZKNamespaceManager
- Throws:
IOException
-
removeFromNSTable
- Throws:
IOException
-
removeFromZKNamespaceManager
- Throws:
IOException
-
list
- Throws:
IOException
-
createNamespaceTable
- Throws:
IOException
-
isTableNamespaceManagerInitialized
- Throws:
IOException
-
blockingCreateNamespace
Create Namespace in a blocking manner. Keeps trying untilClusterSchema.HBASE_MASTER_CLUSTER_SCHEMA_OPERATION_TIMEOUT_KEYexpires. Note, by-passes notifying coprocessors and name checks. Use for system namespaces only.- Throws:
IOException
-
block
An ugly utility to be removed when refactor TableNamespaceManager.- Throws:
TimeoutIOException
-
isTableAvailableAndInitialized
This method checks if the namespace table is assigned and then tries to create its Table reference. If it was already created before, it also makes sure that the connection isn't closed.- Returns:
- true if the namespace table manager is ready to serve, false otherwise
- Throws:
IOException
-
getTableState
- Throws:
IOException
-
isTableEnabled
- Throws:
IOException
-
isTableAssigned
-
validateTableAndRegionCount
- Throws:
IOException
-
getMaxTables
- Throws:
IOException
-
getMaxRegions
- Throws:
IOException
-
isStopped
Description copied from interface:StoppableReturns True ifStoppable.stop(String)has been closed. -
stop
Description copied from interface:StoppableStop this service. Implementers should favor logging errors over throwing RuntimeExceptions.
-