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
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configuration
(package private) static final int
private boolean
static final String
static final String
private static final org.slf4j.Logger
private MasterServices
(package private) static final String
private Table
private boolean
private ZKNamespaceManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
block
(MasterServices services, long procId) An ugly utility to be removed when refactor TableNamespaceManager.private void
blockingCreateNamespace
(NamespaceDescriptor namespaceDescriptor) Create Namespace in a blocking manner.private void
createNamespaceTable
(MasterServices masterServices) boolean
doesNamespaceExist
(String namespaceName) private NamespaceDescriptor
static long
static long
private Table
private TableState
void
boolean
Returns True ifStoppable.stop(String)
has been closed.private boolean
boolean
This method checks if the namespace table is assigned and then tries to create its Table reference.private boolean
private boolean
list()
void
removeFromNSTable
(String namespaceName) void
removeFromZKNamespaceManager
(String namespaceName) void
start()
void
Stop this service.void
void
-
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_KEY
expires. 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:Stoppable
Returns True ifStoppable.stop(String)
has been closed. -
stop
Description copied from interface:Stoppable
Stop this service. Implementers should favor logging errors over throwing RuntimeExceptions.
-