use of org.apache.ignite.springdata.repository.support.IgniteRepositoryFactoryBean in project ignite by apache.
the class SpringAppCfg method igniteInstance.
/**
* Creating Apache Ignite instance bean. A bean will be passed to {@link IgniteRepositoryFactoryBean} to initialize
* all Ignite based Spring Data repositories and connect to a cluster.
*/
@Bean
public Ignite igniteInstance() {
IgniteConfiguration cfg = new IgniteConfiguration();
// Setting some custom name for the node.
cfg.setIgniteInstanceName("springDataNode");
// Enabling peer-class loading feature.
cfg.setPeerClassLoadingEnabled(true);
// Defining and creating a new cache to be used by Ignite Spring Data repository.
CacheConfiguration ccfg = new CacheConfiguration("PersonCache");
// Setting SQL schema for the cache.
ccfg.setIndexedTypes(Long.class, Person.class);
cfg.setCacheConfiguration(ccfg);
return Ignition.start(cfg);
}
Aggregations