public class CacheContext extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CacheContext.StatsUnit
Stats Unit.
|
Modifier | Constructor and Description |
---|---|
protected |
CacheContext()
Expected to be inherited in PrestoDB or other local cache caller.
|
Modifier and Type | Method and Description |
---|---|
static CacheContext |
defaults() |
boolean |
equals(Object o) |
String |
getCacheIdentifier()
Returns an string as a hint from computation to indicate the file.
|
CacheQuota |
getCacheQuota() |
CacheScope |
getCacheScope() |
HiveCacheContext |
getHiveCacheContext() |
int |
hashCode() |
void |
incrementCounter(String name,
CacheContext.StatsUnit unit,
long value)
Increments the counter
name by value . |
void |
incrementCounter(String name,
long value)
Increments the counter
name by value . |
boolean |
isTemporary() |
CacheContext |
setCacheIdentifier(String identifier) |
CacheContext |
setCacheQuota(CacheQuota cacheQuota) |
CacheContext |
setCacheScope(CacheScope cacheScope) |
CacheContext |
setHiveCacheContext(HiveCacheContext hiveCacheContext) |
CacheContext |
setTemporary(boolean isTemporary) |
String |
toString() |
protected CacheContext()
public static CacheContext defaults()
@Nullable public String getCacheIdentifier()
@Nullable public HiveCacheContext getHiveCacheContext()
public CacheQuota getCacheQuota()
public CacheScope getCacheScope()
public CacheContext setCacheIdentifier(String identifier)
identifier
- the id to useCacheContext
public CacheContext setCacheQuota(CacheQuota cacheQuota)
cacheQuota
- the cache quotaCacheContext
public CacheContext setCacheScope(CacheScope cacheScope)
cacheScope
- the cache quotaCacheContext
public CacheContext setHiveCacheContext(HiveCacheContext hiveCacheContext)
hiveCacheContext
- the hive cache contextCacheContext
public boolean isTemporary()
public CacheContext setTemporary(boolean isTemporary)
isTemporary
- whether the caching data is temporaryCacheContext
public void incrementCounter(String name, long value)
name
by value
.
Default implementation does nothing. Subclass can implement its own tracking mechanism.
name
- name of the countervalue
- value of the counterpublic void incrementCounter(String name, CacheContext.StatsUnit unit, long value)
name
by value
.
Default implementation does nothing. Subclass can implement its own tracking mechanism.
name
- name of the counterunit
- unit of the countervalue
- value of the counterCopyright © 2023. All Rights Reserved.