java.lang.Object
org.elasticsearch.indices.IndicesQueryCache
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.search.QueryCache
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearIndex(String index) Clear all entries that belong to the given index.voidclose()org.apache.lucene.search.WeightdoCache(org.apache.lucene.search.Weight weight, org.apache.lucene.search.QueryCachingPolicy policy) longgetCacheSizeForShard(ShardId shardId) getCacheTotalsForAllShards(IndicesService indicesService) Computes the total cache size in bytes, and the total shard count in the cache for all shards.longgetSharedRamSizeForAllShards(IndicesService indicesService) Calculates a map ofShardIdtoLongwhich contains the calculated share of theIndicesQueryCacheshared ram size for a given shard (that is, the sum of all the longs is the size of the indices query cache).longgetSharedRamSizeForShard(ShardId shardId, IndicesQueryCache.CacheTotals cacheTotals) This method computes the shared RAM size in bytes for the given indexShard.Get usage statistics for the given shard.void
-
Field Details
-
INDICES_CACHE_QUERY_SIZE_SETTING
-
INDICES_CACHE_QUERY_COUNT_SETTING
-
INDICES_QUERIES_CACHE_ALL_SEGMENTS_SETTING
-
-
Constructor Details
-
IndicesQueryCache
-
-
Method Details
-
getCacheSizeForShard
-
getCacheTotalsForAllShards
public static IndicesQueryCache.CacheTotals getCacheTotalsForAllShards(IndicesService indicesService) Computes the total cache size in bytes, and the total shard count in the cache for all shards.- Parameters:
indicesService- the IndicesService instance to retrieve cache information from- Returns:
- A CacheTotals object containing the computed total number of items in the cache and the number of shards seen in the cache
-
getStats
Get usage statistics for the given shard. -
doCache
public org.apache.lucene.search.Weight doCache(org.apache.lucene.search.Weight weight, org.apache.lucene.search.QueryCachingPolicy policy) - Specified by:
doCachein interfaceorg.apache.lucene.search.QueryCache
-
clearIndex
Clear all entries that belong to the given index. -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
onClose