ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkulichenko <valentin.kuliche...@gmail.com>
Subject Re: Cache startSize tunning
Date Fri, 13 Nov 2015 02:27:33 GMT
Hi,


diopek wrote
> Is it possible to keep all the configuration defined in cache xml file as
> default, just set the startSize using CacheConfiguration API.

You can put your cache configuration template outside IgniteConfiguration
bean and then use Ignition.loadSpringBean() method.

For example, if you configuration look like this:

<beans>
    <bean id="my-cache-template"
class="org.apache.ignite.configuration.CacheConfiguration">
        ...
    </bean>

    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
        ...
    </bean>
</beans>

You can start a cache with the modified start size like this:

CacheConfiguration cacheCfg = Ignition.loadSpringBean("path/to/config.xml",
"my-cache-template");
cacheCfg.setName("cache-with-start-size-1000");
cacheCfg.setStartSize(1000);
IgniteCache cache = ignite.startCache(cacheCfg);

Let us know if it works for you.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-startSize-tunning-tp1948p1953.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message