0

I am iterating over large data set using thin client and i only need list of keys from the Ignite cache Is there a way to do it?

The value are very heavy as they are actual data files and key is UUID.

Rohan19
  • 11
  • 1

1 Answers1

1

If you enable SQL support for your table, you can use query using the "virtual" column _key:

try (QueryCursor<List<?>> cur = cache2.query(new SqlFieldsQuery("select _key from table"))) {
    for (List<?> r : cur) {
        Long key = (Long)r.get(0);
    }
}
Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
  • Hi Thanks for your suggestion it worked, I have few other related questions for better understanding 1) Can the cache configuration be provided to the Server IgniteConfiguration after the server/node has started? 2) Also is it possible to delay the creation of cache ? Server node is creating the cache as soon as i start the node. I am using **Thin client** – Rohan19 Nov 22 '21 at 17:37
  • You can create the caches in code or XML, on the server or on the thick-client. Thin clients can also create caches. – Stephen Darlington Nov 24 '21 at 09:58