JAYAPRAKASH
JAYAPRAKASH

Reputation: 51

Getting All keys from Apache Ignite cache from Java Thin client

Now i am using apache ignite 2.8.0.

  public void run(){  

        for(int i=0;i<100000;i++)
        {
         c.put(i,s);  
        }}

I was put all the values by above code, now i want to get all the keys in that cache, how can i get all the keys from java thin client?

Upvotes: 0

Views: 1689

Answers (1)

alamar
alamar

Reputation: 19313

You can use Scan Query to do that. Scan the whole cache or on per partition basis. There's a documentation on using queries with thin client (it mostly concerns SQL, should work with ScanQuery too).

The simplest one should be cache.query(new ScanQuery()).getAll(); // Returns a collection of key-value pairs.

Upvotes: 3

Related Questions