@InterfaceAudience.Private @InterfaceStability.Evolving public class QuotaCache extends Object implements Stoppable
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
QuotaCache.Fetcher<Key,Value> |
private class |
QuotaCache.QuotaRefresherChore |
Modifier and Type | Field and Description |
---|---|
private static int |
EVICT_PERIOD_FACTOR |
private static org.apache.commons.logging.Log |
LOG |
private ConcurrentHashMap<String,QuotaState> |
namespaceQuotaCache |
static String |
REFRESH_CONF_KEY |
private static int |
REFRESH_DEFAULT_PERIOD |
private QuotaCache.QuotaRefresherChore |
refreshChore |
private RegionServerServices |
rsServices |
private boolean |
stopped |
private ConcurrentHashMap<TableName,QuotaState> |
tableQuotaCache |
private static boolean |
TEST_FORCE_REFRESH |
private ConcurrentHashMap<String,UserQuotaState> |
userQuotaCache |
Constructor and Description |
---|
QuotaCache(RegionServerServices rsServices) |
Modifier and Type | Method and Description |
---|---|
(package private) long |
getLastUpdate() |
QuotaLimiter |
getNamespaceLimiter(String namespace)
Returns the limiter associated to the specified namespace.
|
(package private) Map<String,QuotaState> |
getNamespaceQuotaCache() |
private <K> QuotaState |
getQuotaState(ConcurrentHashMap<K,QuotaState> quotasMap,
K key)
Returns the QuotaState requested.
|
QuotaLimiter |
getTableLimiter(TableName table)
Returns the limiter associated to the specified table.
|
(package private) Map<TableName,QuotaState> |
getTableQuotaCache() |
QuotaLimiter |
getUserLimiter(org.apache.hadoop.security.UserGroupInformation ugi,
TableName table)
Returns the limiter associated to the specified user/table.
|
(package private) Map<String,UserQuotaState> |
getUserQuotaCache() |
UserQuotaState |
getUserQuotaState(org.apache.hadoop.security.UserGroupInformation ugi)
Returns the QuotaState associated to the specified user.
|
boolean |
isStopped() |
static boolean |
isTEST_FORCE_REFRESH() |
static void |
setTEST_FORCE_REFRESH(boolean tEST_FORCE_REFRESH) |
void |
start() |
void |
stop(String why)
Stop this service.
|
(package private) void |
triggerCacheRefresh() |
private static final org.apache.commons.logging.Log LOG
public static final String REFRESH_CONF_KEY
private static final int REFRESH_DEFAULT_PERIOD
private static final int EVICT_PERIOD_FACTOR
private static boolean TEST_FORCE_REFRESH
private final ConcurrentHashMap<String,QuotaState> namespaceQuotaCache
private final ConcurrentHashMap<TableName,QuotaState> tableQuotaCache
private final ConcurrentHashMap<String,UserQuotaState> userQuotaCache
private final RegionServerServices rsServices
private QuotaCache.QuotaRefresherChore refreshChore
private boolean stopped
public QuotaCache(RegionServerServices rsServices)
public void start() throws IOException
IOException
public boolean isStopped()
isStopped
in interface Stoppable
Stoppable.stop(String)
has been closed.public QuotaLimiter getUserLimiter(org.apache.hadoop.security.UserGroupInformation ugi, TableName table)
ugi
- the user to limittable
- the table to limitpublic UserQuotaState getUserQuotaState(org.apache.hadoop.security.UserGroupInformation ugi)
ugi
- the userpublic QuotaLimiter getTableLimiter(TableName table)
table
- the table to limitpublic QuotaLimiter getNamespaceLimiter(String namespace)
namespace
- the namespace to limitprivate <K> QuotaState getQuotaState(ConcurrentHashMap<K,QuotaState> quotasMap, K key)
void triggerCacheRefresh()
long getLastUpdate()
Map<String,QuotaState> getNamespaceQuotaCache()
Map<TableName,QuotaState> getTableQuotaCache()
Map<String,UserQuotaState> getUserQuotaCache()
public static boolean isTEST_FORCE_REFRESH()
public static void setTEST_FORCE_REFRESH(boolean tEST_FORCE_REFRESH)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.