Search in sources :

Example 1 with GlobalCache

use of org.apache.phoenix.cache.GlobalCache in project phoenix by apache.

the class MetaDataEndpointImpl method clearCache.

@Override
public void clearCache(RpcController controller, ClearCacheRequest request, RpcCallback<ClearCacheResponse> done) {
    GlobalCache cache = GlobalCache.getInstance(this.env);
    Cache<ImmutableBytesPtr, PMetaDataEntity> metaDataCache = GlobalCache.getInstance(this.env).getMetaDataCache();
    metaDataCache.invalidateAll();
    long unfreedBytes = cache.clearTenantCache();
    ClearCacheResponse.Builder builder = ClearCacheResponse.newBuilder();
    builder.setUnfreedBytes(unfreedBytes);
    done.run(builder.build());
}
Also used : GlobalCache(org.apache.phoenix.cache.GlobalCache) PMetaDataEntity(org.apache.phoenix.schema.PMetaDataEntity) ImmutableBytesPtr(org.apache.phoenix.hbase.index.util.ImmutableBytesPtr) ClearCacheResponse(org.apache.phoenix.coprocessor.generated.MetaDataProtos.ClearCacheResponse)

Aggregations

GlobalCache (org.apache.phoenix.cache.GlobalCache)1 ClearCacheResponse (org.apache.phoenix.coprocessor.generated.MetaDataProtos.ClearCacheResponse)1 ImmutableBytesPtr (org.apache.phoenix.hbase.index.util.ImmutableBytesPtr)1 PMetaDataEntity (org.apache.phoenix.schema.PMetaDataEntity)1