public CacheReplicationOperation(CachePartitionSegment segment, int replicaIndex) { data = new HashMap<String, Map<Data, CacheRecord>>(); Iterator<ICacheRecordStore> iter = segment.cacheIterator(); while (iter.hasNext()) { ICacheRecordStore cacheRecordStore = iter.next(); CacheConfig cacheConfig = cacheRecordStore.getConfig(); if (cacheConfig.getAsyncBackupCount() + cacheConfig.getBackupCount() >= replicaIndex) { data.put(cacheRecordStore.getName(), cacheRecordStore.getReadOnlyRecords()); } } configs = new ArrayList<CacheConfig>(segment.getCacheConfigs()); }
@Override public final int getAsyncBackupCount() { return cache != null ? cache.getConfig().getAsyncBackupCount() : 0; }