Minors.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b915b850 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b915b850 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b915b850 Branch: refs/heads/ignite-2693 Commit: b915b850d8f15807efe1e7e0fc416a97c6d4e408 Parents: 4196837 Author: vozerov-gridgain <[email protected]> Authored: Tue May 24 14:00:27 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Tue May 24 14:00:27 2016 +0300 ---------------------------------------------------------------------- .../java/org/apache/ignite/IgniteCache.java | 2 +- .../processors/cache/IgniteCacheProxy.java | 5 +-- ...heOffHeapTieredEvictionAbstractSelfTest.java | 36 ++++++++++---------- 3 files changed, 22 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b915b850/modules/core/src/main/java/org/apache/ignite/IgniteCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java index 57246d8..3a76dd3 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java @@ -173,7 +173,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS * * @return New cache instance for binary objects. */ - public <K1, V1> IgniteCache<K1, V1> withKeepBinary() throws IgniteException; + public <K1, V1> IgniteCache<K1, V1> withKeepBinary(); /** * Executes {@link #localLoadCache(IgniteBiPredicate, Object...)} on all cache nodes. http://git-wip-us.apache.org/repos/asf/ignite/blob/b915b850/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 450e47a..2d0f8d8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -336,10 +336,11 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V /** {@inheritDoc} */ @Override public <K1, V1> IgniteCache<K1, V1> withKeepBinary() { - if ((ctx.kernalContext().config().getMarshaller() != null) && (ctx.kernalContext().config().getMarshaller() instanceof BinaryMarshaller)) + if (ctx.kernalContext().config().getMarshaller() instanceof BinaryMarshaller) return keepBinary(); else - throw new IgniteException("error: withKeepBinary() cannot be invoked on a cache that has no binary marshaller"); + throw new IgniteException("withKeepBinary() can be used only with " + BinaryMarshaller.class.getName() + + " (please set it through IgniteConfiguration.setMarshaller())."); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/b915b850/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java index 49412d2..2c8e001 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredEvictionAbstractSelfTest.java @@ -28,9 +28,8 @@ import javax.cache.processor.MutableEntry; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; -import org.apache.ignite.Ignition; import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.util.typedef.P1; import org.apache.ignite.internal.util.typedef.internal.SB; import org.apache.ignite.testframework.GridTestUtils; @@ -173,28 +172,29 @@ public abstract class GridCacheOffHeapTieredEvictionAbstractSelfTest extends Gri * @throws Exception If failed. */ public void testTransform() throws Exception { - /* we need to enforce binary marshaller in this test since IGNITE-2693 */ - final IgniteConfiguration iCfg = new IgniteConfiguration(); - final Ignite ignite = Ignition.start(iCfg); - final IgniteCache<Integer, Object> cache = ignite.cache("test_cache").withKeepBinary(); + Ignite ignite = grid(0); - GridTestUtils.runMultiThreaded(new Callable<Void>() { - @Override public Void call() throws Exception { - ThreadLocalRandom rnd = ThreadLocalRandom.current(); + if (ignite.configuration().getMarshaller() instanceof BinaryMarshaller) { + final IgniteCache<Integer, Object> cache = ignite.cache(null).withKeepBinary(); - for (int i = 0; i < iterations(); i++) { - int key = rnd.nextInt(KEYS); + GridTestUtils.runMultiThreaded(new Callable<Void>() { + @Override public Void call() throws Exception { + ThreadLocalRandom rnd = ThreadLocalRandom.current(); - final TestValue val = vals.get(key % VAL_SIZE); + for (int i = 0; i < iterations(); i++) { + int key = rnd.nextInt(KEYS); - TestProcessor c = testClosure(val.val, false); + final TestValue val = vals.get(key % VAL_SIZE); - cache.invoke(key, c); - } + TestProcessor c = testClosure(val.val, false); - return null; - } - }, 16, "test"); + cache.invoke(key, c); + } + + return null; + } + }, 16, "test"); + } } /**
