Description
From a user:
I was trying to get a custom partition resolver example working. The way geode-examples works is by configuring the servers via gfsh so I used:
create region --name=example-region --type=PARTITION --partition-resolver=org.apache.geode.examples.functions.EvenOddPartitionResolver --redundant-copies=0
Alas, this didn't work. [Jared: note - this was likely due to https://issues.apache.org/jira/browse/GEODE-3460] I found a way to get it to work in Java:
PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory(); partitionAttributesFactory .addFixedPartitionAttributes(FixedPartitionAttributes.createFixedPartition("ODD", 1)); partitionAttributesFactory .addFixedPartitionAttributes(FixedPartitionAttributes.createFixedPartition("EVEN", 1)); partitionAttributesFactory.setPartitionResolver(new EvenOddPartitionResolver()); partitionAttributesFactory.setRedundantCopies(1);
It appears that it was necessary to create the fixed partitions for the custom partition resolver to find.