use of org.apache.ignite.internal.processors.cache.persistence.RowStore in project ignite by apache.
the class GridCacheProcessor method pagesListViewSupplier.
/**
* Pages list view supplier.
*
* @param filter Filter.
*/
private Iterable<CachePagesListView> pagesListViewSupplier(Map<String, Object> filter) {
Integer cacheGrpId = (Integer) filter.get(CachePagesListViewWalker.CACHE_GROUP_ID_FILTER);
Integer partId = (Integer) filter.get(CachePagesListViewWalker.PARTITION_ID_FILTER);
Integer bucketNum = (Integer) filter.get(CachePagesListViewWalker.BUCKET_NUMBER_FILTER);
Iterable<IgniteCacheOffheapManager.CacheDataStore> dataStores = F.flat(F.iterator(filteredMap(cacheGrps, cacheGrpId).values(), grp -> grp.offheap().cacheDataStores(), true));
return F.flat(F.iterator(dataStores, dataStore -> {
RowStore rowStore = dataStore.rowStore();
if (rowStore == null || !(dataStore instanceof GridCacheOffheapManager.GridCacheDataStore))
return Collections.emptySet();
PagesList pagesList = (PagesList) rowStore.freeList();
if (bucketNum != null) {
return bucketNum >= 0 && bucketNum < pagesList.bucketsCount() ? Collections.singleton(new CachePagesListView(pagesList, bucketNum, dataStore.partId())) : Collections.emptyList();
}
return IntStream.range(0, pagesList.bucketsCount()).mapToObj(bucket -> new CachePagesListView(pagesList, bucket, dataStore.partId())).collect(toList());
}, true, cacheDataStore -> partId == null || cacheDataStore.partId() == partId));
}
Aggregations