happy programmer
happy programmer

Reputation: 110

hazelcast imap does't read from backup

I want to read from backup of the map to improve the performance.But I read the source code of GetOperation and find recordStore.get(dataKey, false) in this class which make read from backup false.

`

@Override
    public void run() {
        MapServiceContext mapServiceContext = mapService.getMapServiceContext();
        result = mapServiceContext.toData(recordStore.get(dataKey, false));
    }

`

Then how read from backup of map?

Upvotes: 0

Views: 371

Answers (2)

tom.bujok
tom.bujok

Reputation: 1642

First, <read-backup-data> has to be enabled.

Second, it works only on a member, so e.g. when you execute a task in an Executor service, and use an IMap.

This means you need a member-side reference to an Imap proxy. It won't work from a client.

Upvotes: 2

Oquance
Oquance

Reputation: 1

There is a configuration element <read-backup-data> in Hazelcast XML configuration. When it is set to "true", it should be enabled.

Upvotes: 0

Related Questions