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()); }
protected void destroySegments(String name) { for (CachePartitionSegment segment : segments) { segment.deleteCache(name); } }