@InterfaceAudience.Private @InterfaceStability.Evolving public class MasterQuotaManager extends Object implements RegionStateListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
MasterQuotaManager.NamedLock<T> |
private static interface |
MasterQuotaManager.SetQuotaOperations |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
initialized |
private static org.apache.commons.logging.Log |
LOG |
private MasterServices |
masterServices |
private MasterQuotaManager.NamedLock<String> |
namespaceLocks |
private NamespaceAuditor |
namespaceQuotaManager |
private MasterQuotaManager.NamedLock<TableName> |
tableLocks |
private MasterQuotaManager.NamedLock<String> |
userLocks |
| Constructor and Description |
|---|
MasterQuotaManager(MasterServices masterServices) |
| Modifier and Type | Method and Description |
|---|---|
private void |
applyBypassGlobals(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.Quotas.Builder quotas,
boolean bypassGlobals) |
private void |
applyThrottle(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.Quotas.Builder quotas,
org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.ThrottleRequest req) |
void |
checkAndUpdateNamespaceRegionQuota(TableName tName,
int regions) |
void |
checkNamespaceTableAndRegionQuota(TableName tName,
int regions) |
private void |
checkQuotaSupport() |
private void |
createQuotaTable() |
NamespaceAuditor |
getNamespaceQuotaManager() |
int |
getRegionCountOfTable(TableName tName) |
boolean |
isQuotaInitialized() |
void |
onRegionMerged(HRegionInfo hri)
Process region merge event.
|
void |
onRegionSplit(HRegionInfo hri)
Process region split event.
|
void |
onRegionSplitReverted(HRegionInfo hri)
Process region split reverted event.
|
void |
removeNamespaceQuota(String namespace) |
void |
removeTableFromNamespaceQuota(TableName tName)
Remove table from namespace quota.
|
void |
setNamespaceQuota(NamespaceDescriptor desc) |
void |
setNamespaceQuota(String namespace,
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) |
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaResponse |
setQuota(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) |
private void |
setQuota(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req,
MasterQuotaManager.SetQuotaOperations quotaOps) |
void |
setTableQuota(TableName table,
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) |
void |
setUserQuota(String userName,
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) |
void |
setUserQuota(String userName,
String namespace,
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) |
void |
setUserQuota(String userName,
TableName table,
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) |
void |
start() |
void |
stop() |
private void |
validateTimedQuota(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.TimedQuota timedQuota) |
private static final org.apache.commons.logging.Log LOG
private final MasterServices masterServices
private MasterQuotaManager.NamedLock<String> namespaceLocks
private MasterQuotaManager.NamedLock<TableName> tableLocks
private MasterQuotaManager.NamedLock<String> userLocks
private boolean initialized
private NamespaceAuditor namespaceQuotaManager
public MasterQuotaManager(MasterServices masterServices)
public void start()
throws IOException
IOExceptionpublic void stop()
public boolean isQuotaInitialized()
public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaResponse setQuota(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void setUserQuota(String userName, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void setUserQuota(String userName, TableName table, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void setUserQuota(String userName, String namespace, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void setTableQuota(TableName table, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void setNamespaceQuota(String namespace, org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void setNamespaceQuota(NamespaceDescriptor desc) throws IOException
IOExceptionpublic void removeNamespaceQuota(String namespace) throws IOException
IOExceptionprivate void setQuota(org.apache.hadoop.hbase.protobuf.generated.MasterProtos.SetQuotaRequest req,
MasterQuotaManager.SetQuotaOperations quotaOps)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void checkNamespaceTableAndRegionQuota(TableName tName, int regions) throws IOException
IOExceptionpublic void checkAndUpdateNamespaceRegionQuota(TableName tName, int regions) throws IOException
IOExceptionpublic int getRegionCountOfTable(TableName tName) throws IOException
IOExceptionpublic void onRegionMerged(HRegionInfo hri) throws IOException
RegionStateListeneronRegionMerged in interface RegionStateListenerhri - An instance of HRegionInfoIOExceptionpublic void onRegionSplit(HRegionInfo hri) throws IOException
RegionStateListeneronRegionSplit in interface RegionStateListenerhri - An instance of HRegionInfoIOExceptionpublic void removeTableFromNamespaceQuota(TableName tName) throws IOException
tName - - The table name to update quota usage.IOException - Signals that an I/O exception has occurred.public NamespaceAuditor getNamespaceQuotaManager()
private void applyThrottle(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.Quotas.Builder quotas,
org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.ThrottleRequest req)
throws IOException
IOExceptionprivate void applyBypassGlobals(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.Quotas.Builder quotas,
boolean bypassGlobals)
private void validateTimedQuota(org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.TimedQuota timedQuota)
throws IOException
IOExceptionprivate void checkQuotaSupport()
throws IOException
IOExceptionprivate void createQuotaTable()
throws IOException
IOExceptionpublic void onRegionSplitReverted(HRegionInfo hri) throws IOException
RegionStateListeneronRegionSplitReverted in interface RegionStateListenerhri - An instance of HRegionInfoIOException - Signals that an I/O exception has occurred.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.