Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-2656 gfsh should be at parity with cache.xml
  3. GEODE-3541

Add GFSH api for creating regions with a FixedPartitionResolver

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • docs, gfsh
    • None

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jstewart Jared Stewart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: