Query Apache Ignite's cache for a local backup entries only

424 views Asked by At

We can use Ignite's ScanQuery object for example to query only a local cache for entries. Like this:

    ScanQuery<Object, Object> qry = new ScanQuery<>()
                    .setLocal(true);

Now, if we have a cache with cacheConfiguration.setBackups(1), is there any way to query only backup entries, locally stored on a node?

It is possible if we use

igniteCache.localEntries(CachePeekMode.BACKUP);

But, I would really need a ScanQuery here, for its setPageSize method.

1

There are 1 answers

4
Evgenii Zhuravlev On BEST ANSWER

It's not possible to use ScanQuery on local node only from backups, so, I think you should use

igniteCache.localEntries(CachePeekMode.BACKUP)

for this case.

By the way, what is your use case? Maybe I can recommend something better for you.