You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Stanislav Lukyanov (JIRA)" <ji...@apache.org> on 2019/01/30 13:04:00 UTC
[jira] [Created] (IGNITE-11141) Add Java method to create a cache
from a template
Stanislav Lukyanov created IGNITE-11141:
-------------------------------------------
Summary: Add Java method to create a cache from a template
Key: IGNITE-11141
URL: https://issues.apache.org/jira/browse/IGNITE-11141
Project: Ignite
Issue Type: Task
Reporter: Stanislav Lukyanov
Currently cache templates can only be used via REST or SQL: https://apacheignite.readme.io/docs/cache-template.
It seems reasonable to add the same functionality to Java.
The most flexible way would probably be to add a method like `cacheConfiguration(String)` that would return a configuration of a template with the given name. Then to create a cache from a template one would write code like this
{code}
CacheConfiguration cfg = ignite.cacheConfiguration("myTemplate");
cfg.setName("myCacheFromTemplate");
ignite.createCache(cfg);
{code}
As a bonus, the `cacheConfiguration(String)` method may work with regular caches too. For them it would be a shortcut for `ignite.cache("myCache").getConfiguration()`.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)