Guys, I think this solution is not very good from usability standpoint. It's a common practice to have several cache configurations in one file and I don't like that user will have to create a file per cache.
After offline discussion I implemented different way of doing the same thing - added 'Ignition.loadSpringBean' method which is a generic way to get a bean from Spring context by its name. It works for cache configurations, near cache configurations, Ignite configurations and any other beans configured via Spring (even not Ignite related). In addition it allows to create a configuration template - you can set correct name and make any modifications after loading it. Please let me know if someone have any questions/thoughts. -- Val On Mon, Mar 23, 2015 at 10:25 PM, Ira Vasilinets <[email protected]> wrote: > If file has several caches, method will throw exception. > > вторник, 24 марта 2015 г. пользователь Dmitriy Setrakyan написал: > > > Ira, > > > > I have a question about this method: > > > > public <K, V> IgniteCache<K, V> getOrCreateCache(String > springCfgPath); > > > > If the configuration file has several caches defined, which one does this > > method return? > > > > D. > > > > On Mon, Mar 23, 2015 at 9:06 AM, Ira Vasilinets < > [email protected] > > <javascript:;>> > > wrote: > > > > > I merged it to ignite-45. > > > > > > On Mon, Mar 23, 2015 at 7:04 PM, Dmitriy Setrakyan < > > [email protected] <javascript:;>> > > > wrote: > > > > > > > Thanks Ira! > > > > > > > > The approach sounds good to me. Are you merging it into sprint-2 or > is > > it > > > > going to be done as part of sprint-3? > > > > > > > > D. > > > > > > > > On Mon, Mar 23, 2015 at 8:18 AM, Ira Vasilinets < > > > [email protected] <javascript:;>> > > > > wrote: > > > > > > > > > Hi, > > > > > > > > > > I have done ticket "Start caches with spring path": > > > > > https://issues.apache.org/jira/browse/IGNITE-556 > > > > > > > > > > I added for each method createCache(getOrCreateCache) pair method > > that > > > > use > > > > > xml file instead of CacheConfiguration. > > > > > > > > > > Method createCache(String cacheXmlFile, String nearCacheXmlFile) > > > > conflicts > > > > > with createCache(@Nullable String cacheName, String > > nearCacheXmlFile). > > > > > I renamed second method to > > > > > createNearCache(@Nullable String cacheName, String > nearCacheXmlFile) > > > > > and its paired method > > > > > createNearCache(@Nullable String cacheName, > NearCacheConfiguration<K, > > > V> > > > > > nearCfg). > > > > > > > > > > I also renamed getOrCreateNearCache for the same reasons. > > > > > > > > > > Thoughts? > > > > > > > > > > Ira. > > > > > > > > > > > > > > >
