Passing the totalNumBuckets to the lucene index regions
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8b56020d Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8b56020d Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8b56020d Branch: refs/heads/develop Commit: 8b56020d1e6968e6a2a91bec20f00565ed168d9f Parents: 7d50cf1 Author: Dan Smith <[email protected]> Authored: Fri Oct 16 12:46:37 2015 -0700 Committer: Dan Smith <[email protected]> Committed: Fri Oct 16 12:46:55 2015 -0700 ---------------------------------------------------------------------- .../cache/lucene/internal/LuceneIndexForPartitionedRegion.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b56020d/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java ---------------------------------------------------------------------- diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java index d0bb328..0e5b424 100644 --- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java +++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java @@ -2,6 +2,7 @@ package com.gemstone.gemfire.cache.lucene.internal; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.PartitionAttributes; import com.gemstone.gemfire.cache.PartitionAttributesFactory; import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.RegionShortcut; @@ -64,9 +65,11 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl { // create PR fileRegion, but not to create its buckets for now final String fileRegionName = LuceneServiceImpl.getUniqueIndexName(indexName, regionPath)+".files"; fileRegion = cache.<String, File> getRegion(fileRegionName); + PartitionAttributes partitionAttributes = dataRegion.getPartitionAttributes(); if (null == fileRegion) { fileRegion = cache.<String, File> createRegionFactory(regionShortCut) .setPartitionAttributes(new PartitionAttributesFactory<String, File>().setColocatedWith(regionPath) + .setTotalNumBuckets(partitionAttributes.getTotalNumBuckets()) .create()) .create(fileRegionName); } @@ -77,6 +80,7 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl { if (null == chunkRegion) { chunkRegion = cache.<ChunkKey, byte[]> createRegionFactory(regionShortCut) .setPartitionAttributes(new PartitionAttributesFactory<ChunkKey, byte[]>().setColocatedWith(fileRegionName) + .setTotalNumBuckets(partitionAttributes.getTotalNumBuckets()) .create()) .create(chunkRegionName); }
