use of org.apache.ignite.spi.systemview.view.PartitionStateView in project ignite by apache.
the class GridCacheProcessor method partStatesViewSupplier.
/**
* Partition states view supplier.
*
* @param filter Filter.
*/
private Iterable<PartitionStateView> partStatesViewSupplier(Map<String, Object> filter) {
Integer cacheGrpId = (Integer) filter.get(PartitionStateViewWalker.CACHE_GROUP_ID_FILTER);
UUID nodeId = (UUID) filter.get(PartitionStateViewWalker.NODE_ID_FILTER);
Integer partId = (Integer) filter.get(PartitionStateViewWalker.PARTITION_ID_FILTER);
return () -> F.concat(F.concat(F.iterator(filteredMap(cacheGrps, cacheGrpId).values(), grp -> F.iterator(filteredMap(grp.topology().partitionMap(false), nodeId).entrySet(), nodeToParts -> F.iterator(filteredMap(nodeToParts.getValue().map(), partId == null || partId < 0 ? null : partId).entrySet(), partToStates -> new PartitionStateView(grp.groupId(), nodeToParts.getKey(), partToStates.getKey(), partToStates.getValue(), isPrimary(grp, nodeToParts.getKey(), partToStates.getKey())), true), true), true)));
}
Aggregations