This is an automated email from the ASF dual-hosted git repository.
zstan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 9c7b46b42f4 IGNITE-28737 Calcite. Cache with keep binary context need
to be correctly handled through CacheInterceptor (#13241)
9c7b46b42f4 is described below
commit 9c7b46b42f4ad8b5bdcfb25d39b5b9a9855aa5d0
Author: Evgeniy Stanilovskiy <[email protected]>
AuthorDate: Fri Jun 19 10:25:50 2026 +0300
IGNITE-28737 Calcite. Cache with keep binary context need to be correctly
handled through CacheInterceptor (#13241)
---
.../benchmarks/jmh/sql/JmhSqlInsertBenchmark.java | 142 +++++++++++++++++++++
modules/calcite/pom.xml | 7 -
.../query/calcite/exec/rel/ModifyNode.java | 4 +-
.../integration/KeepBinaryIntegrationTest.java | 47 +++++++
.../processors/cache/CacheOperationContext.java | 63 +++++++--
.../processors/cache/GridCacheAdapter.java | 41 +++++-
.../processors/cache/GridCacheEntryEx.java | 6 +
.../processors/cache/GridCacheMapEntry.java | 37 ++++--
.../processors/cache/GridCacheProxyImpl.java | 45 ++++++-
.../processors/cache/IgniteInternalCache.java | 6 +
.../distributed/GridDistributedLockRequest.java | 62 +++++++--
.../GridDistributedTxPrepareRequest.java | 2 +-
.../GridDistributedTxRemoteAdapter.java | 3 +
.../cache/distributed/dht/GridDhtLockFuture.java | 9 ++
.../cache/distributed/dht/GridDhtLockRequest.java | 4 +
.../dht/GridDhtTransactionalCacheAdapter.java | 6 +
.../distributed/dht/GridDhtTxLocalAdapter.java | 8 ++
.../atomic/GridDhtAtomicAbstractUpdateRequest.java | 11 ++
.../distributed/dht/atomic/GridDhtAtomicCache.java | 30 +++--
.../atomic/GridDhtAtomicSingleUpdateFuture.java | 2 +
.../atomic/GridDhtAtomicSingleUpdateRequest.java | 3 +
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 1 +
.../dht/atomic/GridDhtAtomicUpdateRequest.java | 3 +
.../atomic/GridNearAtomicAbstractUpdateFuture.java | 8 +-
.../GridNearAtomicAbstractUpdateRequest.java | 15 ++-
.../atomic/GridNearAtomicSingleUpdateFuture.java | 10 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 13 +-
.../dht/colocated/GridDhtColocatedCache.java | 12 ++
.../dht/colocated/GridDhtColocatedLockFuture.java | 16 ++-
.../distributed/near/GridNearAtomicCache.java | 4 +
.../cache/distributed/near/GridNearLockFuture.java | 8 ++
.../distributed/near/GridNearLockRequest.java | 3 +
.../near/GridNearOptimisticTxPrepareFuture.java | 2 +-
.../near/GridNearTransactionalCache.java | 3 +
.../cache/distributed/near/GridNearTxLocal.java | 25 ++++
.../cache/transactions/IgniteTxEntry.java | 22 +++-
.../cache/transactions/IgniteTxLocalAdapter.java | 11 +-
.../datastructures/GridCacheQueueAdapter.java | 3 +-
.../processors/cache/GridCacheTestEntryEx.java | 11 +-
.../cache/consistency/ReadRepairDataGenerator.java | 2 +
.../snapshot/dump/IgniteCacheDumpSelf2Test.java | 1 +
.../internal/processors/query/h2/dml/DmlUtils.java | 2 +-
42 files changed, 620 insertions(+), 93 deletions(-)
diff --git
a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/sql/JmhSqlInsertBenchmark.java
b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/sql/JmhSqlInsertBenchmark.java
new file mode 100644
index 00000000000..fa291430c59
--- /dev/null
+++
b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/sql/JmhSqlInsertBenchmark.java
@@ -0,0 +1,142 @@
+/*
+ * 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.benchmarks.jmh.sql;
+
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Threads;
+import org.openjdk.jmh.annotations.Warmup;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+import static java.lang.String.format;
+import static java.util.stream.Collectors.joining;
+
+/**
+ * Benchmark for insertion operation, comparing SQL APIs.
+ */
+@State(Scope.Benchmark)
+@Fork(1)
+@Threads(1)
+@Warmup(iterations = 10, time = 2)
+@Measurement(iterations = 10, time = 2)
+@BenchmarkMode(Mode.AverageTime)
+@OutputTimeUnit(TimeUnit.MICROSECONDS)
+public class JmhSqlInsertBenchmark extends JmhSqlAbstractBenchmark {
+ /** */
+ private int id;
+
+ /** */
+ private static final String FIELD_VAL = "a".repeat(100);
+
+ /** */
+ private static final String TABLE_NAME = "dept";
+
+ /** */
+ private String insertStr;
+
+ /** */
+ private String multiInsertStr;
+
+ /**
+ * Initiate new tables.
+ */
+ @Override public void setup() {
+ super.setup();
+
+ insertStr = createInsertStatement();
+ multiInsertStr = createMultiInsertStatement();
+
+ executeSql("CREATE TABLE " + TABLE_NAME +
+ "(ycsb_key int PRIMARY KEY," +
+ "field1 varchar(100)," +
+ "field2 varchar(100)," +
+ "field3 varchar(100)," +
+ "field4 varchar(100)," +
+ "field5 varchar(100)," +
+ "field6 varchar(100)," +
+ "field7 varchar(100)," +
+ "field8 varchar(100)," +
+ "field9 varchar(100)," +
+ "field10 varchar(100))"
+ );
+ }
+
+ /**
+ * Benchmark for SQL insert via embedded client.
+ */
+ @Benchmark
+ public void sqlSimpleInsert() {
+ executeSql(insertStr, id++);
+ }
+
+ /**
+ * Benchmark for batch SQL insert via embedded client.
+ */
+ @Benchmark
+ public void sqlBatchInsert() {
+ executeSql(multiInsertStr, id, id + 1);
+
+ id += 2;
+ }
+
+ /**
+ * Run benchmarks.
+ *
+ * @param args Args.
+ * @throws Exception Exception.
+ */
+ public static void main(String[] args) throws Exception {
+ final Options options = new OptionsBuilder()
+ .include(JmhSqlInsertBenchmark.class.getSimpleName())
+ .build();
+
+ new Runner(options).run();
+ }
+
+ /** */
+ private static String createInsertStatement() {
+ /** */
+ String insertQryTemplate = "insert into %s(%s, %s) values(?, %s)";
+
+ String fieldsQ = IntStream.range(1, 11).mapToObj(i -> "field" +
i).collect(joining(","));
+ String valQ = IntStream.range(1, 11).mapToObj(i -> "'" + FIELD_VAL +
"'").collect(joining(","));
+
+ return format(insertQryTemplate, TABLE_NAME, "ycsb_key", fieldsQ,
valQ);
+ }
+
+ /** */
+ private static String createMultiInsertStatement() {
+ /** */
+ String insertQryTemplate = "insert into %s(%s, %s) values(?, %s), (?,
%s)";
+
+ String fieldsQ = IntStream.range(1, 11).mapToObj(i -> "field" +
i).collect(joining(","));
+ String valQ = IntStream.range(1, 11).mapToObj(i -> "'" + FIELD_VAL +
"'").collect(joining(","));
+
+ return format(insertQryTemplate, TABLE_NAME, "ycsb_key", fieldsQ,
valQ, valQ);
+ }
+}
diff --git a/modules/calcite/pom.xml b/modules/calcite/pom.xml
index 412b39d3403..945451239f8 100644
--- a/modules/calcite/pom.xml
+++ b/modules/calcite/pom.xml
@@ -37,7 +37,6 @@
<properties>
<avatica.version>1.26.0</avatica.version>
<calcite.version>1.40.0</calcite.version>
- <checker.version>3.10.0</checker.version>
<failureaccess.version>1.0.1</failureaccess.version>
<immutables.version>2.8.2</immutables.version>
<janino.version>3.1.12</janino.version>
@@ -94,12 +93,6 @@
<artifactId>failureaccess</artifactId>
</dependency>
- <dependency>
- <groupId>org.checkerframework</groupId>
- <artifactId>checker-qual</artifactId>
- <version>${checker.version}</version>
- </dependency>
-
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>commons-compiler</artifactId>
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ModifyNode.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ModifyNode.java
index fcf2b8ebd33..3ae2dee35a1 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ModifyNode.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ModifyNode.java
@@ -232,14 +232,14 @@ public class ModifyNode<Row> extends AbstractNode<Row>
implements SingleNode<Row
this.tuples = new ArrayList<>(MODIFY_BATCH_SIZE);
GridCacheContext<Object, Object> cctx = desc.cacheContext();
- IgniteInternalCache<Object, Object> cache = cctx.cache();
+ IgniteInternalCache<Object, Object> cache = cctx.cache().keepBinary();
GridNearTxLocal tx = Commons.queryTransaction(context(),
cctx.shared());
QueryProperties props = context().unwrap(QueryProperties.class);
boolean keepBinaryMode = props == null || props.keepBinary();
if (keepBinaryMode)
- cache = cache.keepBinary();
+ cache = cache.withKeepBinaryInInterceptor();
if (tx == null)
invokeOutsideTransaction(tuples, cache);
diff --git
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KeepBinaryIntegrationTest.java
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KeepBinaryIntegrationTest.java
index c57597e73b9..6eaf7b11687 100644
---
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KeepBinaryIntegrationTest.java
+++
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KeepBinaryIntegrationTest.java
@@ -156,6 +156,53 @@ public class KeepBinaryIntegrationTest extends
AbstractBasicIntegrationTransacti
txAction(client, checker);
}
+ /** */
+ @Test
+ public void testDmlWithCompositePk() {
+ IgniteCache<Object, Object> cache =
client.createCache(cacheConfiguration().setName("testInsert"));
+
+ if (sqlTxMode != SqlTransactionMode.NONE && tx == null)
+ startTransaction(client);
+
+ SupplierX<?> checker = () -> {
+ checkDml(0, nodeCount() * 10, cache);
+
+ IgniteCache<Object, Object> cacheBin = cache.withKeepBinary();
+
+ checkDml(nodeCount() * 10, 2 * nodeCount() * 10, cacheBin);
+
+ List<List<?>> res = cacheBin.query(new SqlFieldsQuery("SELECT *
FROM emp")).getAll();
+
+ assertEquals("Unexpected result set size: " + res.size(), 1,
res.size());
+
+ return null;
+ };
+
+ if (sqlTxMode == SqlTransactionMode.NONE)
+ checker.get();
+ else
+ txAction(client, checker);
+ }
+
+ /** */
+ private void checkDml(int begin, int end, IgniteCache<?, ?> cache) {
+ cache.query(new SqlFieldsQuery("CREATE TABLE IF NOT EXISTS emp(empid
INTEGER, deptid INTEGER, name VARCHAR, salary INTEGER, " +
+ "PRIMARY KEY(empid, deptid)) WITH \"AFFINITY_KEY=deptid," +
atomicity() + "\""))
+ .getAll();
+
+ for (int i = begin; i < end; i++) {
+ cache.query(new SqlFieldsQuery("INSERT INTO emp (empid, deptid,
name, salary) VALUES (?, ?, ?, ?)").setArgs(
+ i, i % 2, "Employee " + i, i)).getAll();
+
+ cache.query(new SqlFieldsQuery("UPDATE emp SET name = '' WHERE
empid = ? AND deptid = ?").setArgs(i, i % 2)).getAll();
+ cache.query(new SqlFieldsQuery("DELETE FROM emp WHERE empid =
?").setArgs(i - 1)).getAll();
+
+ cache.query(new SqlFieldsQuery(
+ "MERGE INTO emp dst USING table(system_range(1, 1000)) src ON
dst.salary = src.x " +
+ "WHEN MATCHED THEN UPDATE SET dst.salary =
src.x")).getAll();
+ }
+ }
+
/** */
private static class Person {
/** */
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
index b6470c60edc..eab8e8472fa 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
@@ -64,6 +64,9 @@ public class CacheOperationContext implements Serializable {
/** Application attributes. */
private final Map<String, String> appAttrs;
+ /** Handle binary in interceptor operation flag. */
+ private final boolean keepBinaryInInterceptor;
+
/**
* Constructor with default values.
*/
@@ -77,6 +80,7 @@ public class CacheOperationContext implements Serializable {
readRepairStrategy = null;
dataCenterId = null;
appAttrs = null;
+ keepBinaryInInterceptor = false;
}
/**
@@ -87,6 +91,7 @@ public class CacheOperationContext implements Serializable {
* @param dataCenterId Data center id.
* @param readRepairStrategy Read-repair strategy.
* @param appAttrs Application attributes.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
*/
public CacheOperationContext(
boolean skipStore,
@@ -97,7 +102,8 @@ public class CacheOperationContext implements Serializable {
@Nullable Byte dataCenterId,
boolean recovery,
@Nullable ReadRepairStrategy readRepairStrategy,
- @Nullable Map<String, String> appAttrs
+ @Nullable Map<String, String> appAttrs,
+ boolean keepBinaryInInterceptor
) {
this.skipStore = skipStore;
this.skipReadThrough = skipReadThrough;
@@ -108,6 +114,7 @@ public class CacheOperationContext implements Serializable {
this.recovery = recovery;
this.readRepairStrategy = readRepairStrategy;
this.appAttrs = appAttrs;
+ this.keepBinaryInInterceptor = keepBinaryInInterceptor;
}
/**
@@ -117,6 +124,11 @@ public class CacheOperationContext implements Serializable
{
return keepBinary;
}
+ /** Return handle binary in interceptor operation flag. */
+ public boolean isKeepBinaryInInterceptor() {
+ return keepBinaryInInterceptor;
+ }
+
/**
* @return {@code True} if data center id is set otherwise {@code false}.
*/
@@ -139,7 +151,27 @@ public class CacheOperationContext implements Serializable
{
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ true);
+ }
+
+ /**
+ * See {@link IgniteInternalCache#withKeepBinaryInInterceptor()}.
+ *
+ * @return New instance of CacheOperationContext with handle binary in
interceptor flag.
+ */
+ public CacheOperationContext withKeepBinaryInInterceptor() {
+ return new CacheOperationContext(
+ skipStore,
+ skipReadThrough,
+ keepBinary,
+ expiryPlc,
+ noRetries,
+ dataCenterId,
+ recovery,
+ readRepairStrategy,
+ appAttrs,
+ true);
}
/**
@@ -174,7 +206,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
}
/** @return Skip read-through cache store. */
@@ -197,7 +230,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- Collections.unmodifiableMap(attrs));
+ Collections.unmodifiableMap(attrs),
+ keepBinaryInInterceptor);
}
/**
@@ -215,7 +249,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
}
/**
@@ -241,7 +276,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
}
/**
@@ -258,7 +294,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
}
/**
@@ -275,7 +312,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
}
/**
@@ -292,7 +330,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
}
/**
@@ -309,7 +348,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
}
/**
@@ -326,7 +366,8 @@ public class CacheOperationContext implements Serializable {
dataCenterId,
recovery,
readRepairStrategy,
- new HashMap<>(appAttrs));
+ new HashMap<>(appAttrs),
+ keepBinaryInInterceptor);
}
/**
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 410bac3545f..d494e5df0df 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -476,7 +476,8 @@ public abstract class GridCacheAdapter<K, V> implements
IgniteInternalCache<K, V
null,
false,
null,
- null);
+ null,
+ false);
return new GridCacheProxyImpl<>(ctx, this, opCtx);
}
@@ -495,7 +496,8 @@ public abstract class GridCacheAdapter<K, V> implements
IgniteInternalCache<K, V
null,
false,
null,
- null);
+ null,
+ false);
}
else
opCtx = opCtx.withSkipReadThrough();
@@ -517,7 +519,8 @@ public abstract class GridCacheAdapter<K, V> implements
IgniteInternalCache<K, V
null,
false,
null,
- new HashMap<>(attrs));
+ new HashMap<>(attrs),
+ false);
}
else
opCtx = opCtx.withApplicationAttributes(attrs);
@@ -536,11 +539,35 @@ public abstract class GridCacheAdapter<K, V> implements
IgniteInternalCache<K, V
null,
false,
null,
- null);
+ null,
+ false);
return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx,
(GridCacheAdapter<K1, V1>)this, opCtx);
}
+ /** {@inheritDoc} */
+ @Override public GridCacheProxyImpl<K, V> withKeepBinaryInInterceptor() {
+ CacheOperationContext opCtx = this.ctx.operationContextPerCall();
+
+ if (opCtx == null) {
+ opCtx = new CacheOperationContext(
+ false,
+ false,
+ false,
+ null,
+ false,
+ null,
+ false,
+ null,
+ null,
+ true);
+ }
+ else
+ opCtx = opCtx.withKeepBinaryInInterceptor();
+
+ return new GridCacheProxyImpl<>(this.ctx, this, opCtx);
+ }
+
/** {@inheritDoc} */
@Nullable @Override public final ExpiryPolicy expiry() {
return null;
@@ -559,7 +586,8 @@ public abstract class GridCacheAdapter<K, V> implements
IgniteInternalCache<K, V
null,
false,
null,
- null);
+ null,
+ false);
return new GridCacheProxyImpl<>(ctx, this, opCtx);
}
@@ -575,7 +603,8 @@ public abstract class GridCacheAdapter<K, V> implements
IgniteInternalCache<K, V
null,
false,
null,
- null);
+ null,
+ false);
return new GridCacheProxyImpl<>(ctx, this, opCtx);
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index ccd41cd6e50..bda9d3fbdc1 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -336,6 +336,7 @@ public interface GridCacheEntryEx {
* @param drType DR type.
* @param drExpireTime DR expire time (if any).
* @param explicitVer Explicit version (if any).
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param taskName Task name.
* @param dhtVer Dht version for near cache entry.
* @param updateCntr Update counter.
@@ -355,6 +356,7 @@ public interface GridCacheEntryEx {
boolean evt,
boolean metrics,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean oldValPresent,
@Nullable CacheObject oldVal,
AffinityTopologyVersion topVer,
@@ -374,6 +376,7 @@ public interface GridCacheEntryEx {
* @param evt Flag to signal event notification.
* @param metrics Flag to signal metrics notification.
* @param keepBinary Keep binary flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param oldValPresent {@code True} if oldValue present.
* @param oldVal Old value.
* @param topVer Topology version.
@@ -394,6 +397,7 @@ public interface GridCacheEntryEx {
boolean evt,
boolean metrics,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean oldValPresent,
@Nullable CacheObject oldVal,
AffinityTopologyVersion topVer,
@@ -433,6 +437,7 @@ public interface GridCacheEntryEx {
* @param updateCntr Update counter.
* @param fut Dht atomic future.
* @param transformOp {@code True} if transform operation caused update.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @return Tuple where first value is flag showing whether operation
succeeded,
* second value is old entry value if return value is requested,
third is updated entry value,
* fourth is the version to enqueue for deferred delete the fifth is
DR conflict context
@@ -452,6 +457,7 @@ public interface GridCacheEntryEx {
boolean readThrough,
boolean retval,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean evt,
boolean metrics,
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 161a25feb9d..d2ead2bb39d 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -990,6 +990,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
boolean evt,
boolean metrics,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean oldValPresent,
@Nullable CacheObject oldVal,
AffinityTopologyVersion topVer,
@@ -1056,9 +1057,9 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
intercept = !skipInterceptor(explicitVer);
if (intercept) {
- val0 = cctx.unwrapBinaryIfNeeded(val, keepBinary, false, null);
+ val0 = cctx.unwrapBinaryIfNeeded(val, keepBinaryInInterceptor,
false, null);
- CacheLazyEntry e = new CacheLazyEntry(cctx, key, old,
keepBinary);
+ CacheLazyEntry e = new CacheLazyEntry(cctx, key, old,
keepBinaryInInterceptor);
key0 = e.key();
@@ -1205,6 +1206,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
boolean evt,
boolean metrics,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean oldValPresent,
@Nullable CacheObject oldVal,
AffinityTopologyVersion topVer,
@@ -1274,15 +1276,12 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
intercept = !skipInterceptor(explicitVer);
if (intercept) {
- entry0 = new CacheLazyEntry(cctx, key, old, keepBinary);
+ entry0 = new CacheLazyEntry(cctx, key, old,
keepBinaryInInterceptor);
interceptRes =
cctx.config().getInterceptor().onBeforeRemove(entry0);
- if (cctx.cancelRemove(interceptRes)) {
- CacheObject ret =
cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2()));
-
+ if (cctx.cancelRemove(interceptRes))
return new GridCacheUpdateTxResult(false, logPtr);
- }
}
DumpEntryChangeListener dumpLsnr = cctx.dumpListener();
@@ -1448,6 +1447,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
final boolean readThrough,
final boolean retval,
final boolean keepBinary,
+ boolean keepBinaryInInterceptor,
@Nullable final IgniteCacheExpiryPolicy expiryPlc,
final boolean evt,
final boolean metrics,
@@ -1501,6 +1501,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
readFromStore,
writeThrough,
keepBinary,
+ keepBinaryInInterceptor,
expiryPlc,
primary,
verCheck,
@@ -4520,6 +4521,9 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
/** */
private final boolean keepBinary;
+ /** */
+ private final boolean keepBinaryInInterceptor;
+
/** */
private final IgniteCacheExpiryPolicy expiryPlc;
@@ -4585,6 +4589,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
boolean readThrough,
boolean writeThrough,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean primary,
boolean verCheck,
@@ -4608,6 +4613,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
this.readThrough = readThrough;
this.writeThrough = writeThrough;
this.keepBinary = keepBinary;
+ this.keepBinaryInInterceptor = keepBinaryInInterceptor;
this.expiryPlc = expiryPlc;
this.primary = primary;
this.verCheck = verCheck;
@@ -4807,12 +4813,12 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
if (op == UPDATE) {
assert writeObj != null;
- update(conflictCtx, invokeRes, storeLoadedVal != null,
transformed);
+ update(conflictCtx, invokeRes, storeLoadedVal != null,
keepBinaryInInterceptor, transformed);
}
else {
assert op == DELETE && writeObj == null : op;
- remove(conflictCtx, invokeRes, storeLoadedVal != null,
transformed);
+ remove(conflictCtx, invokeRes, storeLoadedVal != null,
keepBinaryInInterceptor, transformed);
}
assert updateRes != null && treeOp != null;
@@ -4937,12 +4943,14 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
* @param conflictCtx Conflict context.
* @param invokeRes Entry processor result (for invoke operation).
* @param readFromStore {@code True} if initial entry value was {@code
null} and it was read from store.
+ * @param keepBinaryInInterceptor {@code true} if value need to be
unwrapped.
* @param transformed {@code True} if update caused by transformation
operation.
* @throws IgniteCheckedException If failed.
*/
private void update(@Nullable GridCacheVersionConflictContext<?, ?>
conflictCtx,
@Nullable IgniteBiTuple<Object, Exception> invokeRes,
boolean readFromStore,
+ boolean keepBinaryInInterceptor,
boolean transformed)
throws IgniteCheckedException {
GridCacheContext cctx = entry.context();
@@ -4999,18 +5007,18 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
writeObj = null;
- remove(conflictCtx, invokeRes, readFromStore, false);
+ remove(conflictCtx, invokeRes, readFromStore,
keepBinaryInInterceptor, false);
return;
}
if (intercept && (conflictVer == null ||
!skipInterceptorOnConflict)) {
- Object updated0 = cctx.unwrapBinaryIfNeeded(updated,
keepBinary, false, null);
+ Object updated0 = cctx.unwrapBinaryIfNeeded(updated,
keepBinaryInInterceptor, false, null);
CacheLazyEntry<Object, Object> interceptEntry =
- new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null,
keepBinary);
+ new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null,
keepBinaryInInterceptor);
- Object interceptorVal = null;
+ Object interceptorVal;
try {
interceptorVal =
cctx.config().getInterceptor().onBeforePut(interceptEntry, updated0);
@@ -5125,6 +5133,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
private void remove(@Nullable GridCacheVersionConflictContext<?, ?>
conflictCtx,
@Nullable IgniteBiTuple<Object, Exception> invokeRes,
boolean readFromStore,
+ boolean unwrapVal,
boolean transformed)
throws IgniteCheckedException {
GridCacheContext cctx = entry.context();
@@ -5135,7 +5144,7 @@ public abstract class GridCacheMapEntry extends
GridMetadataAwareAdapter impleme
if (intercept && (conflictVer == null ||
!skipInterceptorOnConflict)) {
CacheLazyEntry<Object, Object> intercepEntry =
- new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null,
keepBinary);
+ new CacheLazyEntry<>(cctx, entry.key, null, oldVal, null,
unwrapVal);
interceptRes =
cctx.config().getInterceptor().onBeforeRemove(intercepEntry);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index d06f64e039a..82ac5cf606e 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -31,6 +31,7 @@ import javax.cache.processor.EntryProcessor;
import javax.cache.processor.EntryProcessorResult;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cache.CacheEntry;
+import org.apache.ignite.cache.CacheInterceptor;
import org.apache.ignite.cache.CacheMetrics;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.affinity.Affinity;
@@ -269,7 +270,8 @@ public class GridCacheProxyImpl<K, V> implements
IgniteInternalCache<K, V>, Exte
null,
false,
null,
- null));
+ null,
+ false));
}
finally {
gate.leave(prev);
@@ -295,7 +297,8 @@ public class GridCacheProxyImpl<K, V> implements
IgniteInternalCache<K, V>, Exte
null,
false,
null,
- null));
+ null,
+ false));
}
finally {
gate.leave(prev);
@@ -318,7 +321,8 @@ public class GridCacheProxyImpl<K, V> implements
IgniteInternalCache<K, V>, Exte
null,
false,
null,
- attrs));
+ attrs,
+ false));
}
finally {
gate.leave(prev);
@@ -341,7 +345,8 @@ public class GridCacheProxyImpl<K, V> implements
IgniteInternalCache<K, V>, Exte
null,
false,
null,
- null));
+ null,
+ false));
}
/** {@inheritDoc} */
@@ -1592,7 +1597,34 @@ public class GridCacheProxyImpl<K, V> implements
IgniteInternalCache<K, V>, Exte
null,
false,
null,
- null));
+ null,
+ false));
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /**
+ * @return Cache with handle binary values during {@link CacheInterceptor}
execution flag.
+ */
+ @Override public IgniteInternalCache<K, V> withKeepBinaryInInterceptor() {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return new GridCacheProxyImpl<>(ctx, delegate,
+ opCtx != null ? opCtx.withKeepBinaryInInterceptor() :
+ new CacheOperationContext(
+ false,
+ false,
+ false,
+ null,
+ false,
+ null,
+ false,
+ null,
+ null,
+ true));
}
finally {
gate.leave(prev);
@@ -1614,7 +1646,8 @@ public class GridCacheProxyImpl<K, V> implements
IgniteInternalCache<K, V>, Exte
null,
false,
null,
- null));
+ null,
+ false));
}
finally {
gate.leave(prev);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 50bdf4efe97..678a8227f41 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -33,6 +33,7 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteDataStreamer;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheEntry;
+import org.apache.ignite.cache.CacheInterceptor;
import org.apache.ignite.cache.CacheMetrics;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CachePeekMode;
@@ -1642,6 +1643,11 @@ public interface IgniteInternalCache<K, V> extends
Iterable<Cache.Entry<K, V>> {
*/
public IgniteInternalCache<K, V> withExpiryPolicy(ExpiryPolicy plc);
+ /**
+ * @return Cache with handle binary values during {@link CacheInterceptor}
execution flag.
+ */
+ public IgniteInternalCache<K, V> withKeepBinaryInInterceptor();
+
/**
* @return Cache with no-retries behavior enabled.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index b02d75024fe..82875ddab68 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -49,6 +49,9 @@ public class GridDistributedLockRequest extends
GridDistributedBaseMessage {
/** */
private static final int SKIP_READ_THROUGH_FLAG_MASK = 0x08;
+ /** Handle binary in interceptor operation flag bit mask. */
+ private static final int KEEP_BINARY_INTERCEPTOR_FLAG_MASK = 0x10;
+
/** Sender node ID. */
@Order(0)
public UUID nodeId;
@@ -127,6 +130,8 @@ public class GridDistributedLockRequest extends
GridDistributedBaseMessage {
* @param keyCnt Number of keys.
* @param txSize Expected transaction size.
* @param skipStore Skip store flag.
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
*/
public GridDistributedLockRequest(
int cacheId,
@@ -144,6 +149,7 @@ public class GridDistributedLockRequest extends
GridDistributedBaseMessage {
int txSize,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary
) {
super(lockVer, keyCnt, false);
@@ -169,6 +175,7 @@ public class GridDistributedLockRequest extends
GridDistributedBaseMessage {
skipStore(skipStore);
skipReadThrough(skipReadThrough);
keepBinary(keepBinary);
+ keepBinaryInInterceptor(keepBinaryInInterceptor);
}
/**
@@ -234,61 +241,90 @@ public class GridDistributedLockRequest extends
GridDistributedBaseMessage {
* @param skipStore Skip store flag.
*/
private void skipStore(boolean skipStore) {
- flags = skipStore ? (byte)(flags | SKIP_STORE_FLAG_MASK) :
(byte)(flags & ~SKIP_STORE_FLAG_MASK);
+ setFlag(skipStore, SKIP_STORE_FLAG_MASK);
}
/**
* @return Skip store flag.
*/
public boolean skipStore() {
- return (flags & SKIP_STORE_FLAG_MASK) == 1;
+ return isFlag(SKIP_STORE_FLAG_MASK);
}
/**
- * Sets skip store flag value.
+ * Sets skip read-through flag value.
*
* @param skipReadThrough Skip read-through cache store flag.
*/
private void skipReadThrough(boolean skipReadThrough) {
- flags = skipReadThrough ? (byte)(flags | SKIP_READ_THROUGH_FLAG_MASK)
: (byte)(flags & ~SKIP_READ_THROUGH_FLAG_MASK);
+ setFlag(skipReadThrough, SKIP_READ_THROUGH_FLAG_MASK);
}
/**
- * @return Skip store flag.
+ * @return Skip read-through flag.
*/
public boolean skipReadThrough() {
- return (flags & SKIP_READ_THROUGH_FLAG_MASK) != 0;
+ return isFlag(SKIP_READ_THROUGH_FLAG_MASK);
+ }
+
+ /** Sets flag indicating whether to handle binary in interceptor. */
+ public void keepBinaryInInterceptor(boolean handleBinary) {
+ setFlag(handleBinary, KEEP_BINARY_INTERCEPTOR_FLAG_MASK);
+ }
+
+ /**
+ * @return Flag indicating whether to handle binary in interceptor.
+ */
+ public boolean keepBinaryInInterceptor() {
+ return isFlag(KEEP_BINARY_INTERCEPTOR_FLAG_MASK);
}
/**
* @param keepBinary Keep binary flag.
*/
private void keepBinary(boolean keepBinary) {
- flags = keepBinary ? (byte)(flags | KEEP_BINARY_FLAG_MASK) :
(byte)(flags & ~KEEP_BINARY_FLAG_MASK);
+ setFlag(keepBinary, KEEP_BINARY_FLAG_MASK);
}
/**
* @return Keep binary.
*/
public boolean keepBinary() {
- return (flags & KEEP_BINARY_FLAG_MASK) != 0;
+ return isFlag(KEEP_BINARY_FLAG_MASK);
}
/**
* @return Flag indicating whether transaction use cache store.
*/
public boolean storeUsed() {
- return (flags & STORE_USED_FLAG_MASK) != 0;
+ return isFlag(STORE_USED_FLAG_MASK);
}
/**
* @param storeUsed Store used value.
*/
public void storeUsed(boolean storeUsed) {
- if (storeUsed)
- flags |= STORE_USED_FLAG_MASK;
- else
- flags &= ~STORE_USED_FLAG_MASK;
+ setFlag(storeUsed, STORE_USED_FLAG_MASK);
+ }
+
+ /**
+ * Sets flag mask.
+ *
+ * @param flag Set or clear.
+ * @param mask Mask.
+ */
+ private void setFlag(boolean flag, int mask) {
+ flags = flag ? (byte)(flags | mask) : (byte)(flags & ~mask);
+ }
+
+ /**
+ * Reads flag mask.
+ *
+ * @param mask Mask to read.
+ * @return Flag value.
+ */
+ private boolean isFlag(int mask) {
+ return (flags & mask) != 0;
}
/**
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index bd427bd47b5..68a53ca1936 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -216,7 +216,7 @@ public class GridDistributedTxPrepareRequest extends
GridDistributedBaseMessage
* @return Flag indicating whether transaction use cache store.
*/
public boolean storeWriteThrough() {
- return (flags & STORE_WRITE_THROUGH_FLAG_MASK) != 0;
+ return isFlag(STORE_WRITE_THROUGH_FLAG_MASK);
}
/**
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 7c83c0cc3a9..77e5d9aa97a 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -617,6 +617,7 @@ public abstract class GridDistributedTxRemoteAdapter
extends IgniteTxAdapter imp
true,
true,
txEntry.keepBinary(),
+
txEntry.keepBinaryInInterceptor(),
txEntry.hasOldValue(),
txEntry.oldValue(),
topVer,
@@ -638,6 +639,7 @@ public abstract class GridDistributedTxRemoteAdapter
extends IgniteTxAdapter imp
true,
true,
txEntry.keepBinary(),
+
txEntry.keepBinaryInInterceptor(),
txEntry.hasOldValue(),
txEntry.oldValue(),
topVer,
@@ -675,6 +677,7 @@ public abstract class GridDistributedTxRemoteAdapter
extends IgniteTxAdapter imp
true,
true,
txEntry.keepBinary(),
+ txEntry.keepBinaryInInterceptor(),
txEntry.hasOldValue(),
txEntry.oldValue(),
topVer,
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 740b235639b..fef43785bef 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -187,6 +187,9 @@ public final class GridDhtLockFuture extends
GridCacheCompoundIdentityFuture<Boo
/** Skip read-through cache store flag. */
private final boolean skipReadThrough;
+ /** Handle binary in interceptor operation flag. */
+ private final boolean keepBinaryInInterceptor;
+
/** Keep binary. */
private final boolean keepBinary;
@@ -203,6 +206,9 @@ public final class GridDhtLockFuture extends
GridCacheCompoundIdentityFuture<Boo
* @param threadId Thread ID.
* @param accessTtl TTL for read operation.
* @param skipStore Skip store flag.
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
+ * @param keepBinary Keep binary flag.
*/
public GridDhtLockFuture(
GridCacheContext<?, ?> cctx,
@@ -219,6 +225,7 @@ public final class GridDhtLockFuture extends
GridCacheCompoundIdentityFuture<Boo
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary) {
super(CU.boolReducer());
@@ -239,6 +246,7 @@ public final class GridDhtLockFuture extends
GridCacheCompoundIdentityFuture<Boo
this.accessTtl = accessTtl;
this.skipStore = skipStore;
this.skipReadThrough = skipReadThrough;
+ this.keepBinaryInInterceptor = keepBinaryInInterceptor;
this.keepBinary = keepBinary;
if (tx != null)
@@ -939,6 +947,7 @@ public final class GridDhtLockFuture extends
GridCacheCompoundIdentityFuture<Boo
read ? accessTtl : -1L,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
cctx.store().configured(),
keepBinary,
inTx() ? tx.label() : null);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
index 315997cecd8..0c51befe579 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -111,6 +111,8 @@ public class GridDhtLockRequest extends
GridDistributedLockRequest {
* @param storeUsed Cache store used flag.
* @param keepBinary Keep binary flag.
* @param txLbl Transaction label.
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
*/
public GridDhtLockRequest(
int cacheId,
@@ -132,6 +134,7 @@ public class GridDhtLockRequest extends
GridDistributedLockRequest {
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean storeUsed,
boolean keepBinary,
String txLbl
@@ -151,6 +154,7 @@ public class GridDhtLockRequest extends
GridDistributedLockRequest {
txSize,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
this.topVer = topVer;
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 8acb9ccb562..08da8d8af2d 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -742,6 +742,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K,
V> extends GridDhtCach
accessTtl,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
opCtx != null && opCtx.isKeepBinary());
}
@@ -759,6 +760,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K,
V> extends GridDhtCach
* @param accessTtl TTL for read operation.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @return Lock future.
*/
public GridDhtFuture<Boolean> lockAllAsyncInternal(@Nullable
Collection<KeyCacheObject> keys,
@@ -772,6 +774,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K,
V> extends GridDhtCach
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary) {
if (keys == null || keys.isEmpty())
return new GridDhtFinishedFuture<>(true);
@@ -795,6 +798,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K,
V> extends GridDhtCach
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
if (fut.isDone()) // Possible in case of cancellation or timeout or
rollback.
@@ -978,6 +982,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K,
V> extends GridDhtCach
req.accessTtl(),
req.skipStore(),
req.skipReadThrough(),
+ req.keepBinaryInInterceptor(),
req.keepBinary());
// Add before mapping.
@@ -1051,6 +1056,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K,
V> extends GridDhtCach
req.accessTtl(),
req.skipStore(),
req.skipReadThrough(),
+ req.keepBinaryInInterceptor(),
req.keepBinary(),
req.nearCache());
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index af3655f3b2f..625d59bb279 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -561,6 +561,8 @@ public abstract class GridDhtTxLocalAdapter extends
IgniteTxLocalAdapter {
* @param accessTtl TTL for read operation.
* @param needRetVal Return value flag.
* @param skipStore Skip store flag.
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param keepBinary Keep binary flag.
* @param nearCache {@code True} if near cache enabled on originating node.
* @return Lock future.
@@ -576,6 +578,7 @@ public abstract class GridDhtTxLocalAdapter extends
IgniteTxLocalAdapter {
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary,
boolean nearCache
) {
@@ -649,6 +652,7 @@ public abstract class GridDhtTxLocalAdapter extends
IgniteTxLocalAdapter {
null,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
nearCache);
@@ -693,6 +697,7 @@ public abstract class GridDhtTxLocalAdapter extends
IgniteTxLocalAdapter {
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
}
catch (IgniteCheckedException e) {
@@ -712,6 +717,7 @@ public abstract class GridDhtTxLocalAdapter extends
IgniteTxLocalAdapter {
* @param accessTtl TTL for read operation.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @return Future for lock acquisition.
*/
private IgniteInternalFuture<GridCacheReturn> obtainLockAsync(
@@ -724,6 +730,7 @@ public abstract class GridDhtTxLocalAdapter extends
IgniteTxLocalAdapter {
final long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary) {
if (log.isDebugEnabled())
log.debug("Before acquiring transaction lock on keys [keys=" +
passedKeys + ']');
@@ -755,6 +762,7 @@ public abstract class GridDhtTxLocalAdapter extends
IgniteTxLocalAdapter {
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
return new GridEmbeddedFuture<>(
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
index 5ed0e22d39e..aa9639c449e 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
@@ -58,6 +58,9 @@ public abstract class GridDhtAtomicAbstractUpdateRequest
extends GridCacheIdMess
/** Flag indicating recovery on read repair. */
protected static final int DHT_ATOMIC_READ_REPAIR_RECOVERY_FLAG_MASK =
0x80;
+ /** */
+ protected static final int DHT_ATOMIC_KEEP_BINARY_IN_INTERCEPTOR = 0x100;
+
/** Message index. */
public static final int CACHE_MSG_IDX = nextIndexId();
@@ -115,6 +118,7 @@ public abstract class GridDhtAtomicAbstractUpdateRequest
extends GridCacheIdMess
@NotNull AffinityTopologyVersion topVer,
int taskNameHash,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean skipStore,
boolean readRepairRecovery
) {
@@ -133,6 +137,8 @@ public abstract class GridDhtAtomicAbstractUpdateRequest
extends GridCacheIdMess
setFlag(true, DHT_ATOMIC_KEEP_BINARY_FLAG_MASK);
if (readRepairRecovery)
setFlag(true, DHT_ATOMIC_READ_REPAIR_RECOVERY_FLAG_MASK);
+ if (keepBinaryInInterceptor)
+ setFlag(true, DHT_ATOMIC_KEEP_BINARY_IN_INTERCEPTOR);
}
/** {@inheritDoc} */
@@ -198,6 +204,11 @@ public abstract class GridDhtAtomicAbstractUpdateRequest
extends GridCacheIdMess
return isFlag(DHT_ATOMIC_KEEP_BINARY_FLAG_MASK);
}
+ /** @return {@code true} if need to handle binary in interceptor. */
+ public final boolean keepBinaryInInterceptor() {
+ return isFlag(DHT_ATOMIC_KEEP_BINARY_IN_INTERCEPTOR);
+ }
+
/**
* @return Recovery on Read Repair flag.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 0a4ace04892..0bc90070925 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1111,7 +1111,8 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.recovery(),
opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
- opCtx != null ? opCtx.applicationAttributes() : null);
+ opCtx != null ? opCtx.applicationAttributes() : null,
+ opCtx != null && opCtx.isKeepBinaryInInterceptor());
if (async) {
return asyncOp(new CO<IgniteInternalFuture<Object>>() {
@@ -1299,7 +1300,8 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.recovery(),
opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
- opCtx != null ? opCtx.applicationAttributes() : null
+ opCtx != null ? opCtx.applicationAttributes() : null,
+ opCtx != null && opCtx.isKeepBinaryInInterceptor()
);
}
else {
@@ -1322,7 +1324,8 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.recovery(),
opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
- opCtx != null ? opCtx.applicationAttributes() : null);
+ opCtx != null ? opCtx.applicationAttributes() : null,
+ opCtx != null && opCtx.isKeepBinaryInInterceptor());
}
}
@@ -1381,7 +1384,8 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.recovery(),
opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
- opCtx != null ? opCtx.applicationAttributes() : null);
+ opCtx != null ? opCtx.applicationAttributes() : null,
+ opCtx != null && opCtx.isKeepBinaryInInterceptor());
if (async) {
return asyncOp(new CO<IgniteInternalFuture<Object>>() {
@@ -2252,7 +2256,8 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
if (updated == null) {
if (intercept) {
- CacheLazyEntry e = new CacheLazyEntry(ctx,
entry.key(), invokeEntry.key(), old, oldVal, req.keepBinary());
+ CacheLazyEntry e = new CacheLazyEntry(ctx,
entry.key(), invokeEntry.key(), old, oldVal,
+ req.keepBinaryInInterceptor());
IgniteBiTuple<Boolean, ?> interceptorRes =
ctx.config().getInterceptor().onBeforeRemove(e);
@@ -2297,7 +2302,8 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
}
else {
if (intercept) {
- CacheLazyEntry e = new CacheLazyEntry(ctx,
entry.key(), invokeEntry.key(), old, oldVal, req.keepBinary());
+ CacheLazyEntry e = new CacheLazyEntry(ctx,
entry.key(), invokeEntry.key(), old, oldVal,
+ req.keepBinaryInInterceptor());
Object val =
ctx.config().getInterceptor().onBeforePut(e, updatedVal);
@@ -2364,15 +2370,17 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
null,
req.keepBinary());
+ boolean unwrapVal = req.keepBinaryInInterceptor();
+
Object val = ctx.config().getInterceptor().onBeforePut(
new CacheLazyEntry(
ctx,
entry.key(),
old,
- req.keepBinary()),
+ unwrapVal),
ctx.unwrapBinaryIfNeeded(
updated,
- req.keepBinary(),
+ unwrapVal,
false,
null));
@@ -2580,6 +2588,7 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
!req.skipStore() && !req.skipReadThrough(),
sndPrevVal || req.returnValue(),
req.keepBinary(),
+ req.keepBinaryInInterceptor(),
expiry,
/*event*/true,
/*metrics*/true,
@@ -2865,6 +2874,7 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
/*read-through*/false,
/*retval*/sndPrevVal,
req.keepBinary(),
+ req.keepBinaryInInterceptor(),
expiry,
/*event*/true,
/*metrics*/true,
@@ -3174,7 +3184,8 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
req.keepBinary(),
req.recovery(),
MAX_RETRIES,
- opCtx == null ? null : opCtx.applicationAttributes());
+ opCtx == null ? null : opCtx.applicationAttributes(),
+ req.keepBinaryInInterceptor());
updateFut.map();
}
@@ -3336,6 +3347,7 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
/*read-through*/false,
/*retval*/false,
req.keepBinary(),
+ req.keepBinaryInInterceptor(),
/*expiry policy*/null,
/*event*/true,
/*metrics*/true,
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
index f212c95b8a3..d93b5f790de 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
@@ -91,6 +91,7 @@ class GridDhtAtomicSingleUpdateFuture extends
GridDhtAtomicAbstractUpdateFuture
topVer,
updateReq.taskNameHash(),
updateReq.keepBinary(),
+ updateReq.keepBinaryInInterceptor(),
updateReq.skipStore(),
readRepairRecovery);
}
@@ -104,6 +105,7 @@ class GridDhtAtomicSingleUpdateFuture extends
GridDhtAtomicAbstractUpdateFuture
updateReq.taskNameHash(),
null,
updateReq.keepBinary(),
+ updateReq.keepBinaryInInterceptor(),
updateReq.skipStore(),
false,
readRepairRecovery);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
index 20aad2f7dec..59988a5610e 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
@@ -76,6 +76,7 @@ public class GridDhtAtomicSingleUpdateRequest extends
GridDhtAtomicAbstractUpdat
* @param topVer Topology version.
* @param taskNameHash Task name hash code.
* @param keepBinary Keep binary flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param skipStore Skip store flag.
* @param readRepairRecovery Recovery on Read Repair flag.
*/
@@ -87,6 +88,7 @@ public class GridDhtAtomicSingleUpdateRequest extends
GridDhtAtomicAbstractUpdat
@NotNull AffinityTopologyVersion topVer,
int taskNameHash,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean skipStore,
boolean readRepairRecovery
) {
@@ -97,6 +99,7 @@ public class GridDhtAtomicSingleUpdateRequest extends
GridDhtAtomicAbstractUpdat
topVer,
taskNameHash,
keepBinary,
+ keepBinaryInInterceptor,
skipStore,
readRepairRecovery);
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index a2814d0a9ad..697c12dd24f 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -89,6 +89,7 @@ class GridDhtAtomicUpdateFuture extends
GridDhtAtomicAbstractUpdateFuture {
updateReq.taskNameHash(),
null,
updateReq.keepBinary(),
+ updateReq.keepBinaryInInterceptor(),
updateReq.skipStore(),
false,
readRepairRecovery);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 4d06d1705da..4f292290f62 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -140,6 +140,7 @@ public class GridDhtAtomicUpdateRequest extends
GridDhtAtomicAbstractUpdateReque
* @param topVer Topology version.
* @param keepBinary Keep binary flag.
* @param skipStore Skip store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param forceTransformBackups Force transform backups flag.
* @param taskNameHash Task name hash code.
* @param readRepairRecovery Recovery on Read Repair flag.
@@ -153,6 +154,7 @@ public class GridDhtAtomicUpdateRequest extends
GridDhtAtomicAbstractUpdateReque
int taskNameHash,
Object[] invokeArgs,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean skipStore,
boolean forceTransformBackups,
boolean readRepairRecovery
@@ -164,6 +166,7 @@ public class GridDhtAtomicUpdateRequest extends
GridDhtAtomicAbstractUpdateReque
topVer,
taskNameHash,
keepBinary,
+ keepBinaryInInterceptor,
skipStore,
readRepairRecovery);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
index a9b194b10e0..47fa5e70a41 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java
@@ -150,6 +150,9 @@ public abstract class GridNearAtomicAbstractUpdateFuture
extends GridCacheFuture
/** Operation result. */
protected GridCacheReturn opRes;
+ /** Handle binary in interceptor operation flag. */
+ protected boolean keepBinaryInInterceptor;
+
/**
* Constructor.
*
@@ -167,6 +170,7 @@ public abstract class GridNearAtomicAbstractUpdateFuture
extends GridCacheFuture
* @param recovery {@code True} if cache operation is called in recovery
mode.
* @param remapCnt Remap count.
* @param appAttrs Application attributes.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
*/
protected GridNearAtomicAbstractUpdateFuture(
GridCacheContext cctx,
@@ -183,7 +187,8 @@ public abstract class GridNearAtomicAbstractUpdateFuture
extends GridCacheFuture
boolean keepBinary,
boolean recovery,
int remapCnt,
- @Nullable Map<String, String> appAttrs
+ @Nullable Map<String, String> appAttrs,
+ boolean keepBinaryInInterceptor
) {
if (log == null) {
msgLog = cctx.shared().atomicMessageLogger();
@@ -209,6 +214,7 @@ public abstract class GridNearAtomicAbstractUpdateFuture
extends GridCacheFuture
this.remapCnt = remapCnt;
this.appAttrs = appAttrs;
+ this.keepBinaryInInterceptor = keepBinaryInInterceptor;
}
/**
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
index 73a75435a59..23d49be7c0f 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateRequest.java
@@ -72,6 +72,9 @@ public abstract class GridNearAtomicAbstractUpdateRequest
extends GridCacheIdMes
/** */
private static final int SKIP_READ_THROUGH_FLAG_MASK = 0x100;
+ /** */
+ private static final int KEEP_BINARY_IN_INTERCEPTOR_FLAG_MASK = 0x200;
+
/** Target node ID. */
protected UUID nodeId;
@@ -152,6 +155,7 @@ public abstract class GridNearAtomicAbstractUpdateRequest
extends GridCacheIdMes
* @param skipStore Skip write-through to a CacheStore flag.
* @param keepBinary Keep binary flag.
* @param recovery Recovery mode flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @return Flags.
*/
static short flags(
@@ -163,7 +167,8 @@ public abstract class GridNearAtomicAbstractUpdateRequest
extends GridCacheIdMes
boolean skipStore,
boolean keepBinary,
boolean recovery,
- boolean skipReadThrough
+ boolean skipReadThrough,
+ boolean keepBinaryInInterceptor
) {
short flags = 0;
@@ -194,6 +199,9 @@ public abstract class GridNearAtomicAbstractUpdateRequest
extends GridCacheIdMes
if (skipReadThrough)
flags |= SKIP_READ_THROUGH_FLAG_MASK;
+ if (keepBinaryInInterceptor)
+ flags |= KEEP_BINARY_IN_INTERCEPTOR_FLAG_MASK;
+
return flags;
}
@@ -356,6 +364,11 @@ public abstract class GridNearAtomicAbstractUpdateRequest
extends GridCacheIdMes
return isFlag(SKIP_READ_THROUGH_FLAG_MASK);
}
+ /** */
+ public final boolean keepBinaryInInterceptor() {
+ return isFlag(KEEP_BINARY_IN_INTERCEPTOR_FLAG_MASK);
+ }
+
/**
* @return Keep binary flag.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
index e4ea94e5c80..cdbb251d049 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
@@ -82,6 +82,7 @@ public class GridNearAtomicSingleUpdateFuture extends
GridNearAtomicAbstractUpda
* @param keepBinary Keep binary flag.
* @param recovery {@code True} if cache operation is called in recovery
mode.
* @param remapCnt Maximum number of retries.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
*/
public GridNearAtomicSingleUpdateFuture(
GridCacheContext cctx,
@@ -100,7 +101,8 @@ public class GridNearAtomicSingleUpdateFuture extends
GridNearAtomicAbstractUpda
boolean keepBinary,
boolean recovery,
int remapCnt,
- @Nullable Map<String, String> appAttrs
+ @Nullable Map<String, String> appAttrs,
+ boolean keepBinaryInInterceptor
) {
super(cctx,
cache,
@@ -116,7 +118,8 @@ public class GridNearAtomicSingleUpdateFuture extends
GridNearAtomicAbstractUpda
keepBinary,
recovery,
remapCnt,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
this.key = key;
this.val = val;
}
@@ -553,7 +556,8 @@ public class GridNearAtomicSingleUpdateFuture extends
GridNearAtomicAbstractUpda
skipStore,
keepBinary,
recovery,
- skipReadThrough);
+ skipReadThrough,
+ keepBinaryInInterceptor);
if (canUseSingleRequest()) {
if (op == TRANSFORM) {
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 9a062e60fc7..a0714a324c9 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -111,6 +111,7 @@ public class GridNearAtomicUpdateFuture extends
GridNearAtomicAbstractUpdateFutu
* @param keepBinary Keep binary flag.
* @param remapCnt Maximum number of retries.
* @param appAttrs Application attributes.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
*/
public GridNearAtomicUpdateFuture(
GridCacheContext cctx,
@@ -131,7 +132,8 @@ public class GridNearAtomicUpdateFuture extends
GridNearAtomicAbstractUpdateFutu
boolean keepBinary,
boolean recovery,
int remapCnt,
- @Nullable Map<String, String> appAttrs
+ @Nullable Map<String, String> appAttrs,
+ boolean keepBinaryInInterceptor
) {
super(
cctx,
@@ -148,7 +150,8 @@ public class GridNearAtomicUpdateFuture extends
GridNearAtomicAbstractUpdateFutu
keepBinary,
recovery,
remapCnt,
- appAttrs);
+ appAttrs,
+ keepBinaryInInterceptor);
assert vals == null || vals.size() == keys.size();
assert conflictPutVals == null || conflictPutVals.size() ==
keys.size();
@@ -1001,7 +1004,8 @@ public class GridNearAtomicUpdateFuture extends
GridNearAtomicAbstractUpdateFutu
skipStore,
keepBinary,
recovery,
- skipReadThrough);
+ skipReadThrough,
+ keepBinaryInInterceptor);
GridNearAtomicFullUpdateRequest req = new
GridNearAtomicFullUpdateRequest(
cctx.cacheId(),
@@ -1114,7 +1118,8 @@ public class GridNearAtomicUpdateFuture extends
GridNearAtomicAbstractUpdateFutu
skipStore,
keepBinary,
recovery,
- skipReadThrough);
+ skipReadThrough,
+ keepBinaryInInterceptor);
GridNearAtomicFullUpdateRequest req = new
GridNearAtomicFullUpdateRequest(
cctx.cacheId(),
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index 9109e5b49a5..af7f997899e 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -205,6 +205,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
false,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
recovery,
readRepairStrategy,
needVer);
@@ -308,6 +309,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
false,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
recovery,
readRepairStrategy,
needVer);
@@ -661,6 +663,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
accessTtl,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.recovery());
@@ -903,6 +906,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
* @param accessTtl TTL for read operation.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @return Lock future.
*/
IgniteInternalFuture<Exception> lockAllAsync(
@@ -919,6 +923,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
final long accessTtl,
final boolean skipStore,
final boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
final boolean keepBinary
) {
assert keys != null;
@@ -944,6 +949,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
}
else {
@@ -966,6 +972,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
}
}
@@ -986,6 +993,8 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
* @param createTtl TTL for create operation.
* @param accessTtl TTL for read operation.
* @param skipStore Skip store flag.
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @return Lock future.
*/
private IgniteInternalFuture<Exception> lockAllAsync0(
@@ -1002,6 +1011,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
final long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary) {
int cnt = keys.size();
@@ -1020,6 +1030,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
// Add before mapping.
@@ -1089,6 +1100,7 @@ public class GridDhtColocatedCache<K, V> extends
GridDhtTransactionalCacheAdapte
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
return new GridDhtEmbeddedFuture<>(
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 76690dd06d8..1e322d8cb56 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -170,6 +170,9 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
/** Skip read-through cache store flag. */
private final boolean skipReadThrough;
+ /** Handle binary in interceptor operation flag. */
+ private final boolean keepBinaryInInterceptor;
+
/** */
private Deque<GridNearLockMapping> mappings;
@@ -198,6 +201,8 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
* @param createTtl TTL for create operation.
* @param accessTtl TTL for read operation.
* @param skipStore Skip store flag.
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
*/
public GridDhtColocatedLockFuture(
GridCacheContext<?, ?> cctx,
@@ -210,6 +215,7 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary,
boolean recovery
) {
@@ -229,6 +235,7 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
this.skipReadThrough = skipReadThrough;
this.keepBinary = keepBinary;
this.recovery = recovery;
+ this.keepBinaryInInterceptor = keepBinaryInInterceptor;
ignoreInterrupts();
@@ -990,8 +997,6 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
if (log.isDebugEnabled())
log.debug("Starting (re)map for mappings [mappings=" +
mappings + ", fut=" + this + ']');
- boolean hasRmtNodes = false;
-
boolean first = true;
// Create mini futures.
@@ -1086,6 +1091,7 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
read ? accessTtl : -1L,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
clientFirst,
false,
@@ -1128,11 +1134,8 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
}
}
- if (!distributedKeys.isEmpty()) {
+ if (!distributedKeys.isEmpty())
mapping.distributedKeys(distributedKeys);
-
- hasRmtNodes |= !mapping.node().isLocal();
- }
else {
assert mapping.request() == null;
@@ -1259,6 +1262,7 @@ public final class GridDhtColocatedLockFuture extends
GridCacheCompoundIdentityF
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
// Add new future.
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 0fb4f1b5372..0a9b5a7c658 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -206,6 +206,7 @@ public class GridNearAtomicCache<K, V> extends
GridNearCacheAdapter<K, V> {
ttl,
expireTime,
req.keepBinary(),
+ req.keepBinaryInInterceptor(),
req.nodeId(),
taskName,
req.operation() == TRANSFORM);
@@ -234,6 +235,7 @@ public class GridNearAtomicCache<K, V> extends
GridNearCacheAdapter<K, V> {
long ttl,
long expireTime,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
UUID nodeId,
String taskName,
boolean transformedValue) throws IgniteCheckedException {
@@ -259,6 +261,7 @@ public class GridNearAtomicCache<K, V> extends
GridNearCacheAdapter<K, V> {
/*read-through*/false,
/*retval*/false,
keepBinary,
+ keepBinaryInInterceptor,
/*expiry policy*/null,
/*event*/true,
/*metrics*/true,
@@ -363,6 +366,7 @@ public class GridNearAtomicCache<K, V> extends
GridNearCacheAdapter<K, V> {
/*read-through*/false,
/*retval*/false,
req.keepBinary(),
+ req.keepBinaryInInterceptor(),
null,
/*event*/true,
/*metrics*/true,
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 6a5df13cd5a..a5db4ea3e61 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -160,6 +160,9 @@ public final class GridNearLockFuture extends
GridCacheCompoundIdentityFuture<Bo
/** Skip read-through cache store flag. */
private final boolean skipReadThrough;
+ /** Handle binary in interceptor operation flag. */
+ private final boolean keepBinaryInInterceptor;
+
/** Mappings to proceed. */
@GridToStringExclude
private Queue<GridNearLockMapping> mappings;
@@ -183,6 +186,8 @@ public final class GridNearLockFuture extends
GridCacheCompoundIdentityFuture<Bo
* @param createTtl TTL for create operation.
* @param accessTtl TTL for read operation.
* @param skipStore skipStore
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param keepBinary Keep binary flag.
* @param recovery Recovery flag.
*/
@@ -197,6 +202,7 @@ public final class GridNearLockFuture extends
GridCacheCompoundIdentityFuture<Bo
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary,
boolean recovery
) {
@@ -215,6 +221,7 @@ public final class GridNearLockFuture extends
GridCacheCompoundIdentityFuture<Bo
this.accessTtl = accessTtl;
this.skipStore = skipStore;
this.skipReadThrough = skipReadThrough;
+ this.keepBinaryInInterceptor = keepBinaryInInterceptor;
this.keepBinary = keepBinary;
this.recovery = recovery;
@@ -1070,6 +1077,7 @@ public final class GridNearLockFuture extends
GridCacheCompoundIdentityFuture<Bo
read ? accessTtl : -1L,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
clientFirst,
true,
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
index a6f63d13122..c976f22df27 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -104,6 +104,7 @@ public class GridNearLockRequest extends
GridDistributedLockRequest {
* @param syncCommit Synchronous commit flag.
* @param taskNameHash Task name hash code.
* @param createTtl TTL for create operation.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param accessTtl TTL for read operation.
* @param skipStore Skip store flag.
* @param firstClientReq {@code True} if first lock request for lock
operation sent from client node.
@@ -130,6 +131,7 @@ public class GridNearLockRequest extends
GridDistributedLockRequest {
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary,
boolean firstClientReq,
boolean nearCache,
@@ -151,6 +153,7 @@ public class GridNearLockRequest extends
GridDistributedLockRequest {
txSize,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
assert topVer.compareTo(AffinityTopologyVersion.ZERO) > 0;
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 72c4f540b7a..b4cd4cfe2e6 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -495,7 +495,7 @@ public class GridNearOptimisticTxPrepareFuture extends
GridNearOptimisticTxPrepa
}
/**
- * Continues prepare after previous mapping successfully finished.
+ * Continues to prepare after previous mapping successfully finished.
*
* @param m Mapping.
* @param mappings Queue of mappings.
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index e6b26780659..7a631f090e3 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -133,6 +133,7 @@ public class GridNearTransactionalCache<K, V> extends
GridNearCacheAdapter<K, V>
final boolean skipStore = opCtx != null && opCtx.skipStore();
final boolean skipReadThrough = opCtx != null &&
opCtx.skipReadThrough();
+ boolean keepBinaryInInterceptor = opCtx != null &&
opCtx.isKeepBinaryInInterceptor();
if (tx != null && !tx.implicit() && !skipTx) {
return asyncOp(tx, new AsyncOp<Map<K, V>>(keys) {
@@ -145,6 +146,7 @@ public class GridNearTransactionalCache<K, V> extends
GridNearCacheAdapter<K, V>
false,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
recovery,
readRepairStrategy,
needVer);
@@ -307,6 +309,7 @@ public class GridNearTransactionalCache<K, V> extends
GridNearCacheAdapter<K, V>
accessTtl,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.recovery());
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index 04183f5c454..acd858e10f6 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -623,6 +623,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter
implements GridTimeou
ret,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
keepBinary,
opCtx != null && opCtx.recovery(),
dataCenterId);
@@ -799,6 +800,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter
implements GridTimeou
null,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
false,
keepBinary,
opCtx != null && opCtx.recovery(),
@@ -899,6 +901,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter
implements GridTimeou
* @param ret Return value.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param recovery Recovery flag.
* @param dataCenterId Optional data center Id.
* @return Future for entry values loading.
@@ -916,6 +919,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter
implements GridTimeou
final GridCacheReturn ret,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary,
boolean recovery,
Byte dataCenterId) {
@@ -954,6 +958,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter
implements GridTimeou
/*enlisted*/null,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
false,
hasFilters,
needVal,
@@ -1021,6 +1026,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
* @param drRmvMap DR remove map (optional).
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param singleRmv {@code True} for single key remove operation ({@link
Cache#remove(Object)}.
* @param keepBinary Keep binary flag.
* @param recovery Recovery flag.
@@ -1043,6 +1049,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
@Nullable Map<KeyCacheObject, GridCacheVersion> drRmvMap,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
final boolean singleRmv,
final boolean keepBinary,
final boolean recovery,
@@ -1148,6 +1155,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
enlisted,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
singleRmv,
hasFilters,
needVal,
@@ -1220,6 +1228,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
* @param enlisted Enlisted keys collection.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param singleRmv {@code True} for single remove operation.
* @param hasFilters {@code True} if filters not empty.
* @param needVal {@code True} if value is needed.
@@ -1243,6 +1252,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
@Nullable final Collection<KeyCacheObject> enlisted,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean singleRmv,
boolean hasFilters,
final boolean needVal,
@@ -1363,6 +1373,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
drVer,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
CU.isNearEnabled(cacheCtx));
}
@@ -1380,6 +1391,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
null,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
CU.isNearEnabled(cacheCtx));
}
@@ -1417,6 +1429,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
drVer,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
CU.isNearEnabled(cacheCtx));
@@ -1537,6 +1550,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
drVer,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
CU.isNearEnabled(cacheCtx));
@@ -1689,6 +1703,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
drMap,
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.skipReadThrough(),
+ opCtx != null && opCtx.isKeepBinaryInInterceptor(),
singleRmv,
keepBinary,
opCtx != null && opCtx.recovery(),
@@ -1825,6 +1840,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
* @param keepCacheObjects Keep cache objects
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param readRepairStrategy Read Repair strategy.
* @return Future for this get.
*/
@@ -1838,6 +1854,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
final boolean keepCacheObjects,
final boolean skipStore,
final boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
final boolean recovery,
final ReadRepairStrategy readRepairStrategy,
final boolean needVer) {
@@ -1881,6 +1898,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
keepCacheObjects,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
recovery,
readRepairStrategy,
needVer);
@@ -2069,6 +2087,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
null,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
!deserializeBinary,
recovery,
null);
@@ -2203,6 +2222,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
* @param keepCacheObjects Keep cache objects flag.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param recovery Recovery flag.
* @return Enlisted keys.
* @throws IgniteCheckedException If failed.
@@ -2221,6 +2241,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
boolean keepCacheObjects,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean recovery,
ReadRepairStrategy readRepairStrategy,
final boolean needVer
@@ -2469,6 +2490,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
null,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
!deserializeBinary,
CU.isNearEnabled(cacheCtx));
@@ -4199,6 +4221,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
* @param <K> Key type.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param keepBinary Keep binary flag.
* @return Future with respond.
*/
@@ -4210,6 +4233,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
long accessTtl,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary) {
assert pessimistic();
@@ -4246,6 +4270,7 @@ public class GridNearTxLocal extends
GridDhtTxLocalAdapter implements GridTimeou
accessTtl,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary);
return new GridEmbeddedFuture<>(
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index c4f024b2d25..3139e9d8db0 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -93,6 +93,9 @@ public class IgniteTxEntry implements GridPeerDeployAware,
Message {
/** Skip read-through cache store flag bit mask. */
private static final int TX_ENTRY_SKIP_READ_THROUGH_FLAG_MASK = 1 << 5;
+ /** Handle binary in interceptor operation bit mask. */
+ private static final int KEEP_BINARY_INTERCEPTOR_FLAG_MASK = 1 << 6;
+
/** Prepared flag updater. */
private static final AtomicIntegerFieldUpdater<IgniteTxEntry> PREPARED_UPD
=
AtomicIntegerFieldUpdater.newUpdater(IgniteTxEntry.class, "prepared");
@@ -280,6 +283,7 @@ public class IgniteTxEntry implements GridPeerDeployAware,
Message {
* @param conflictVer Data center replication version.
* @param skipStore Skip store flag.
* @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @param addReader Add reader flag.
*/
public IgniteTxEntry(GridCacheContext<?, ?> ctx,
@@ -294,6 +298,7 @@ public class IgniteTxEntry implements GridPeerDeployAware,
Message {
GridCacheVersion conflictVer,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary,
boolean addReader
) {
@@ -312,6 +317,7 @@ public class IgniteTxEntry implements GridPeerDeployAware,
Message {
skipStore(skipStore);
skipReadThrough(skipReadThrough);
+ keepBinaryInInterceptor(keepBinaryInInterceptor);
keepBinary(keepBinary);
addReader(addReader);
@@ -618,12 +624,26 @@ public class IgniteTxEntry implements
GridPeerDeployAware, Message {
}
/**
- * @return Skip store flag.
+ * @return Skip read through flag.
*/
public boolean skipReadThrough() {
return isFlag(TX_ENTRY_SKIP_READ_THROUGH_FLAG_MASK);
}
+ /**
+ * @param handleBinary Handle binary in interceptor flag.
+ */
+ public void keepBinaryInInterceptor(boolean handleBinary) {
+ setFlag(handleBinary, KEEP_BINARY_INTERCEPTOR_FLAG_MASK);
+ }
+
+ /**
+ * @return Handle binary in interceptor operation flag.
+ */
+ public boolean keepBinaryInInterceptor() {
+ return isFlag(KEEP_BINARY_INTERCEPTOR_FLAG_MASK);
+ }
+
/**
* @param oldValOnPrimary {@code True} If old value for was non null on
primary node.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index bf2ea8938c2..cbb73652e03 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -693,6 +693,7 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
evt,
metrics,
txEntry.keepBinary(),
+ txEntry.keepBinaryInInterceptor(),
txEntry.hasOldValue(),
txEntry.oldValue(),
topVer,
@@ -725,6 +726,7 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
false,
metrics0,
txEntry.keepBinary(),
+
txEntry.keepBinaryInInterceptor(),
txEntry.hasOldValue(),
txEntry.oldValue(),
topVer,
@@ -746,6 +748,7 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
evt,
metrics,
txEntry.keepBinary(),
+ txEntry.keepBinaryInInterceptor(),
txEntry.hasOldValue(),
txEntry.oldValue(),
topVer,
@@ -773,6 +776,7 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
false,
metrics0,
txEntry.keepBinary(),
+
txEntry.keepBinaryInInterceptor(),
txEntry.hasOldValue(),
txEntry.oldValue(),
topVer,
@@ -1338,6 +1342,8 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
* @param drExpireTime DR expire time (if any).
* @param drVer DR version.
* @param skipStore Skip store flag.
+ * @param skipReadThrough Skip read-through cache store flag.
+ * @param keepBinaryInInterceptor Handle binary in interceptor operation
flag.
* @return Transaction entry.
*/
public final IgniteTxEntry addEntry(GridCacheOperation op,
@@ -1353,6 +1359,7 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
@Nullable GridCacheVersion drVer,
boolean skipStore,
boolean skipReadThrough,
+ boolean keepBinaryInInterceptor,
boolean keepBinary,
boolean addReader
) {
@@ -1392,9 +1399,10 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
old.cached(entry);
old.filters(filter);
- // Keep old skipStore and keepBinary flags.
+ // Keep old flags.
old.skipStore(skipStore);
old.skipReadThrough(skipReadThrough);
+ old.keepBinaryInInterceptor(keepBinaryInInterceptor);
old.keepBinary(keepBinary);
// Update ttl if specified.
@@ -1426,6 +1434,7 @@ public abstract class IgniteTxLocalAdapter extends
IgniteTxAdapter implements Ig
drVer,
skipStore,
skipReadThrough,
+ keepBinaryInInterceptor,
keepBinary,
addReader);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
index fd144b035c6..0ca9467fbdb 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
@@ -442,7 +442,8 @@ public abstract class GridCacheQueueAdapter<T> extends
AbstractCollection<T> imp
null,
false,
null,
- null)
+ null,
+ false)
: opCtx.keepBinary();
cctx.operationContextPerCall(opCtx);
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index f7a399dfab6..640cd98a8aa 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -448,6 +448,7 @@ public class GridCacheTestEntryEx extends
GridMetadataAwareAdapter implements Gr
boolean evt,
boolean metrics,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean hasOldVal,
@Nullable CacheObject oldVal,
AffinityTopologyVersion topVer,
@@ -457,7 +458,7 @@ public class GridCacheTestEntryEx extends
GridMetadataAwareAdapter implements Gr
String taskName,
@Nullable GridCacheVersion dhtVer,
@Nullable Long updateCntr
- ) throws IgniteCheckedException, GridCacheEntryRemovedException {
+ ) {
rawPut(val, ttl);
return new GridCacheUpdateTxResult(true);
@@ -475,6 +476,7 @@ public class GridCacheTestEntryEx extends
GridMetadataAwareAdapter implements Gr
boolean readThrough,
boolean retval,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
@Nullable IgniteCacheExpiryPolicy expiryPlc,
boolean evt,
boolean metrics,
@@ -493,8 +495,8 @@ public class GridCacheTestEntryEx extends
GridMetadataAwareAdapter implements Gr
@Nullable CacheObject prevVal,
@Nullable Long updateCntr,
@Nullable GridDhtAtomicAbstractUpdateFuture fut,
- boolean transformOp)
- throws IgniteCheckedException, GridCacheEntryRemovedException {
+ boolean transformOp
+ ) {
assert false;
return null;
@@ -509,6 +511,7 @@ public class GridCacheTestEntryEx extends
GridMetadataAwareAdapter implements Gr
boolean evt,
boolean metrics,
boolean keepBinary,
+ boolean keepBinaryInInterceptor,
boolean oldValPresent,
@Nullable CacheObject oldVal,
AffinityTopologyVersion topVer,
@@ -517,7 +520,7 @@ public class GridCacheTestEntryEx extends
GridMetadataAwareAdapter implements Gr
String taskName,
@Nullable GridCacheVersion dhtVer,
@Nullable Long updateCntr
- ) throws IgniteCheckedException, GridCacheEntryRemovedException {
+ ) {
obsoleteVer = ver;
val = null;
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistency/ReadRepairDataGenerator.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistency/ReadRepairDataGenerator.java
index 441fbbcc267..5bd92eca365 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistency/ReadRepairDataGenerator.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/consistency/ReadRepairDataGenerator.java
@@ -372,6 +372,7 @@ public class ReadRepairDataGenerator extends
JUnitAssertAware {
false,
false,
false,
+ false,
null,
false,
false,
@@ -408,6 +409,7 @@ public class ReadRepairDataGenerator extends
JUnitAssertAware {
false,
false,
false,
+ false,
null,
AffinityTopologyVersion.NONE,
GridDrType.DR_NONE,
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java
index 991a89bfd1a..782b67148be 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/IgniteCacheDumpSelf2Test.java
@@ -706,6 +706,7 @@ public class IgniteCacheDumpSelf2Test extends
GridCommonAbstractTest {
false,
false,
false,
+ false,
null,
false,
false,
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/DmlUtils.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/DmlUtils.java
index 95122b2e429..3790c05f4af 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/DmlUtils.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/DmlUtils.java
@@ -555,7 +555,7 @@ public class DmlUtils {
if (opCtx == null)
// Mimics behavior of GridCacheAdapter#keepBinary and
GridCacheProxyImpl#keepBinary
- newOpCtx = new CacheOperationContext(false, false, true, null,
false, null, false, null, null);
+ newOpCtx = new CacheOperationContext(false, false, true, null,
false, null, false, null, null, false);
else if (!opCtx.isKeepBinary())
newOpCtx = opCtx.keepBinary();