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