コード例 #1
0
  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());
  }
コード例 #2
0
 protected void destroySegments(String name) {
   for (CachePartitionSegment segment : segments) {
     segment.deleteCache(name);
   }
 }