@InterfaceAudience.Private class NamespaceStateManager extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
initialized |
private static org.slf4j.Logger |
LOG |
private MasterServices |
master |
private ConcurrentMap<String,NamespaceTableAndRegionInfo> |
nsStateCache |
Constructor and Description |
---|
NamespaceStateManager(MasterServices masterServices) |
Modifier and Type | Method and Description |
---|---|
(package private) NamespaceTableAndRegionInfo |
addNamespace(String namespace) |
private void |
addTable(TableName tableName,
int regionCount) |
(package private) boolean |
checkAndUpdateNamespaceRegionCount(TableName name,
byte[] regionName,
int incr)
Check if adding a region violates namespace quota, if not update namespace cache.
|
(package private) void |
checkAndUpdateNamespaceRegionCount(TableName name,
int incr)
Check and update region count for an existing table.
|
(package private) void |
checkAndUpdateNamespaceTableCount(TableName table,
int numRegions) |
(package private) void |
deleteNamespace(String namespace)
Delete the namespace state.
|
private NamespaceDescriptor |
getNamespaceDescriptor(String namespaceAsString) |
NamespaceTableAndRegionInfo |
getState(String name)
Gets an instance of NamespaceTableAndRegionInfo associated with namespace.
|
private void |
initialize()
Initialize namespace state cache by scanning meta table.
|
(package private) boolean |
isInitialized() |
void |
removeRegionFromTable(RegionInfo hri) |
(package private) void |
removeTable(TableName tableName) |
void |
start()
Starts the NamespaceStateManager.
|
private static final org.slf4j.Logger LOG
private ConcurrentMap<String,NamespaceTableAndRegionInfo> nsStateCache
private MasterServices master
private volatile boolean initialized
public NamespaceStateManager(MasterServices masterServices)
public void start() throws IOException
IOException
- Signals that an I/O exception has occurred.public NamespaceTableAndRegionInfo getState(String name)
name
- The name of the namespaceboolean checkAndUpdateNamespaceRegionCount(TableName name, byte[] regionName, int incr) throws IOException
IOException
- Signals that an I/O exception has occurred.void checkAndUpdateNamespaceRegionCount(TableName name, int incr) throws IOException
name
- name of the table for region count needs to be checked and updatedincr
- count of regionsQuotaExceededException
- if quota exceeds for the number of regions allowed in a
namespaceIOException
- Signals that an I/O exception has occurred.private NamespaceDescriptor getNamespaceDescriptor(String namespaceAsString)
void checkAndUpdateNamespaceTableCount(TableName table, int numRegions) throws IOException
IOException
NamespaceTableAndRegionInfo addNamespace(String namespace)
void deleteNamespace(String namespace)
namespace
- the name of the namespace to deleteprivate void addTable(TableName tableName, int regionCount) throws IOException
IOException
void removeTable(TableName tableName)
private void initialize() throws IOException
IOException
boolean isInitialized()
public void removeRegionFromTable(RegionInfo hri) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.