Index: ../incubator-ignite/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../incubator-ignite/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java (date 1428669322000) +++ ../incubator-ignite/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java (date 1428674294000) @@ -244,9 +244,12 @@ ExecutorService svc = Executors.newFixedThreadPool(threadCnt); try { - for (CacheConfiguration cc : first.configuration().getCacheConfiguration()) { - GridCache cache0 = ((IgniteKernal)first).getCache(cc.getName()); + for (IgniteCacheProxy cache : ((IgniteKernal)first).caches()) { + if (!cache.context().userCache()) + continue; + GridCache cache0 = cache.context().cache(); + for (String warmupMethod : warmupMethods) { Collection futs = new ArrayList<>(threadCnt); @@ -303,7 +306,7 @@ futs.add(svc.submit(call)); } - out("Running warmup [cacheName=" + U.maskName(cc.getName()) + ", method=" + warmupMethod + ']'); + out("Running warmup [cacheName=" + U.maskName(cache.getName()) + ", method=" + warmupMethod + ']'); for (Future fut : futs) fut.get(); Index: ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/cache/IgniteWarmupClosureSelfTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/cache/IgniteWarmupClosureSelfTest.java (date 1428674294000) +++ ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/cache/IgniteWarmupClosureSelfTest.java (date 1428674294000) @@ -0,0 +1,82 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.cache; + +import org.apache.ignite.configuration.*; +import org.apache.ignite.spi.discovery.tcp.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; +import org.apache.ignite.startup.*; +import org.apache.ignite.testframework.junits.common.*; + +/** + * + */ +public class IgniteWarmupClosureSelfTest extends GridCommonAbstractTest { + /** */ + private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); + + /** */ + public IgniteWarmupClosureSelfTest(){ + super(false); + } + + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(gridName); + + TcpDiscoverySpi disco = new TcpDiscoverySpi(); + + disco.setIpFinder(IP_FINDER); + + cfg.getTransactionConfiguration().setTxSerializableEnabled(true); + + cfg.setDiscoverySpi(disco); + + BasicWarmupClosure warmupClosure = new BasicWarmupClosure(); + + warmupClosure.setGridCount(2); + warmupClosure.setIterationCount(10); + warmupClosure.setKeyRange(10); + + cfg.setWarmupClosure(warmupClosure); + + CacheConfiguration cacheCfg = new CacheConfiguration<>(); + + cacheCfg.setCacheMode(CacheMode.PARTITIONED); + cacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); + cacheCfg.setBackups(1); + cacheCfg.setName("test"); + + cfg.setCacheConfiguration(cacheCfg); + + return cfg; + } + + /** {@inheritDoc} */ + @Override protected void afterTestsStopped() throws Exception { + stopAllGrids(); + } + + /** + * @throws Exception If failed. + */ + public void testWarmupClosure() throws Exception { + startGrid(1); + } +} Index: ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java (date 1428669322000) +++ ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java (date 1428674294000) @@ -19,6 +19,7 @@ import junit.framework.*; import org.apache.ignite.*; +import org.apache.ignite.cache.*; import org.apache.ignite.cache.affinity.fair.*; import org.apache.ignite.cache.store.*; import org.apache.ignite.cache.store.jdbc.*; @@ -80,6 +81,9 @@ suite.addTestSuite(IgniteCacheP2PDisableExecutionContextTest.class); suite.addTestSuite(IgniteCachePrivateExecutionContextTest.class); suite.addTestSuite(IgniteCacheSharedExecutionContextTest.class); + + // Warmup closure tests. + suite.addTestSuite(IgniteWarmupClosureSelfTest.class); // Affinity tests. suite.addTestSuite(GridFairAffinityFunctionNodesSelfTest.class);