@InterfaceAudience.Private public class NamespaceAuditor extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private MasterServices |
masterServices |
private NamespaceStateManager |
stateManager |
Constructor and Description |
---|
NamespaceAuditor(MasterServices masterServices) |
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(NamespaceDescriptor ns) |
void |
checkQuotaToCreateTable(TableName tName,
int regions)
Check quota to create table.
|
void |
checkQuotaToSplitRegion(RegionInfo hri) |
void |
checkQuotaToUpdateRegion(TableName tName,
int regions)
Check and update region count quota for an existing table.
|
private void |
checkTableTypeAndThrowException(TableName name) |
void |
deleteNamespace(String namespace) |
int |
getRegionCountOfTable(TableName tName)
Get region count for table
|
NamespaceTableAndRegionInfo |
getState(String namespace) |
boolean |
isInitialized()
Checks if namespace auditor is initialized.
|
void |
removeFromNamespaceUsage(TableName tableName) |
void |
removeRegionFromNamespaceUsage(RegionInfo hri) |
void |
start() |
void |
updateQuotaForRegionMerge(RegionInfo mergedRegion) |
private static final org.slf4j.Logger LOG
private NamespaceStateManager stateManager
private MasterServices masterServices
public NamespaceAuditor(MasterServices masterServices)
public void start() throws IOException
IOException
public void checkQuotaToCreateTable(TableName tName, int regions) throws IOException
tName
- - The table name to check quota.regions
- - Number of regions that will be added.IOException
- Signals that an I/O exception has occurred.public void checkQuotaToUpdateRegion(TableName tName, int regions) throws IOException
tName
- - table name for which region count to be updated.regions
- - Number of regions that will be added.IOException
- Signals that an I/O exception has occurred.private void checkTableTypeAndThrowException(TableName name) throws IOException
IOException
public int getRegionCountOfTable(TableName tName) throws IOException
tName
- - table nameIOException
- Signals that the namespace auditor has not been initializedpublic void checkQuotaToSplitRegion(RegionInfo hri) throws IOException
IOException
public void updateQuotaForRegionMerge(RegionInfo mergedRegion) throws IOException
IOException
public void addNamespace(NamespaceDescriptor ns) throws IOException
IOException
public void deleteNamespace(String namespace) throws IOException
IOException
public void removeFromNamespaceUsage(TableName tableName) throws IOException
IOException
public void removeRegionFromNamespaceUsage(RegionInfo hri) throws IOException
IOException
public NamespaceTableAndRegionInfo getState(String namespace)
namespace
- The name of the namespacepublic boolean isInitialized()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.