You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by Olivier Mallassi <ol...@gmail.com> on 2016/04/08 12:28:38 UTC

programmatically create partition regions

Hello everybody,

my apologies if the question has already been asked on the ML (I cannot
find the answer in the archive).

I have a need to programmatically create / delete region. I am not talking
about creating / deleting regions every second or minutes. the need is a
pure administration need (being able to create regions via an REST API).

I have found the sample code in the documentation (
http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
and was wondering if you can help with the following questions
- why are we using this "metadataregion"? is it to support elasticity (add
/ remove nodes)? other reasons?
- Can we delete the regions using the same principle (with another
callback)?
- is it better to use the <dynamic-region-factory> knowing I need
partition_redundant regions? it looks not to be a valid option.

Many thanks for your help.

oliv/

Re: programmatically create partition regions

Posted by Real Wes Williams <Th...@outlook.com>.
An option that I use successfully, and simpler in my opinion, is a function that executes GFSH commands. It uses some internal capabilities but the simplicity of it makes it worthwhile to me.

I pass the string into my function as “gfshCommand”. This is a programmatic way of executing create region via gfsh.

create region --enable-statistics=true --type=PARTITION_REDUNDANT --name=prices

   public CommandResult executeInternal(final String gfshCommand) 
    		throws IllegalAccessException, 
    			IllegalArgumentException, 
    			InvocationTargetException,
    			RuntimeException {
      try {
        ParseResult parseResult = gfshParser.parse(gfshCommand);
        logWriter.fine("Executing the GFSH command");
        CommandResult commandResult = (CommandResult) parseResult.getMethod()
          .invoke(parseResult.getInstance(), parseResult.getArguments());
        return commandResult;
      } catch (CommandProcessingException e) {
          throw new RuntimeException("Gfsh could not execute your command.\n"
            + "Carefully check the spelling of your options and verify that the option is valid for the command.\n", e);
      }
    }


Wes Williams

> On Apr 8, 2016, at 6:28 AM, Olivier Mallassi <ol...@gmail.com> wrote:
> 
> Hello everybody,
> 
> my apologies if the question has already been asked on the ML (I cannot find the answer in the archive). 
> 
> I have a need to programmatically create / delete region. I am not talking about creating / deleting regions every second or minutes. the need is a pure administration need (being able to create regions via an REST API). 
> 
> I have found the sample code in the documentation (http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html <http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html>) and was wondering if you can help with the following questions
> - why are we using this "metadataregion"? is it to support elasticity (add / remove nodes)? other reasons? 
> - Can we delete the regions using the same principle (with another callback)? 
> - is it better to use the <dynamic-region-factory> knowing I need partition_redundant regions? it looks not to be a valid option.
> 
> Many thanks for your help. 
> 
> oliv/ 


Re: programmatically create partition regions

Posted by Swapnil Bawaskar <sb...@pivotal.io>.
Also, to delete a region, you can send a DELETE request to
http://locator-host:port/gemfire/v1/regions/regionName

On Fri, Apr 8, 2016 at 11:25 AM, Swapnil Bawaskar <sb...@pivotal.io>
wrote:

> If all you want is the ability to create regions via REST API, I would
> just enable management over rest while starting the locator, like so:
>
> gfsh>start locator --name=locator1 --J=-Dgemfire.jmx-manager=true \
> --J=-Dgemfire.jmx-manager-start=true -J=-Dgemfire.http-service-port=8080 \
> --J=-Dgemfire.http-service-bind-address=localhost
>
> and then make a POST request to http://localhost:8080/gemfire/v1/regions
> e.g.
> $ curl -v --data "name=myRegion&type=PARTITION"
> http://localhost:8080/gemfire/v1/regions
>
> You can find more parameters here:
>
> https://github.com/apache/incubator-geode/blob/develop/geode-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/RegionCommandsController.java#L133
>
> On Fri, Apr 8, 2016 at 8:43 AM, Olivier Mallassi <
> olivier.mallassi@gmail.com> wrote:
>
>> Hi Mike,
>>
>> Thank you for the clarification, that was my guess.
>> Regarding the destruction of the region, I was thinking about removing
>> the key in metadataRegion and delete the region in the callback (to be
>> tested).
>>
>> Cheers.
>>
>> On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <ms...@pivotal.io> wrote:
>>
>>> The reason you need the RegionAttributesMetadataRegion is so that if a
>>> server goes away and comes back, or a new server joins, it knows to
>>> recreate the regions that were dynamically created as defined in the
>>> RegionAttributesMetadataRegion.
>>>
>>> If you are going to destroy regions you will also need to remove their
>>> definitions from the RegionAttributesMetadataRegion.
>>>
>>> I believe <dynamic-region-factory> won't work for Partitioned Regions.
>>>
>>>
>>>
>>> --
>>> Mike Stolz
>>> Principal Engineer, GemFire Product Manager
>>> Mobile: 631-835-4771
>>>
>>> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <
>>> olivier.mallassi@gmail.com> wrote:
>>>
>>>> Hello everybody,
>>>>
>>>> my apologies if the question has already been asked on the ML (I cannot
>>>> find the answer in the archive).
>>>>
>>>> I have a need to programmatically create / delete region. I am not
>>>> talking about creating / deleting regions every second or minutes. the need
>>>> is a pure administration need (being able to create regions via an REST
>>>> API).
>>>>
>>>> I have found the sample code in the documentation (
>>>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
>>>> and was wondering if you can help with the following questions
>>>> - why are we using this "metadataregion"? is it to support elasticity
>>>> (add / remove nodes)? other reasons?
>>>> - Can we delete the regions using the same principle (with another
>>>> callback)?
>>>> - is it better to use the <dynamic-region-factory> knowing I need
>>>> partition_redundant regions? it looks not to be a valid option.
>>>>
>>>> Many thanks for your help.
>>>>
>>>> oliv/
>>>>
>>>
>>>
>>
>

Re: programmatically create partition regions

Posted by Swapnil Bawaskar <sb...@pivotal.io>.
If all you want is the ability to create regions via REST API, I would just
enable management over rest while starting the locator, like so:

gfsh>start locator --name=locator1 --J=-Dgemfire.jmx-manager=true \
--J=-Dgemfire.jmx-manager-start=true -J=-Dgemfire.http-service-port=8080 \
--J=-Dgemfire.http-service-bind-address=localhost

and then make a POST request to http://localhost:8080/gemfire/v1/regions
e.g.
$ curl -v --data "name=myRegion&type=PARTITION"
http://localhost:8080/gemfire/v1/regions

You can find more parameters here:
https://github.com/apache/incubator-geode/blob/develop/geode-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/RegionCommandsController.java#L133

On Fri, Apr 8, 2016 at 8:43 AM, Olivier Mallassi <olivier.mallassi@gmail.com
> wrote:

> Hi Mike,
>
> Thank you for the clarification, that was my guess.
> Regarding the destruction of the region, I was thinking about removing the
> key in metadataRegion and delete the region in the callback (to be tested).
>
> Cheers.
>
> On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <ms...@pivotal.io> wrote:
>
>> The reason you need the RegionAttributesMetadataRegion is so that if a
>> server goes away and comes back, or a new server joins, it knows to
>> recreate the regions that were dynamically created as defined in the
>> RegionAttributesMetadataRegion.
>>
>> If you are going to destroy regions you will also need to remove their
>> definitions from the RegionAttributesMetadataRegion.
>>
>> I believe <dynamic-region-factory> won't work for Partitioned Regions.
>>
>>
>>
>> --
>> Mike Stolz
>> Principal Engineer, GemFire Product Manager
>> Mobile: 631-835-4771
>>
>> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <
>> olivier.mallassi@gmail.com> wrote:
>>
>>> Hello everybody,
>>>
>>> my apologies if the question has already been asked on the ML (I cannot
>>> find the answer in the archive).
>>>
>>> I have a need to programmatically create / delete region. I am not
>>> talking about creating / deleting regions every second or minutes. the need
>>> is a pure administration need (being able to create regions via an REST
>>> API).
>>>
>>> I have found the sample code in the documentation (
>>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
>>> and was wondering if you can help with the following questions
>>> - why are we using this "metadataregion"? is it to support elasticity
>>> (add / remove nodes)? other reasons?
>>> - Can we delete the regions using the same principle (with another
>>> callback)?
>>> - is it better to use the <dynamic-region-factory> knowing I need
>>> partition_redundant regions? it looks not to be a valid option.
>>>
>>> Many thanks for your help.
>>>
>>> oliv/
>>>
>>
>>
>

Re: programmatically create partition regions

Posted by Olivier Mallassi <ol...@gmail.com>.
Jens

No worries, it is helpful anyway :)

Olivier

On Saturday, 9 April 2016, Jens Deppe <jd...@pivotal.io> wrote:

> Hi Olivier,
>
> I would actually advise against trying to use the REST admin API as it is
> entirely undocumented. It only exists in order to enable gfsh commands over
> HTTP. It's ugly and not intended for 'human consumption'. :) i.e. It was
> not *designed* to be a consumable REST API.
>
> We have had some discussions about providing a proper admin REST API but
> nothing concrete has come of that yet.
>
> --Jens
>
> On Sat, Apr 9, 2016 at 4:41 AM, Olivier Mallassi <
> olivier.mallassi@gmail.com
> <javascript:_e(%7B%7D,'cvml','olivier.mallassi@gmail.com');>> wrote:
>
>> Guys,
>>
>> thank you for all your answer.
>> I was thinking about using the REST APIs for this but cannot find the
>> adequate API in the doc (my fault).
>>
>> anyway, thx.
>>
>> oliv/
>>
>> On Fri, Apr 8, 2016 at 10:12 PM, Barry Oglesby <boglesby@pivotal.io
>> <javascript:_e(%7B%7D,'cvml','boglesby@pivotal.io');>> wrote:
>>
>>> In addition to the other great suggestions, if you want to stick with
>>> the pattern in the original example, I attached a DestroyFunctionCommand
>>> and updated CreateRegionCacheListener that'll destroy the region. The
>>> functions could use a bit of refactoring.
>>>
>>> Thanks,
>>> Barry Oglesby
>>>
>>>
>>> On Fri, Apr 8, 2016 at 8:43 AM, Olivier Mallassi <
>>> olivier.mallassi@gmail.com
>>> <javascript:_e(%7B%7D,'cvml','olivier.mallassi@gmail.com');>> wrote:
>>>
>>>> Hi Mike,
>>>>
>>>> Thank you for the clarification, that was my guess.
>>>> Regarding the destruction of the region, I was thinking about removing
>>>> the key in metadataRegion and delete the region in the callback (to be
>>>> tested).
>>>>
>>>> Cheers.
>>>>
>>>> On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <mstolz@pivotal.io
>>>> <javascript:_e(%7B%7D,'cvml','mstolz@pivotal.io');>> wrote:
>>>>
>>>>> The reason you need the RegionAttributesMetadataRegion is so that if
>>>>> a server goes away and comes back, or a new server joins, it knows to
>>>>> recreate the regions that were dynamically created as defined in the
>>>>> RegionAttributesMetadataRegion.
>>>>>
>>>>> If you are going to destroy regions you will also need to remove their
>>>>> definitions from the RegionAttributesMetadataRegion.
>>>>>
>>>>> I believe <dynamic-region-factory> won't work for Partitioned Regions.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Mike Stolz
>>>>> Principal Engineer, GemFire Product Manager
>>>>> Mobile: 631-835-4771
>>>>>
>>>>> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <
>>>>> olivier.mallassi@gmail.com
>>>>> <javascript:_e(%7B%7D,'cvml','olivier.mallassi@gmail.com');>> wrote:
>>>>>
>>>>>> Hello everybody,
>>>>>>
>>>>>> my apologies if the question has already been asked on the ML (I
>>>>>> cannot find the answer in the archive).
>>>>>>
>>>>>> I have a need to programmatically create / delete region. I am not
>>>>>> talking about creating / deleting regions every second or minutes. the need
>>>>>> is a pure administration need (being able to create regions via an REST
>>>>>> API).
>>>>>>
>>>>>> I have found the sample code in the documentation (
>>>>>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
>>>>>> and was wondering if you can help with the following questions
>>>>>> - why are we using this "metadataregion"? is it to support elasticity
>>>>>> (add / remove nodes)? other reasons?
>>>>>> - Can we delete the regions using the same principle (with another
>>>>>> callback)?
>>>>>> - is it better to use the <dynamic-region-factory> knowing I need
>>>>>> partition_redundant regions? it looks not to be a valid option.
>>>>>>
>>>>>> Many thanks for your help.
>>>>>>
>>>>>> oliv/
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Re: programmatically create partition regions

Posted by Jens Deppe <jd...@pivotal.io>.
Hi Olivier,

I would actually advise against trying to use the REST admin API as it is
entirely undocumented. It only exists in order to enable gfsh commands over
HTTP. It's ugly and not intended for 'human consumption'. :) i.e. It was
not *designed* to be a consumable REST API.

We have had some discussions about providing a proper admin REST API but
nothing concrete has come of that yet.

--Jens

On Sat, Apr 9, 2016 at 4:41 AM, Olivier Mallassi <olivier.mallassi@gmail.com
> wrote:

> Guys,
>
> thank you for all your answer.
> I was thinking about using the REST APIs for this but cannot find the
> adequate API in the doc (my fault).
>
> anyway, thx.
>
> oliv/
>
> On Fri, Apr 8, 2016 at 10:12 PM, Barry Oglesby <bo...@pivotal.io>
> wrote:
>
>> In addition to the other great suggestions, if you want to stick with the
>> pattern in the original example, I attached a DestroyFunctionCommand and
>> updated CreateRegionCacheListener that'll destroy the region. The functions
>> could use a bit of refactoring.
>>
>> Thanks,
>> Barry Oglesby
>>
>>
>> On Fri, Apr 8, 2016 at 8:43 AM, Olivier Mallassi <
>> olivier.mallassi@gmail.com> wrote:
>>
>>> Hi Mike,
>>>
>>> Thank you for the clarification, that was my guess.
>>> Regarding the destruction of the region, I was thinking about removing
>>> the key in metadataRegion and delete the region in the callback (to be
>>> tested).
>>>
>>> Cheers.
>>>
>>> On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <ms...@pivotal.io> wrote:
>>>
>>>> The reason you need the RegionAttributesMetadataRegion is so that if a
>>>> server goes away and comes back, or a new server joins, it knows to
>>>> recreate the regions that were dynamically created as defined in the
>>>> RegionAttributesMetadataRegion.
>>>>
>>>> If you are going to destroy regions you will also need to remove their
>>>> definitions from the RegionAttributesMetadataRegion.
>>>>
>>>> I believe <dynamic-region-factory> won't work for Partitioned Regions.
>>>>
>>>>
>>>>
>>>> --
>>>> Mike Stolz
>>>> Principal Engineer, GemFire Product Manager
>>>> Mobile: 631-835-4771
>>>>
>>>> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <
>>>> olivier.mallassi@gmail.com> wrote:
>>>>
>>>>> Hello everybody,
>>>>>
>>>>> my apologies if the question has already been asked on the ML (I
>>>>> cannot find the answer in the archive).
>>>>>
>>>>> I have a need to programmatically create / delete region. I am not
>>>>> talking about creating / deleting regions every second or minutes. the need
>>>>> is a pure administration need (being able to create regions via an REST
>>>>> API).
>>>>>
>>>>> I have found the sample code in the documentation (
>>>>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
>>>>> and was wondering if you can help with the following questions
>>>>> - why are we using this "metadataregion"? is it to support elasticity
>>>>> (add / remove nodes)? other reasons?
>>>>> - Can we delete the regions using the same principle (with another
>>>>> callback)?
>>>>> - is it better to use the <dynamic-region-factory> knowing I need
>>>>> partition_redundant regions? it looks not to be a valid option.
>>>>>
>>>>> Many thanks for your help.
>>>>>
>>>>> oliv/
>>>>>
>>>>
>>>>
>>>
>>
>

Re: programmatically create partition regions

Posted by Olivier Mallassi <ol...@gmail.com>.
Guys,

thank you for all your answer.
I was thinking about using the REST APIs for this but cannot find the
adequate API in the doc (my fault).

anyway, thx.

oliv/

On Fri, Apr 8, 2016 at 10:12 PM, Barry Oglesby <bo...@pivotal.io> wrote:

> In addition to the other great suggestions, if you want to stick with the
> pattern in the original example, I attached a DestroyFunctionCommand and
> updated CreateRegionCacheListener that'll destroy the region. The functions
> could use a bit of refactoring.
>
> Thanks,
> Barry Oglesby
>
>
> On Fri, Apr 8, 2016 at 8:43 AM, Olivier Mallassi <
> olivier.mallassi@gmail.com> wrote:
>
>> Hi Mike,
>>
>> Thank you for the clarification, that was my guess.
>> Regarding the destruction of the region, I was thinking about removing
>> the key in metadataRegion and delete the region in the callback (to be
>> tested).
>>
>> Cheers.
>>
>> On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <ms...@pivotal.io> wrote:
>>
>>> The reason you need the RegionAttributesMetadataRegion is so that if a
>>> server goes away and comes back, or a new server joins, it knows to
>>> recreate the regions that were dynamically created as defined in the
>>> RegionAttributesMetadataRegion.
>>>
>>> If you are going to destroy regions you will also need to remove their
>>> definitions from the RegionAttributesMetadataRegion.
>>>
>>> I believe <dynamic-region-factory> won't work for Partitioned Regions.
>>>
>>>
>>>
>>> --
>>> Mike Stolz
>>> Principal Engineer, GemFire Product Manager
>>> Mobile: 631-835-4771
>>>
>>> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <
>>> olivier.mallassi@gmail.com> wrote:
>>>
>>>> Hello everybody,
>>>>
>>>> my apologies if the question has already been asked on the ML (I cannot
>>>> find the answer in the archive).
>>>>
>>>> I have a need to programmatically create / delete region. I am not
>>>> talking about creating / deleting regions every second or minutes. the need
>>>> is a pure administration need (being able to create regions via an REST
>>>> API).
>>>>
>>>> I have found the sample code in the documentation (
>>>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
>>>> and was wondering if you can help with the following questions
>>>> - why are we using this "metadataregion"? is it to support elasticity
>>>> (add / remove nodes)? other reasons?
>>>> - Can we delete the regions using the same principle (with another
>>>> callback)?
>>>> - is it better to use the <dynamic-region-factory> knowing I need
>>>> partition_redundant regions? it looks not to be a valid option.
>>>>
>>>> Many thanks for your help.
>>>>
>>>> oliv/
>>>>
>>>
>>>
>>
>

Re: programmatically create partition regions

Posted by Barry Oglesby <bo...@pivotal.io>.
In addition to the other great suggestions, if you want to stick with the
pattern in the original example, I attached a DestroyFunctionCommand and
updated CreateRegionCacheListener that'll destroy the region. The functions
could use a bit of refactoring.

Thanks,
Barry Oglesby


On Fri, Apr 8, 2016 at 8:43 AM, Olivier Mallassi <olivier.mallassi@gmail.com
> wrote:

> Hi Mike,
>
> Thank you for the clarification, that was my guess.
> Regarding the destruction of the region, I was thinking about removing the
> key in metadataRegion and delete the region in the callback (to be tested).
>
> Cheers.
>
> On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <ms...@pivotal.io> wrote:
>
>> The reason you need the RegionAttributesMetadataRegion is so that if a
>> server goes away and comes back, or a new server joins, it knows to
>> recreate the regions that were dynamically created as defined in the
>> RegionAttributesMetadataRegion.
>>
>> If you are going to destroy regions you will also need to remove their
>> definitions from the RegionAttributesMetadataRegion.
>>
>> I believe <dynamic-region-factory> won't work for Partitioned Regions.
>>
>>
>>
>> --
>> Mike Stolz
>> Principal Engineer, GemFire Product Manager
>> Mobile: 631-835-4771
>>
>> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <
>> olivier.mallassi@gmail.com> wrote:
>>
>>> Hello everybody,
>>>
>>> my apologies if the question has already been asked on the ML (I cannot
>>> find the answer in the archive).
>>>
>>> I have a need to programmatically create / delete region. I am not
>>> talking about creating / deleting regions every second or minutes. the need
>>> is a pure administration need (being able to create regions via an REST
>>> API).
>>>
>>> I have found the sample code in the documentation (
>>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
>>> and was wondering if you can help with the following questions
>>> - why are we using this "metadataregion"? is it to support elasticity
>>> (add / remove nodes)? other reasons?
>>> - Can we delete the regions using the same principle (with another
>>> callback)?
>>> - is it better to use the <dynamic-region-factory> knowing I need
>>> partition_redundant regions? it looks not to be a valid option.
>>>
>>> Many thanks for your help.
>>>
>>> oliv/
>>>
>>
>>
>

Re: programmatically create partition regions

Posted by Olivier Mallassi <ol...@gmail.com>.
Hi Mike,

Thank you for the clarification, that was my guess.
Regarding the destruction of the region, I was thinking about removing the
key in metadataRegion and delete the region in the callback (to be tested).

Cheers.

On Fri, Apr 8, 2016 at 4:55 PM, Michael Stolz <ms...@pivotal.io> wrote:

> The reason you need the RegionAttributesMetadataRegion is so that if a
> server goes away and comes back, or a new server joins, it knows to
> recreate the regions that were dynamically created as defined in the
> RegionAttributesMetadataRegion.
>
> If you are going to destroy regions you will also need to remove their
> definitions from the RegionAttributesMetadataRegion.
>
> I believe <dynamic-region-factory> won't work for Partitioned Regions.
>
>
>
> --
> Mike Stolz
> Principal Engineer, GemFire Product Manager
> Mobile: 631-835-4771
>
> On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <
> olivier.mallassi@gmail.com> wrote:
>
>> Hello everybody,
>>
>> my apologies if the question has already been asked on the ML (I cannot
>> find the answer in the archive).
>>
>> I have a need to programmatically create / delete region. I am not
>> talking about creating / deleting regions every second or minutes. the need
>> is a pure administration need (being able to create regions via an REST
>> API).
>>
>> I have found the sample code in the documentation (
>> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
>> and was wondering if you can help with the following questions
>> - why are we using this "metadataregion"? is it to support elasticity
>> (add / remove nodes)? other reasons?
>> - Can we delete the regions using the same principle (with another
>> callback)?
>> - is it better to use the <dynamic-region-factory> knowing I need
>> partition_redundant regions? it looks not to be a valid option.
>>
>> Many thanks for your help.
>>
>> oliv/
>>
>
>

Re: programmatically create partition regions

Posted by Michael Stolz <ms...@pivotal.io>.
The reason you need the RegionAttributesMetadataRegion is so that if a
server goes away and comes back, or a new server joins, it knows to
recreate the regions that were dynamically created as defined in the
RegionAttributesMetadataRegion.

If you are going to destroy regions you will also need to remove their
definitions from the RegionAttributesMetadataRegion.

I believe <dynamic-region-factory> won't work for Partitioned Regions.



--
Mike Stolz
Principal Engineer, GemFire Product Manager
Mobile: 631-835-4771

On Fri, Apr 8, 2016 at 6:28 AM, Olivier Mallassi <olivier.mallassi@gmail.com
> wrote:

> Hello everybody,
>
> my apologies if the question has already been asked on the ML (I cannot
> find the answer in the archive).
>
> I have a need to programmatically create / delete region. I am not talking
> about creating / deleting regions every second or minutes. the need is a
> pure administration need (being able to create regions via an REST API).
>
> I have found the sample code in the documentation (
> http://geode.docs.pivotal.io/docs/developing/region_options/dynamic_region_creation.html)
> and was wondering if you can help with the following questions
> - why are we using this "metadataregion"? is it to support elasticity (add
> / remove nodes)? other reasons?
> - Can we delete the regions using the same principle (with another
> callback)?
> - is it better to use the <dynamic-region-factory> knowing I need
> partition_redundant regions? it looks not to be a valid option.
>
> Many thanks for your help.
>
> oliv/
>