Class NamespaceAuditor
java.lang.Object
org.apache.hadoop.hbase.namespace.NamespaceAuditor
The Class NamespaceAuditor performs checks to ensure operations like table creation and region
splitting preserve namespace quota. The namespace quota can be specified while namespace
creation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate MasterServicesprivate NamespaceStateManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcheckQuotaToCreateTable(TableName tName, int regions) Check quota to create table.voidvoidcheckQuotaToUpdateRegion(TableName tName, int regions) Check and update region count quota for an existing table.private voidvoiddeleteNamespace(String namespace) intgetRegionCountOfTable(TableName tName) Get region count for tablebooleanChecks if namespace auditor is initialized.voidremoveFromNamespaceUsage(TableName tableName) voidvoidstart()voidupdateQuotaForRegionMerge(RegionInfo mergedRegion)
-
Field Details
-
LOG
-
stateManager
-
masterServices
-
-
Constructor Details
-
NamespaceAuditor
-
-
Method Details
-
start
- Throws:
IOException
-
checkQuotaToCreateTable
Check quota to create table. We add the table information to namespace state cache, assuming the operation will pass. If the operation fails, then the next time namespace state chore runs namespace state cache will be corrected.- Parameters:
tName- - The table name to check quota.regions- - Number of regions that will be added.- Throws:
IOException- Signals that an I/O exception has occurred.
-
checkQuotaToUpdateRegion
Check and update region count quota for an existing table.- Parameters:
tName- - table name for which region count to be updated.regions- - Number of regions that will be added.- Throws:
IOException- Signals that an I/O exception has occurred.
-
checkTableTypeAndThrowException
- Throws:
IOException
-
getRegionCountOfTable
Get region count for table- Parameters:
tName- - table name- Returns:
- cached region count, or -1 if table status not found
- Throws:
IOException- Signals that the namespace auditor has not been initialized
-
checkQuotaToSplitRegion
- Throws:
IOException
-
updateQuotaForRegionMerge
- Throws:
IOException
-
addNamespace
- Throws:
IOException
-
deleteNamespace
- Throws:
IOException
-
removeFromNamespaceUsage
- Throws:
IOException
-
removeRegionFromNamespaceUsage
- Throws:
IOException
-
getState
- Parameters:
namespace- The name of the namespace- Returns:
- An instance of NamespaceTableAndRegionInfo
-
isInitialized
Checks if namespace auditor is initialized. Used only for testing.- Returns:
- true, if is initialized
-