use of org.apache.ignite.internal.processors.datastructures.AtomicDataStructureValue in project ignite by apache.
the class ViewCacheClosure method collectSequences.
/**
* @param ctx Context.
* @param compiled Compiled pattern.
* @param cacheInfo Cache info.
*/
private void collectSequences(GridKernalContext ctx, Pattern compiled, List<CacheInfo> cacheInfo) throws IgniteCheckedException {
String dsCacheName = DataStructuresProcessor.ATOMICS_CACHE_NAME + "@default-ds-group";
IgniteInternalCache<GridCacheInternalKey, AtomicDataStructureValue> cache0 = ctx.cache().cache(dsCacheName);
final Iterator<Cache.Entry<GridCacheInternalKey, AtomicDataStructureValue>> iter = cache0.scanIterator(false, null);
while (iter.hasNext()) {
Cache.Entry<GridCacheInternalKey, AtomicDataStructureValue> entry = iter.next();
final AtomicDataStructureValue val = entry.getValue();
if (val.type() == DataStructureType.ATOMIC_SEQ) {
final String name = entry.getKey().name();
if (compiled.matcher(name).find()) {
CacheInfo ci = new CacheInfo();
ci.setSeqName(name);
ci.setSeqVal(((GridCacheAtomicSequenceValue) val).get());
cacheInfo.add(ci);
}
}
}
}
Aggregations