@Override public boolean apply() { // Every node contains either near, backup, or primary. return cnt == cache.size() + near.nearSize(); } }, getTestTimeout()));
/** * Create data transfer object for given cache. * * @param ca Internal cache. * @param collectMetrics Collect cache metrics flag. * @throws IgniteCheckedException If failed to create data transfer object. */ public VisorCache(IgniteEx ignite, GridCacheAdapter ca, boolean collectMetrics) throws IgniteCheckedException { assert ca != null; GridCacheContext cctx = ca.context(); CacheConfiguration cfg = ca.configuration(); name = ca.name(); dynamicDeploymentId = cctx.dynamicDeploymentId(); mode = cfg.getCacheMode(); primarySize = ca.localSizeLong(PEEK_ONHEAP_PRIMARY); backupSize = ca.localSizeLong(PEEK_ONHEAP_BACKUP); nearSize = ca.nearSize(); size = primarySize + backupSize + nearSize; partitions = ca.affinity().partitions(); near = cctx.isNear(); if (collectMetrics) metrics = new VisorCacheMetrics(ignite, name); sys = ignite.context().cache().systemCache(name); statisticsEnabled = ca.clusterMetrics().isStatisticsEnabled(); }
heapEntriesCnt = cache.nearSize();
/** * Create data transfer object for given cache. * * @param ca Internal cache. * @param collectMetrics Collect cache metrics flag. * @throws IgniteCheckedException If failed to create data transfer object. */ public VisorCache(IgniteEx ignite, GridCacheAdapter ca, boolean collectMetrics) throws IgniteCheckedException { assert ca != null; GridCacheContext cctx = ca.context(); CacheConfiguration cfg = ca.configuration(); name = ca.name(); dynamicDeploymentId = cctx.dynamicDeploymentId(); mode = cfg.getCacheMode(); primarySize = ca.localSizeLong(PEEK_ONHEAP_PRIMARY); backupSize = ca.localSizeLong(PEEK_ONHEAP_BACKUP); nearSize = ca.nearSize(); size = primarySize + backupSize + nearSize; partitions = ca.affinity().partitions(); near = cctx.isNear(); if (collectMetrics) metrics = new VisorCacheMetrics(ignite, name); sys = ignite.context().cache().systemCache(name); }
heapEntriesCnt = cctx.cache().nearSize();