use of org.apache.ignite.internal.cache.query.index.sorted.IndexRowImpl in project ignite by apache.
the class H2RowCacheSelfTest method getLinkForKey.
/**
* @param cacheName Cache name.
* @param rowCache Row cache.
* @param key Key to find.
* @return Row's link.
*/
private long getLinkForKey(String cacheName, IndexRowCache rowCache, int key) {
grid().cache(cacheName).query(new SqlQuery(Value.class, "_key = " + key)).getAll().size();
ConcurrentLinkedHashMap<Long, IndexRowImpl> rowsMap = GridTestUtils.getFieldValue(rowCache, "rows");
for (Map.Entry<Long, IndexRowImpl> e : rowsMap.entrySet()) {
IndexRowImpl val = e.getValue();
KeyCacheObject rowKey = val.cacheDataRow().key();
if ((Integer) rowKey.value(null, false) == key)
return e.getKey();
}
fail("Row cache doesn't contain key [key=" + key + ']');
return -1;
}
Aggregations