Re: create region and clear entries from geode-client

2020-12-17 Thread Jens Deppe
Hi Ankit!

For function execution, I'd point you to the geode examples repo which has a 
simple example for functions [1]. Once you see how that works, it should be 
fairly straight forward to integrate the code you linked. When using functions, 
there are a couple of things to be aware of:

Your function code needs to be on the classpath of the servers. You can achieve 
this either by starting the servers with the '--classpath' option and point 
that at your jar, or you can use the 'gfsh deploy' jar to make your jar 
available to all the servers once they are running.

'Manual' region creation is somewhat cumbersome in older versions of Geode. 
Specifically because you will need to execute your function on each server that 
should host the region. It's easy when you're developing locally, but 
definitely becomes a little more involved when you have a larger cluster.

Of interest to you may be a new experimental feature which provides an API for 
the java client to create regions. Here is a short example:

ClientCacheFactory factory = new ClientCacheFactory()
.addPoolLocator("localhost", 10334);
ClientCache cache = factory.create();

Region regionConfig = new Region();
regionConfig.setName("REGION1");
regionConfig.setType(RegionType.REPLICATE_PERSISTENT);

ClusterManagementService service =
new GeodeClusterManagementServiceBuilder()
.setCache(cache)
.build();

service.create(regionConfig);

This functionality should be available in Geode 1.13.

Hope this helps.

--Jens

[1] https://github.com/apache/geode-examples/tree/develop/functions

On 12/17/20, 4:51 AM, "ankit Soni"  wrote:

Hello,

I have started using geode (1.12) in recent time and  looking to achieve
the following from a *java based geode-client program.*

 1.* create REPLCIATED and PARTITION regions from the client itself and
while creating it, need to provide a config that deletes the entries at
specified time.*

 2. *clear entries of a region from the client..*

I am exploring geode doc and have come across the following but unable to
understand what code i need to write in the geode-client java program.

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgeode.apache.org%2Fdocs%2Fguide%2F14%2Fdeveloping%2Fregion_options%2Fdynamic_region_creation.htmldata=04%7C01%7Cjdeppe%40vmware.com%7C5995825d4e4349282fc408d8a28a858c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637438063154882742%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Wfl62xoUDg2jL408T6%2BCg3yaYE2yiZh0blWiDYLr%2FaA%3Dreserved=0

Can some guide me on how to achieve this...?

-Ankit.



Re: create region and clear entries from geode-client

2020-12-17 Thread Anilkumar Gingade
The doc you are pointing; tries to create region using Functions.
You can use the samples given there and modify as per your requirement or 
create a new one.

Here is reference doc about function execution:
https://geode.apache.org/docs/guide/14/developing/function_exec/function_execution.html

The clear() op is supported on replicated region but not on partitioned region. 
You can create a function to achieve the clear (similar to creating region) 
either by calling clear or deleting the region entries by iterating over them.

-Anil.


On 12/17/20, 4:51 AM, "ankit Soni"  wrote:

Hello,

I have started using geode (1.12) in recent time and  looking to achieve
the following from a *java based geode-client program.*

 1.* create REPLCIATED and PARTITION regions from the client itself and
while creating it, need to provide a config that deletes the entries at
specified time.*

 2. *clear entries of a region from the client..*

I am exploring geode doc and have come across the following but unable to
understand what code i need to write in the geode-client java program.

https://geode.apache.org/docs/guide/14/developing/region_options/dynamic_region_creation.html

Can some guide me on how to achieve this...?

-Ankit.



PR pending review

2020-12-17 Thread aashish choudhary
Hi,

Can someone please review mine below PR for the geode-examples repository?
Pending for a while now.

https://github.com/apache/geode-examples/pull/107
https://github.com/apache/geode-examples/pull/106
https://github.com/apache/geode-examples/pull/104

With Best Regards,
Ashish


create region and clear entries from geode-client

2020-12-17 Thread ankit Soni
Hello,

I have started using geode (1.12) in recent time and  looking to achieve
the following from a *java based geode-client program.*

 1.* create REPLCIATED and PARTITION regions from the client itself and
while creating it, need to provide a config that deletes the entries at
specified time.*

 2. *clear entries of a region from the client..*

I am exploring geode doc and have come across the following but unable to
understand what code i need to write in the geode-client java program.
https://geode.apache.org/docs/guide/14/developing/region_options/dynamic_region_creation.html

Can some guide me on how to achieve this...?

-Ankit.