Hi Avinash, Any time you try to use a bucket it will get created. It doesn't matter if you are trying to put or get values.
-Dan On Sat, Feb 4, 2017 at 9:32 PM, Avinash Dongre <adon...@apache.org> wrote: > Hi, > In the following test, I have one PR, No buckets will be created initially. > But when I call get on non-existing-key, I see 1 bucket is created. > > Why bucket is getting created during get call when the Region is empty. > > @Test > public void testBucketCreatedDuringGet() { > Properties props = new Properties(); > props.put("mcast-port", "0"); > props.put("locators", ""); > > Cache cache = new CacheFactory(props).create(); > PartitionedRegion pr = (PartitionedRegion) > cache.createRegionFactory(RegionShortcut.PARTITION).create("PR"); > > org.junit.Assert.assertEquals(0, > pr.getDataStore().getAllLocalBucketIds().size()); > > Object notExist = pr.get("NonExistingKey"); > org.junit.Assert.assertNull(notExist); > > org.junit.Assert.assertEquals(0, > pr.getDataStore().getAllLocalBucketIds().size()); > > pr.destroyRegion(); > cache.close(); > > } > > Thanks > > Avinash >