3.3.4. Register Groupers
After creation, each grouper must be registered to be used.
Declaratively Register a Grouper
Use the following code to register a grouping using XML:
<clustering> <hash> <groups enabled="true"> <grouper class="com.acme.KXGrouper" /> </groups> </hash> </clustering>
Programmatically Register a Grouper
Use the following code to register a grouper programmatically:
Configuration c = new ConfigurationBuilder().clustering().hash().groups().addGrouper(new KXGrouper()).enabled().build();