Adding async backups to MastershipStore
Change-Id: I36acece744b67a129a1073e08cd90690a91836ce
Showing
1 changed file
with
8 additions
and
0 deletions
| ... | @@ -17,6 +17,7 @@ package org.onlab.onos.store.hz; | ... | @@ -17,6 +17,7 @@ package org.onlab.onos.store.hz; |
| 17 | 17 | ||
| 18 | import com.hazelcast.config.Config; | 18 | import com.hazelcast.config.Config; |
| 19 | import com.hazelcast.config.FileSystemXmlConfig; | 19 | import com.hazelcast.config.FileSystemXmlConfig; |
| 20 | +import com.hazelcast.config.MapConfig; | ||
| 20 | import com.hazelcast.core.Hazelcast; | 21 | import com.hazelcast.core.Hazelcast; |
| 21 | import com.hazelcast.core.HazelcastInstance; | 22 | import com.hazelcast.core.HazelcastInstance; |
| 22 | 23 | ||
| ... | @@ -46,6 +47,13 @@ public class StoreManager implements StoreService { | ... | @@ -46,6 +47,13 @@ public class StoreManager implements StoreService { |
| 46 | public void activate() { | 47 | public void activate() { |
| 47 | try { | 48 | try { |
| 48 | Config config = new FileSystemXmlConfig(HAZELCAST_XML_FILE); | 49 | Config config = new FileSystemXmlConfig(HAZELCAST_XML_FILE); |
| 50 | + | ||
| 51 | + MapConfig roles = config.getMapConfig("nodeRoles"); | ||
| 52 | + roles.setAsyncBackupCount(MapConfig.MAX_BACKUP_COUNT - roles.getBackupCount()); | ||
| 53 | + | ||
| 54 | + MapConfig terms = config.getMapConfig("terms"); | ||
| 55 | + terms.setAsyncBackupCount(MapConfig.MAX_BACKUP_COUNT - terms.getBackupCount()); | ||
| 56 | + | ||
| 49 | instance = Hazelcast.newHazelcastInstance(config); | 57 | instance = Hazelcast.newHazelcastInstance(config); |
| 50 | log.info("Started"); | 58 | log.info("Started"); |
| 51 | } catch (FileNotFoundException e) { | 59 | } catch (FileNotFoundException e) { | ... | ... |
-
Please register or login to post a comment