@InterfaceAudience.Private public class NamespaceAuditor extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static int |
DEFAULT_NS_AUDITOR_INIT_TIMEOUT |
private static org.apache.commons.logging.Log |
LOG |
private MasterServices |
masterServices |
(package private) static String |
NS_AUDITOR_INIT_TIMEOUT |
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(HRegionInfo 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(HRegionInfo hri) |
void |
start() |
void |
updateQuotaForRegionMerge(HRegionInfo hri) |
private static final org.apache.commons.logging.Log LOG
static final String NS_AUDITOR_INIT_TIMEOUT
static final int DEFAULT_NS_AUDITOR_INIT_TIMEOUT
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(HRegionInfo hri) throws IOException
IOException
public void updateQuotaForRegionMerge(HRegionInfo hri) 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(HRegionInfo hri) throws IOException
IOException
public NamespaceTableAndRegionInfo getState(String namespace)
namespace
- The name of the namespacepublic boolean isInitialized()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.