long partSize = part.dataStore().fullSize();
GridCursor<? extends CacheDataRow> cur = store.cursor(); List<IgniteBiTuple<Object, MvccVersion>> vers = store.mvccFindAllVersions(icache.context(), row.key());
boolean needSnapshot ) throws IgniteCheckedException { RowStore rowStore0 = store.rowStore(); long updCntr = store.updateCounter(); long size = store.fullSize(); long rmvId = globalRemoveId().get(); long partMetaId = pageMem.partitionMetaPageId(grpId, store.partId()); Map<Integer, Long> newSizes = store.cacheSizes(); Map<Integer, Long> prevSizes = readSharedGroupCacheSizes(pageMem, grpId, initCntrPageId); store.partId(), newSizes); pageCnt = this.ctx.pageStore().pages(grpId, store.partId()); io, grpId, store.partId(), this.ctx.pageStore().pages(grpId, store.partId()), store.fullSize() )) U.warn(log, "Partition was concurrently evicted grpId=" + grpId + log.info("Will not include SQL indexes to snapshot because there is " + "a partition not in " + OWNING + " state [grp=" + grp.cacheOrGroupName() + ", partId=" + store.partId() + ", state=" + state + ']');
long partSize = part.dataStore().fullSize();
continue; long cacheSize = part.dataStore().cacheSize(cctx.cacheId());
GridCursor<? extends CacheDataRow> cursor = part.dataStore().cursor(KEY_ONLY);
partSize = part.dataStore().fullSize();
return Collections.emptyMap(); partSize = part.dataStore().fullSize();
partSize = part.dataStore().fullSize();
GridCursor<? extends CacheDataRow> cursor = part.dataStore().cursor(cctx.cacheId(), null, null, CacheDataRowAdapter.RowData.KEY_ONLY);
int p = part.id(); long sz = part.dataStore().cacheSize(ca.context().cacheId());
final GridCursor<? extends CacheDataRow> cur = data.cursor();
/** * Callback invoked on cache registration within indexing. * * @param cctx Cache context. */ public void onCacheRegistered(GridCacheContext cctx) { if (!cctx.config().isSqlOnheapCacheEnabled()) return; synchronized (mux) { int grpId = cctx.groupId(); if (caches != null) { H2RowCache cache = caches.get(grpId); if (cache != null) { cache.onCacheRegistered(); return; } } HashMap<Integer, H2RowCache> caches0 = copy(); H2RowCache rowCache = new H2RowCache(cctx.group(), cctx.config().getSqlOnheapCacheMaxSize()); caches0.put(grpId, rowCache); caches = caches0; // Inject row cache cleaner into store on cache creation. // Used in case the cache with enabled SqlOnheapCache is created in exists cache group // and SqlOnheapCache is disbaled for the caches have been created before. for (IgniteCacheOffheapManager.CacheDataStore ds : cctx.offheap().cacheDataStores()) ds.setRowCacheCleaner(rowCache); } }
/** {@inheritDoc} */ @Override public GridCloseableIterator<KeyCacheObject> cacheKeysIterator(int cacheId, final int part) throws IgniteCheckedException { CacheDataStore data = partitionData(part); if (data == null) return new GridEmptyCloseableIterator<>(); final GridCursor<? extends CacheDataRow> cur = data.cursor(cacheId, null, null, CacheDataRowAdapter.RowData.KEY_ONLY); return new GridCloseableIteratorAdapter<KeyCacheObject>() { /** */ private KeyCacheObject next; @Override protected KeyCacheObject onNext() { KeyCacheObject res = next; next = null; return res; } @Override protected boolean onHasNext() throws IgniteCheckedException { if (next != null) return true; if (cur.next()) { CacheDataRow row = cur.get(); next = row.key(); } return next != null; } }; }
/** {@inheritDoc} */ @Override public Cursor find(Session ses, final SearchRow lower, final SearchRow upper) { IndexingQueryCacheFilter filter = null; MvccSnapshot mvccSnapshot = null; GridH2QueryContext qctx = GridH2QueryContext.get(); if (qctx != null) { IndexingQueryFilter f = qctx.filter(); filter = f != null ? f.forCache(getTable().cacheName()) : null; mvccSnapshot = qctx.mvccSnapshot(); } assert !cctx.mvccEnabled() || mvccSnapshot != null; KeyCacheObject lowerObj = lower != null ? cctx.toCacheKeyObject(lower.getValue(0).getObject()) : null; KeyCacheObject upperObj = upper != null ? cctx.toCacheKeyObject(upper.getValue(0).getObject()) : null; try { Collection<GridCursor<? extends CacheDataRow>> cursors = new ArrayList<>(); for (IgniteCacheOffheapManager.CacheDataStore store : cctx.offheap().cacheDataStores()) if (filter == null || filter.applyPartition(store.partId())) cursors.add(store.cursor(cctx.cacheId(), lowerObj, upperObj, null, mvccSnapshot)); return new H2Cursor(cursors.iterator()); } catch (IgniteCheckedException e) { throw DbException.convert(e); } }
/** {@inheritDoc} */ @Override public void printMemoryStats(int threshold) { X.println(">>> Cache partition topology stats [igniteInstanceName=" + ctx.igniteInstanceName() + ", grp=" + grp.cacheOrGroupName() + ']'); lock.readLock().lock(); try { for (int i = 0; i < locParts.length(); i++) { GridDhtLocalPartition part = locParts.get(i); if (part == null) continue; long size = part.dataStore().fullSize(); if (size >= threshold) X.println(">>> Local partition [part=" + part.id() + ", size=" + size + ']'); } } finally { lock.readLock().unlock(); } }
/** {@inheritDoc} */ @Override public long cacheEntriesCount( int cacheId, boolean primary, boolean backup, AffinityTopologyVersion topVer ) throws IgniteCheckedException { if (grp.isLocal()) return cacheEntriesCount(cacheId, 0); else { long cnt = 0; Iterator<CacheDataStore> it = cacheData(primary, backup, topVer); while (it.hasNext()) cnt += it.next().cacheSize(cacheId); return cnt; } }
/** {@inheritDoc} */ @Override public final void destroyCacheDataStore(CacheDataStore store) throws IgniteCheckedException { int p = store.partId(); partStoreLock.lock(p); try { boolean removed = partDataStores.remove(p, store); assert removed; destroyCacheDataStore0(store); } catch (IgniteCheckedException e) { throw new IgniteException(e); } finally { partStoreLock.unlock(p); } }