cursors.add(store.cursor(cctx.cacheId(), lowerObj, upperObj, null, mvccSnapshot));
GridCursor<? extends CacheDataRow> cur = store.cursor();
GridCursor<? extends CacheDataRow> cursor = part.dataStore().cursor(KEY_ONLY);
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(MvccSnapshot mvccSnapshot) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(mvccSnapshot); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor() throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(Object x) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(x); return EMPTY_CURSOR; }
GridCursor<? extends CacheDataRow> cursor = part.dataStore().cursor(cctx.cacheId(), null, null, CacheDataRowAdapter.RowData.KEY_ONLY);
final GridCursor<? extends CacheDataRow> cur = data.cursor();
/** {@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; } }; }
/** * @param ignite Ignite. * @param orgId Organization id. * @return Count of found Person object with specified orgId * @throws Exception If failed. */ private static int getPersonsCountFromPartitionMap(final IgniteEx ignite, int orgId) throws Exception { int part = ignite.affinity(Organization.class.getSimpleName()).partition(orgId); GridCacheAdapter<?, ?> cacheAdapterPers = ignite.context().cache() .internalCache(Person.class.getSimpleName()); GridDhtLocalPartition pPers = cacheAdapterPers.context().topology() .localPartition(part, AffinityTopologyVersion.NONE, false); int cnt = 0; GridCursor<? extends CacheDataRow> c = pPers.dataStore().cursor(); CacheObjectContext ctx = cacheAdapterPers.context().cacheObjectContext(); while (c.next()) { CacheDataRow e = c.get(); Person.Key k = e.key().value(ctx, false); Person p = e.value().value(ctx, false); if (p != null && p.getOrgId() == orgId && k.orgId == orgId) ++cnt; } return cnt; }
/** * Check versions presence in index tree. * * @param srv Node. * @param afterRebuild Whether index rebuild has occurred. * @throws IgniteCheckedException if failed. */ @SuppressWarnings({"ConstantConditions", "unchecked"}) protected void checkDataState(IgniteEx srv, boolean afterRebuild) throws IgniteCheckedException { IgniteInternalCache icache = srv.cachex(CACHE_NAME); IgniteCache cache = srv.cache(CACHE_NAME); assertNotNull(icache); for (IgniteCacheOffheapManager.CacheDataStore store : icache.context().offheap().cacheDataStores()) { GridCursor<? extends CacheDataRow> cur = store.cursor(); while (cur.next()) { CacheDataRow row = cur.get(); int key = row.key().value(icache.context().cacheObjectContext(), false); if (!afterRebuild || key <= AMOUNT / 2) assertEquals(key, cache.get(key)); else assertEquals(-1, cache.get(key)); } } }
/** * @param ignite Ignite. * @param orgId Organization id. * @return Count of found Person object with specified orgId * @throws Exception If failed. */ private static int getOrganizationCountFromPartitionMap(final IgniteEx ignite, int orgId) throws Exception { int part = ignite.affinity(Organization.class.getSimpleName()).partition(orgId); GridCacheAdapter<?, ?> cacheAdapterOrg = ignite.context().cache() .internalCache(Organization.class.getSimpleName()); GridDhtLocalPartition pOrgs = cacheAdapterOrg.context().topology() .localPartition(part, AffinityTopologyVersion.NONE, false); int cnt = 0; GridCursor<? extends CacheDataRow> c = pOrgs.dataStore().cursor(); CacheObjectContext ctx = cacheAdapterOrg.context().cacheObjectContext(); while (c.next()) { CacheDataRow e = c.get(); Integer k = e.key().value(ctx, false); Organization org = e.value().value(ctx, false); if (org != null && org.getId() == orgId) ++cnt; } return cnt; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper, Object x, MvccSnapshot mvccSnapshot) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(cacheId, lower, upper, x, mvccSnapshot); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(MvccSnapshot mvccSnapshot) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(mvccSnapshot); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(Object x) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(x); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(int cacheId, MvccSnapshot mvccSnapshot) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(cacheId, mvccSnapshot); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor( int cacheId, KeyCacheObject lower, KeyCacheObject upper) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(cacheId, lower, upper); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor() throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(int cacheId) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(cacheId); return EMPTY_CURSOR; }
/** {@inheritDoc} */ @Override public GridCursor<? extends CacheDataRow> cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper, Object x) throws IgniteCheckedException { CacheDataStore delegate = init0(true); if (delegate != null) return delegate.cursor(cacheId, lower, upper, x); return EMPTY_CURSOR; }