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.html&data=04%7C01%7Cjdeppe%40vmware.com%7C5995825d4e4349282fc408d8a28a858c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637438063154882742%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Wfl62xoUDg2jL408T6%2BCg3yaYE2yiZh0blWiDYLr%2FaA%3D&reserved=0
Can some guide me on how to achieve this...?
-Ankit.