Raghu DV
Raghu DV

Reputation: 258

How to get all keys from the cache in Apache Ignite C++

There is a function specified to get the values based on the keys.

std::map<K, V> GetAll(const std::set<K>& keys)

How can I retrieve all the keys that are present in all the nodes for a cache?

Upvotes: 2

Views: 734

Answers (1)

isapego
isapego

Reputation: 463

You can use ScanQuery for this:

ScanQuery qry;
QueryCursor<int, QueryPerson> cursor = cache.Query(qry);
while (cursor.HasNext())
{
    CacheEntry<int, QueryPerson> entry = cursor.GetNext();

    std::cout << entry.GetKey() << std::endl;
}

Upvotes: 3

Related Questions