private boolean reindexUserDataRegion(Integer bucketId, PartitionedRegion userRegion, PartitionedRegion fileRegion, BucketRegion dataBucket, IndexRepository repo) throws IOException { Set<IndexRepository> affectedRepos = new HashSet<IndexRepository>(); for (Object key : dataBucket.keySet()) { Object value = getValue(userRegion.getEntry(key)); if (value != null) { repo.update(key, value); } else { repo.delete(key); } affectedRepos.add(repo); } for (IndexRepository affectedRepo : affectedRepos) { affectedRepo.commit(); } // fileRegion ops (get/put) need bucketId as a callbackArg for PartitionResolver fileRegion.put(APACHE_GEODE_INDEX_COMPLETE, APACHE_GEODE_INDEX_COMPLETE, bucketId); return true; }
repo.commit();