You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/12/16 09:19:20 UTC
[26/28] ignite git commit: IGNITE-2138 Introduced toBuilder() method.
IGNITE-2138 Introduced toBuilder() method.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/df08d3de
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/df08d3de
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/df08d3de
Branch: refs/heads/ignite-843-rc2
Commit: df08d3de91d080bd26a1aa0debc656fa73a3f156
Parents: 046f3b8
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Tue Dec 15 20:31:52 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Dec 15 20:31:52 2015 +0300
----------------------------------------------------------------------
.../store/auto/CacheBinaryAutoStoreExample.java | 2 +-
.../org/apache/ignite/binary/BinaryObject.java | 15 ++
.../store/jdbc/CacheAbstractJdbcStore.java | 2 +-
.../configuration/CacheConfiguration.java | 19 +-
.../internal/binary/BinaryEnumObjectImpl.java | 7 +
.../internal/binary/BinaryObjectExImpl.java | 7 +
.../binary/BinaryObjectOffheapImpl.java | 7 +
.../processors/cache/GridCacheProcessor.java | 4 +-
.../cache/store/CacheOsStoreManager.java | 2 +-
...IgniteCacheBinaryEntryProcessorSelfTest.java | 255 +++++++++++++++++++
.../GridCacheBinaryStoreAbstractSelfTest.java | 2 +-
.../BinaryTxCacheLocalEntriesSelfTest.java | 2 +-
.../native-client-test-cache-parallel-store.xml | 2 +-
.../Config/native-client-test-cache-store.xml | 6 +-
14 files changed, 311 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
index aa5eea1..75773cb 100644
--- a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/store/auto/CacheBinaryAutoStoreExample.java
@@ -94,7 +94,7 @@ public class CacheBinaryAutoStoreExample {
cfg.setAtomicityMode(TRANSACTIONAL);
// This option will allow to start remote nodes without having user classes in classpath.
- cfg.setKeepBinaryInStore(true);
+ cfg.setStoreKeepBinary(true);
cfg.setReadThrough(true);
cfg.setWriteThrough(true);
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
index f4afd8d..3d99757 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
@@ -141,6 +141,21 @@ public interface BinaryObject extends Serializable, Cloneable {
public BinaryObject clone() throws CloneNotSupportedException;
/**
+ * Creates a new {@link BinaryObjectBuilder} based on this binary object. The following code
+ * <pre name=code class=java>
+ * BinaryObjectBuilder builder = binaryObject.toBuilder();
+ * </pre>
+ * is equivalent to
+ * <pre name=code class=java>
+ * BinaryObjectBuilder builder = ignite.binary().builder(binaryObject);
+ * </pre>
+ *
+ * @return Binary object builder.
+ * @throws BinaryObjectException If builder cannot be created.
+ */
+ public BinaryObjectBuilder toBuilder() throws BinaryObjectException;
+
+ /**
* Get ordinal for this enum object. Use {@link BinaryType#isEnum()} to check if object is of enum type.
*
* @return Ordinal.
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
index 07e9c9b..c5c55e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
@@ -1475,7 +1475,7 @@ public abstract class CacheAbstractJdbcStore<K, V> implements CacheStore<K, V>,
throws CacheWriterException {
TypeKind valKind = em.valueKind();
- // Object could be passed by cache in binary format in case of cache configured with setKeepBinaryInStore(true).
+ // Object could be passed by cache in binary format in case of cache configured with setStoreKeepBinary(true).
if (valKind == TypeKind.POJO && val instanceof BinaryObject)
valKind = TypeKind.BINARY;
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index d73ff58..be1240c 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -208,7 +208,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/** Default value for keep binary in store behavior .*/
@SuppressWarnings({"UnnecessaryBoxing", "BooleanConstructorCall"})
- public static final Boolean DFLT_KEEP_BINARY_IN_STORE = new Boolean(false);
+ public static final Boolean DFLT_STORE_KEEP_BINARY = new Boolean(false);
/** Default threshold for concurrent loading of keys from {@link CacheStore}. */
public static final int DFLT_CONCURRENT_LOAD_ALL_THRESHOLD = 5;
@@ -269,7 +269,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
private Factory storeFactory;
/** */
- private Boolean keepBinaryInStore = DFLT_KEEP_BINARY_IN_STORE;
+ private Boolean storeKeepBinary = DFLT_STORE_KEEP_BINARY;
/** */
private boolean loadPrevVal = DFLT_LOAD_PREV_VAL;
@@ -444,8 +444,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
invalidate = cc.isInvalidate();
isReadThrough = cc.isReadThrough();
isWriteThrough = cc.isWriteThrough();
- keepBinaryInStore = cc.isKeepBinaryInStore() != null ? cc.isKeepBinaryInStore() :
- DFLT_KEEP_BINARY_IN_STORE;
+ storeKeepBinary = cc.isStoreKeepBinary() != null ? cc.isStoreKeepBinary() : DFLT_STORE_KEEP_BINARY;
listenerConfigurations = cc.listenerConfigurations;
loadPrevVal = cc.isLoadPreviousValue();
longQryWarnTimeout = cc.getLongQueryWarningTimeout();
@@ -891,7 +890,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/**
* Flag indicating that {@link CacheStore} implementation
* is working with binary objects instead of Java objects.
- * Default value of this flag is {@link #DFLT_KEEP_BINARY_IN_STORE}.
+ * Default value of this flag is {@link #DFLT_STORE_KEEP_BINARY}.
* <p>
* If set to {@code false}, Ignite will deserialize keys and
* values stored in binary format before they are passed
@@ -906,17 +905,17 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @return Keep binary in store flag.
*/
- public Boolean isKeepBinaryInStore() {
- return keepBinaryInStore;
+ public Boolean isStoreKeepBinary() {
+ return storeKeepBinary;
}
/**
* Sets keep binary in store flag.
*
- * @param keepBinaryInStore Keep binary in store flag.
+ * @param storeKeepBinary Keep binary in store flag.
*/
- public void setKeepBinaryInStore(boolean keepBinaryInStore) {
- this.keepBinaryInStore = keepBinaryInStore;
+ public void setStoreKeepBinary(boolean storeKeepBinary) {
+ this.storeKeepBinary = storeKeepBinary;
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
index b2ee16f..001d2d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
@@ -19,9 +19,11 @@ package org.apache.ignite.internal.binary;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.binary.BinaryType;
import org.apache.ignite.internal.GridDirectTransient;
+import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.CacheObjectContext;
import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
@@ -121,6 +123,11 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
}
/** {@inheritDoc} */
+ @Override public BinaryObjectBuilder toBuilder() throws BinaryObjectException {
+ return BinaryObjectBuilderImpl.wrap(this);
+ }
+
+ /** {@inheritDoc} */
@Override public int enumOrdinal() throws BinaryObjectException {
return ord;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
index 404300d..ddf17f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
@@ -21,6 +21,8 @@ import java.math.BigDecimal;
import java.util.Arrays;
import java.util.IdentityHashMap;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
import org.apache.ignite.internal.util.typedef.internal.SB;
import org.apache.ignite.binary.BinaryObjectException;
@@ -101,6 +103,11 @@ public abstract class BinaryObjectExImpl implements BinaryObjectEx {
protected abstract BinarySchema createSchema();
/** {@inheritDoc} */
+ @Override public BinaryObjectBuilder toBuilder() throws BinaryObjectException {
+ return BinaryObjectBuilderImpl.wrap(this);
+ }
+
+ /** {@inheritDoc} */
@Override public BinaryObject clone() throws CloneNotSupportedException {
return (BinaryObject)super.clone();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
index 0246a36..696a34b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
@@ -19,8 +19,10 @@ package org.apache.ignite.internal.binary;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.binary.BinaryType;
+import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
import org.apache.ignite.internal.binary.streams.BinaryOffheapInputStream;
import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.CacheObjectContext;
@@ -326,6 +328,11 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
}
/** {@inheritDoc} */
+ @Override public BinaryObjectBuilder toBuilder() throws BinaryObjectException {
+ return BinaryObjectBuilderImpl.wrap(heapCopy());
+ }
+
+ /** {@inheritDoc} */
@Override public byte cacheObjectType() {
throw new UnsupportedOperationException();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 1bbef62..f0bed99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1041,9 +1041,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
CacheConfiguration cfg = cacheCtx.config();
// Intentionally compare Boolean references using '!=' below to check if the flag has been explicitly set.
- if (cfg.isKeepBinaryInStore() && cfg.isKeepBinaryInStore() != CacheConfiguration.DFLT_KEEP_BINARY_IN_STORE
+ if (cfg.isStoreKeepBinary() && cfg.isStoreKeepBinary() != CacheConfiguration.DFLT_STORE_KEEP_BINARY
&& !(ctx.config().getMarshaller() instanceof BinaryMarshaller))
- U.warn(log, "CacheConfiguration.isKeepBinaryInStore() configuration property will be ignored because " +
+ U.warn(log, "CacheConfiguration.isStoreKeepBinary() configuration property will be ignored because " +
"BinaryMarshaller is not used");
// Start managers.
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
index e89483a..27771ff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
@@ -82,6 +82,6 @@ public class CacheOsStoreManager extends GridCacheStoreManagerAdapter {
/** {@inheritDoc} */
@Override public boolean configuredConvertBinary() {
- return !(ctx.config().getMarshaller() instanceof BinaryMarshaller && cfg.isKeepBinaryInStore());
+ return !(ctx.config().getMarshaller() instanceof BinaryMarshaller && cfg.isStoreKeepBinary());
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryEntryProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryEntryProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryEntryProcessorSelfTest.java
new file mode 100644
index 0000000..8e20c3e
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryEntryProcessorSelfTest.java
@@ -0,0 +1,255 @@
+/*
+ * 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.internal.processors.cache;
+
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteBinary;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheEntryProcessor;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class IgniteCacheBinaryEntryProcessorSelfTest extends GridCommonAbstractTest {
+ /** */
+ private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static final int SRV_CNT = 4;
+
+ /** */
+ private static final int NODES = 5;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+ if (getTestGridName(SRV_CNT).equals(gridName))
+ cfg.setClientMode(true);
+
+ cfg.setMarshaller(null);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+
+ super.afterTestsStopped();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ startGridsMultiThreaded(NODES);
+ }
+
+ /**
+ * @param cacheMode Cache mode.
+ * @param atomicityMode Atomicity mode.
+ * @return Cache configuration.
+ */
+ private CacheConfiguration<Integer, TestValue> cacheConfiguration(CacheMode cacheMode, CacheAtomicityMode atomicityMode) {
+ CacheConfiguration<Integer, TestValue> ccfg = new CacheConfiguration<>();
+
+ ccfg.setCacheMode(cacheMode);
+ ccfg.setAtomicityMode(atomicityMode);
+
+ ccfg.setBackups(1);
+
+ return ccfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPartitionedTransactional() throws Exception {
+ checkInvokeBinaryObject(CacheMode.PARTITIONED, CacheAtomicityMode.TRANSACTIONAL);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReplicatedTransactional() throws Exception {
+ checkInvokeBinaryObject(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testPartitionedAtomic() throws Exception {
+ checkInvokeBinaryObject(CacheMode.PARTITIONED, CacheAtomicityMode.TRANSACTIONAL);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReplicatedAtomic() throws Exception {
+ checkInvokeBinaryObject(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL);
+ }
+
+ /**
+ * @param cacheMode Cache mode to test.
+ * @param atomicityMode Atomicity mode to test.
+ * @throws Exception
+ */
+ private void checkInvokeBinaryObject(CacheMode cacheMode, CacheAtomicityMode atomicityMode) throws Exception {
+ Ignite client = ignite(SRV_CNT);
+
+ IgniteCache<Integer, TestValue> clientCache = client.createCache(cacheConfiguration(cacheMode, atomicityMode));
+
+ try {
+ IgniteBinary binary = client.binary();
+
+ for (int i = 0; i < 100; i++) {
+ clientCache.put(i, new TestValue(i, "value-" + i));
+
+ BinaryObjectBuilder bldr = binary.builder("NoClass");
+
+ bldr.setField("val", i);
+ bldr.setField("strVal", "value-" + i);
+
+ clientCache.withKeepBinary().put(-(i + 1), bldr.build());
+ }
+
+ IgniteCache<Integer, BinaryObject> binaryClientCache = clientCache.withKeepBinary();
+
+ for (int i = 0; i < 100; i++) {
+ binaryClientCache.invoke(i, new TestEntryProcessor());
+ binaryClientCache.invoke(-(i + 1), new TestEntryProcessor());
+ }
+
+ for (int g = 0; g < NODES; g++) {
+ IgniteCache<Integer, TestValue> nodeCache = ignite(g).cache(null);
+ IgniteCache<Integer, BinaryObject> nodeBinaryCache = nodeCache.withKeepBinary();
+
+ for (int i = 0; i < 100; i++) {
+ TestValue updated = nodeCache.get(i);
+
+ assertEquals((Integer)(i + 1), updated.value());
+ assertEquals("updated-" + i, updated.stringValue());
+
+ BinaryObject updatedBinary = nodeBinaryCache.get(i);
+ assertEquals(i + 1, updatedBinary.field("val"));
+ assertEquals("updated-" + i, updatedBinary.field("strVal"));
+
+ updatedBinary = nodeBinaryCache.get(-(i + 1));
+ assertEquals(i + 1, updatedBinary.field("val"));
+ assertEquals("updated-" + i, updatedBinary.field("strVal"));
+ }
+ }
+ }
+ finally {
+ client.destroyCache(null);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class TestEntryProcessor implements CacheEntryProcessor<Integer, BinaryObject, Void> {
+ /** {@inheritDoc} */
+ @Override public Void process(MutableEntry<Integer, BinaryObject> entry, Object... arguments)
+ throws EntryProcessorException {
+ BinaryObjectBuilder bldr = entry.getValue().toBuilder();
+
+ Integer val = bldr.<Integer>getField("val");
+
+ bldr.setField("val", val + 1);
+ bldr.setField("strVal", "updated-" + val);
+
+ entry.setValue(bldr.build());
+
+ return null;
+ }
+ }
+
+ /**
+ *
+ */
+ static class TestValue {
+ /** */
+ private Integer val;
+
+ /** */
+ private String strVal;
+
+ /**
+ * @param val Value.
+ */
+ public TestValue(Integer val, String strVal) {
+ this.val = val;
+ this.strVal = strVal;
+ }
+
+ /**
+ * @return Value.
+ */
+ public Integer value() {
+ return val;
+ }
+
+ /**
+ * @return String value.
+ */
+ public String stringValue() {
+ return strVal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ TestValue testVal = (TestValue) o;
+
+ return val.equals(testVal.val);
+
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return val.hashCode();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(TestValue.class, this);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
index 4f478f7..0cfa88b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
@@ -62,7 +62,7 @@ public abstract class GridCacheBinaryStoreAbstractSelfTest extends GridCommonAbs
CacheConfiguration cacheCfg = new CacheConfiguration();
cacheCfg.setCacheStoreFactory(singletonFactory(STORE));
- cacheCfg.setKeepBinaryInStore(keepBinaryInStore());
+ cacheCfg.setStoreKeepBinary(keepBinaryInStore());
cacheCfg.setReadThrough(true);
cacheCfg.setWriteThrough(true);
cacheCfg.setLoadPreviousValue(true);
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/BinaryTxCacheLocalEntriesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/BinaryTxCacheLocalEntriesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/BinaryTxCacheLocalEntriesSelfTest.java
index aa25caf..54fa5dd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/BinaryTxCacheLocalEntriesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/portable/BinaryTxCacheLocalEntriesSelfTest.java
@@ -41,7 +41,7 @@ public class BinaryTxCacheLocalEntriesSelfTest extends GridCacheAbstractSelfTest
@Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(gridName);
- ccfg.setKeepBinaryInStore(true);
+ ccfg.setStoreKeepBinary(true);
return ccfg;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
index af03e69..8376d40 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
@@ -39,7 +39,7 @@
<property name="name" value="object_store_parallel"/>
<property name="cacheMode" value="LOCAL"/>
<property name="atomicityMode" value="TRANSACTIONAL"/>
- <property name="keepBinaryInStore" value="false"/>
+ <property name="storeKeepBinary" value="false"/>
<property name="cacheStoreFactory">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
http://git-wip-us.apache.org/repos/asf/ignite/blob/df08d3de/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
index 25a1d16..c2c4762 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
@@ -41,7 +41,7 @@
<property name="atomicityMode" value="TRANSACTIONAL"/>
<property name="writeThrough" value="true"/>
<property name="readThrough" value="true"/>
- <property name="keepBinaryInStore" value="true"/>
+ <property name="storeKeepBinary" value="true"/>
<property name="cacheStoreFactory">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
@@ -56,7 +56,7 @@
<property name="atomicityMode" value="TRANSACTIONAL"/>
<property name="writeThrough" value="true"/>
<property name="readThrough" value="true"/>
- <property name="keepBinaryInStore" value="false"/>
+ <property name="storeKeepBinary" value="false"/>
<property name="cacheStoreFactory">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
@@ -71,7 +71,7 @@
<property name="atomicityMode" value="TRANSACTIONAL"/>
<property name="writeThrough" value="true"/>
<property name="readThrough" value="true"/>
- <property name="keepBinaryInStore" value="false"/>
+ <property name="storeKeepBinary" value="false"/>
<property name="cacheStoreFactory">
<bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">