Copilot commented on code in PR #13215:
URL: https://github.com/apache/ignite/pull/13215#discussion_r3362818997
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java:
##########
@@ -151,214 +129,272 @@ public CacheOperationContext keepBinary() {
return dataCenterId;
}
- /**
- * @return Skip store.
- */
- public boolean skipStore() {
- return skipStore;
+ /** Context with dataCenterId. */
+ public CacheOperationContext dataCenterId(Byte dataCenterId) {
+ this.dataCenterId = dataCenterId;
+ return this;
}
/**
- * See {@link IgniteInternalCache#setSkipStore(boolean)}.
- *
- * @param skipStore Skip store flag.
- * @return New instance of CacheOperationContext with skip store flag.
+ * @return Partition recover flag.
*/
- public CacheOperationContext setSkipStore(boolean skipStore) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ public boolean recovery() {
+ return recovery;
}
- /** @return Skip read-through cache store. */
- public boolean skipReadThrough() {
- return skipReadThrough;
+ /** Context with recovery flag. */
+ public CacheOperationContext withRecovery() {
+ recovery = true;
+ return this;
}
/**
- * See {@link IgniteInternalCache#withApplicationAttributes(Map)}.
- *
- * @return New instance of CacheOperationContext with new application
attributes.
+ * @return Read Repair strategy.
*/
- public CacheOperationContext withApplicationAttributes(Map<String, String>
attrs) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- Collections.unmodifiableMap(attrs));
+ @Nullable public ReadRepairStrategy readRepairStrategy() {
+ return readRepairStrategy;
}
- /**
- * See {@link IgniteInternalCache#withSkipReadThrough()}.
- *
- * @return New instance of CacheOperationContext with skip store flag.
- */
- public CacheOperationContext withSkipReadThrough() {
- return new CacheOperationContext(
- skipStore,
- true,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with read repair strategy. */
+ public CacheOperationContext readRepairStrategy(ReadRepairStrategy
strategy) {
+ readRepairStrategy = strategy;
+ return this;
}
/**
- * @return {@link ExpiryPolicy} associated with this projection.
+ * @return No retries flag.
*/
- @Nullable public ExpiryPolicy expiry() {
- return expiryPlc;
+ public boolean noRetries() {
+ return noRetries;
}
- /**
- * See {@link IgniteInternalCache#withExpiryPolicy(ExpiryPolicy)}.
- *
- * @param plc {@link ExpiryPolicy} to associate with this projection.
- * @return New instance of CacheOperationContext with skip store flag.
- */
- public CacheOperationContext withExpiryPolicy(ExpiryPolicy plc) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- plc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with noRetries flag. */
+ public CacheOperationContext withNoRetries() {
+ noRetries = true;
+ return this;
}
/**
- * @param noRetries No retries flag.
- * @return Operation context.
+ * @return Application attributes.
*/
- public CacheOperationContext setNoRetries(boolean noRetries) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ @Nullable public Map<String, String> applicationAttributes() {
+ return appAttrs;
}
- /**
- * @param dataCenterId Data center id.
- * @return Operation context.
- */
- public CacheOperationContext setDataCenterId(byte dataCenterId) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with application attributes. */
+ public CacheOperationContext withApplicationAttributes(Map<String, String>
attrs) {
+ appAttrs = Collections.unmodifiableMap(attrs);
+ return this;
}
/**
- * @param recovery Recovery flag.
- * @return New instance of CacheOperationContext with recovery flag.
+ * @return Skip store.
*/
- public CacheOperationContext setRecovery(boolean recovery) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ public boolean skipStore() {
+ return skipStore;
}
- /**
- * @param readRepairStrategy Read Repair strategy.
- * @return New instance of CacheOperationContext with Read Repair flag.
- */
- public CacheOperationContext setReadRepairStrategy(ReadRepairStrategy
readRepairStrategy) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with skipStore flag. */
+ public CacheOperationContext withSkipStore() {
+ skipStore = true;
+ return this;
}
/**
- * @param appAttrs Application attributes.
- * @return New instance of CacheOperationContext with application
attributes.
+ * @return Skip read-through cache store.
*/
- public CacheOperationContext setApplicationAttributes(Map<String, String>
appAttrs) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- new HashMap<>(appAttrs));
+ public boolean skipReadThrough() {
+ return skipReadThrough;
}
- /**
- * @return Partition recover flag.
- */
- public boolean recovery() {
- return recovery;
+ /** Context with {@link CacheOperationContext#skipReadThrough} flag. */
+ public CacheOperationContext withSkipReadThrough() {
+ skipReadThrough = true;
+ return this;
}
- /**
- * @return Read Repair strategy.
- */
- public ReadRepairStrategy readRepairStrategy() {
- return readRepairStrategy;
+ /** @return Calcite engine execution flag. */
+ public boolean calciteEngine() {
+ return calciteEngineCall;
}
- /**
- * @return No retries flag.
- */
- public boolean noRetries() {
- return noRetries;
+ /** Context with {@link CacheOperationContext#keepBinary} flag. */
+ public CacheOperationContext withCalciteEngine() {
+ calciteEngineCall = true;
+ return this;
}
/**
- * @return Application attributes.
+ * @return {@link ExpiryPolicy} associated with this projection.
*/
- public Map<String, String> applicationAttributes() {
- return appAttrs;
+ @Nullable public ExpiryPolicy expiry() {
+ return expiryPlc;
+ }
+
+ /** Context with {@link CacheOperationContext#expiryPlc}. */
+ public CacheOperationContext withExpiryPolicy(ExpiryPolicy plc) {
+ expiryPlc = plc;
+ return this;
}
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(CacheOperationContext.class, this);
}
+
+ /**
+ * Creates the builder for cache operations context.
+ *
+ * @return Builder for cache operations context.
+ */
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /** Cache operations context builder. */
+ public static class Builder {
+ /** Skip store. */
+ @GridToStringInclude
+ private boolean skipStore;
+
+ /** Skip read through. */
+ @GridToStringInclude
+ private boolean skipReadThrough;
+
+ /** No retries flag. */
+ @GridToStringInclude
+ private boolean noRetries;
+
+ /** Recovery flag. */
+ private boolean recovery;
+
+ /** Read-repair strategy. */
+ private ReadRepairStrategy readRepairStrategy;
+
+ /** Keep binary flag. */
+ private boolean keepBinary;
+
+ /** Expiry policy. */
+ private ExpiryPolicy expiryPlc;
+
+ /** Data center Id. */
+ private Byte dataCenterId;
+
+ /** Application attributes. */
+ private Map<String, String> appAttrs;
+
+ /** Calcite engine execution flag. */
+ private boolean calciteEngine;
+
+ /**
+ * CacheOperationContext with keepBinary flag.
+ *
+ * @see IgniteInternalCache#keepBinary()
+ */
+ public Builder keepBinary(boolean keepBinary) {
+ this.keepBinary = keepBinary;
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with skipStore flag.
+ *
+ * @see IgniteInternalCache#skipStore()
+ */
+ public Builder skipStore(boolean skipStore) {
+ this.skipStore = skipStore;
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with attributes.
+ *
+ * @see IgniteInternalCache#withApplicationAttributes(Map)
+ */
+ public Builder applicationAttributes(Map<String, String> attrs) {
+ appAttrs = Collections.unmodifiableMap(attrs);
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with skip read through flag.
+ *
+ * @see IgniteInternalCache#withSkipReadThrough()
+ */
+ public Builder skipReadThrough(boolean skipReadThrough) {
+ this.skipReadThrough = skipReadThrough;
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with calcite execution flag.
+ *
+ * @see IgniteInternalCache#withCalciteEngine()
+ */
+ public Builder calciteEngine(boolean calciteEngine) {
+ this.calciteEngine = calciteEngine;
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with expiry policy.
+ *
+ * @see IgniteInternalCache#withExpiryPolicy(ExpiryPolicy)
+ */
+ public Builder expiryPolicy(ExpiryPolicy expiryPlc) {
+ this.expiryPlc = expiryPlc;
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with no retries flag.
+ */
+ public Builder noRetries(boolean noRetries) {
+ this.noRetries = noRetries;
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with Data center id.
+ */
+ public Builder dataCenterId(byte dataCenterId) {
+ this.dataCenterId = dataCenterId;
+ return this;
+ }
+
+ /**
+ * CacheOperationContext with recovery flag.
+ */
+ public Builder dataCenterId(boolean recovery) {
+ this.recovery = recovery;
+ return this;
+ }
Review Comment:
`CacheOperationContext.Builder` has a method named `dataCenterId(boolean
recovery)` that actually sets the `recovery` flag. This is almost certainly a
copy/paste error and makes the builder API misleading (and prevents a correctly
named `recovery(...)` builder method).
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java:
##########
@@ -166,7 +166,7 @@ public void
setCacheManager(org.apache.ignite.cache.CacheManager cacheMgr) {
if (skip)
return this;
- return new GatewayProtectedCacheProxy<>(delegate,
opCtx.setSkipStore(true), lock);
+ return new GatewayProtectedCacheProxy<>(delegate,
opCtx.withSkipStore(), lock);
}
Review Comment:
`CacheOperationContext` is now mutable (`withSkipStore()` mutates and
returns `this`). Here `skipStore()` creates a new `GatewayProtectedCacheProxy`
but passes the same mutated `opCtx` instance, which also mutates the current
proxy’s context. That breaks the usual projection semantics ("return a new
cache instance based on this one") and can introduce races if the same cache
proxy instance is used concurrently across threads.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java:
##########
@@ -251,25 +251,20 @@ public IgniteInternalCache<K, V> delegate() {
}
/** {@inheritDoc} */
- @Override public GridCacheProxyImpl<K, V> setSkipStore(boolean skipStore) {
+ @Override public GridCacheProxyImpl<K, V> withSkipStore() {
CacheOperationContext prev = gate.enter(opCtx);
try {
- if (opCtx != null && opCtx.skipStore() == skipStore)
- return this;
+ if (opCtx != null) {
+ if (opCtx.skipStore())
+ return this;
+ else
+ opCtx.withSkipStore();
+ }
+ else
+ opCtx =
CacheOperationContext.builder().skipStore(true).build();
- return new GridCacheProxyImpl<>(ctx, delegate,
- opCtx != null ? opCtx.setSkipStore(skipStore) :
- new CacheOperationContext(
- skipStore,
- false,
- false,
- null,
- false,
- null,
- false,
- null,
- null));
+ return new GridCacheProxyImpl<>(ctx, delegate, opCtx);
}
Review Comment:
`withSkipStore()` mutates the existing `opCtx` via `opCtx.withSkipStore()`
and then returns a *new* `GridCacheProxyImpl` that reuses the same `opCtx`
instance. This means calling `cache.withSkipStore()` can change the behavior of
the original cache proxy instance as well, and makes the proxy/context state
mutable across threads.
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/PublicApiIntegrationTest.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.calcite.integration;
+
+import java.util.List;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.calcite.CalciteQueryEngineConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+
+import static
org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
+import static
org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
+
+/** Public api integration tests. */
+public class PublicApiIntegrationTest extends AbstractBasicIntegrationTest {
+ /** */
+ @Override protected IgniteConfiguration getConfiguration(String
igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ cfg.setSqlConfiguration(new SqlConfiguration()
+ .setQueryEnginesConfiguration(new
CalciteQueryEngineConfiguration().setDefault(true)));
+
+ return cfg;
+ }
+
+ /** */
+ @Test
+ public void testSimpleInsert() {
+ IgniteCache<Object, Object> cache =
client.createCache(DEFAULT_CACHE_NAME);
+
+ runQuery(0, nodeCount() * 10, false, cache);
+
+ cache = cache.withKeepBinary();
+
+ runQuery(nodeCount() * 10, 2 * nodeCount() * 10, false, cache);
+
+ List<List<?>> res = cache.query(new SqlFieldsQuery("SELECT * FROM
emp")).getAll();
+
+ assertEquals("Unexpected result set size: " + res.size(), 1,
res.size());
+ }
+
+ /** */
+ @Test
+ public void testTxInsert() {
+ CacheConfiguration<Object, Object> ccfg = new
CacheConfiguration<>(DEFAULT_CACHE_NAME);
+ ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+
+ IgniteCache<?, ?> cache = client.createCache(ccfg);
+
+ runQuery(0, nodeCount() * 10, true, cache);
+
+ cache = cache.withKeepBinary();
+
+ runQuery(nodeCount() * 10, 2 * nodeCount() * 10, true, cache);
+
+ List<List<?>> res = cache.query(new SqlFieldsQuery("SELECT * FROM
emp")).getAll();
+
+ assertEquals("Unexpected result set size: " + res.size(), 1,
res.size());
+ }
+
+ /** */
+ private void runQuery(int begin, int end, boolean transactional,
IgniteCache<?, ?> cache) {
+ Transaction tx = null;
+
+ 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" +
(transactional ? ", ATOMICITY=transactional" : "") + "\""));
+
+ if (transactional) {
+ //noinspection resource
+ tx = client.transactions().txStart(PESSIMISTIC, READ_COMMITTED);
+ }
+
+ 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 / 10));
+
+ cache.query(new SqlFieldsQuery("UPDATE emp SET name = '' WHERE
empid = ? AND deptid = ?").setArgs(i, i % 2));
+ cache.query(new SqlFieldsQuery("DELETE FROM emp WHERE empid =
?").setArgs(i - 1)).getAll();
+ }
+
+ if (transactional)
+ tx.commit();
+ }
Review Comment:
`cache.query(new SqlFieldsQuery(...))` cursors for CREATE/INSERT/UPDATE are
created but never consumed/closed (unlike other integration tests that call
`.getAll()`). For DML this can lead to the statement not being fully executed
(depending on cursor semantics) and/or resource leaks during the test run.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java:
##########
@@ -151,214 +129,272 @@ public CacheOperationContext keepBinary() {
return dataCenterId;
}
- /**
- * @return Skip store.
- */
- public boolean skipStore() {
- return skipStore;
+ /** Context with dataCenterId. */
+ public CacheOperationContext dataCenterId(Byte dataCenterId) {
+ this.dataCenterId = dataCenterId;
+ return this;
}
/**
- * See {@link IgniteInternalCache#setSkipStore(boolean)}.
- *
- * @param skipStore Skip store flag.
- * @return New instance of CacheOperationContext with skip store flag.
+ * @return Partition recover flag.
*/
- public CacheOperationContext setSkipStore(boolean skipStore) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ public boolean recovery() {
+ return recovery;
}
- /** @return Skip read-through cache store. */
- public boolean skipReadThrough() {
- return skipReadThrough;
+ /** Context with recovery flag. */
+ public CacheOperationContext withRecovery() {
+ recovery = true;
+ return this;
}
/**
- * See {@link IgniteInternalCache#withApplicationAttributes(Map)}.
- *
- * @return New instance of CacheOperationContext with new application
attributes.
+ * @return Read Repair strategy.
*/
- public CacheOperationContext withApplicationAttributes(Map<String, String>
attrs) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- Collections.unmodifiableMap(attrs));
+ @Nullable public ReadRepairStrategy readRepairStrategy() {
+ return readRepairStrategy;
}
- /**
- * See {@link IgniteInternalCache#withSkipReadThrough()}.
- *
- * @return New instance of CacheOperationContext with skip store flag.
- */
- public CacheOperationContext withSkipReadThrough() {
- return new CacheOperationContext(
- skipStore,
- true,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with read repair strategy. */
+ public CacheOperationContext readRepairStrategy(ReadRepairStrategy
strategy) {
+ readRepairStrategy = strategy;
+ return this;
}
/**
- * @return {@link ExpiryPolicy} associated with this projection.
+ * @return No retries flag.
*/
- @Nullable public ExpiryPolicy expiry() {
- return expiryPlc;
+ public boolean noRetries() {
+ return noRetries;
}
- /**
- * See {@link IgniteInternalCache#withExpiryPolicy(ExpiryPolicy)}.
- *
- * @param plc {@link ExpiryPolicy} to associate with this projection.
- * @return New instance of CacheOperationContext with skip store flag.
- */
- public CacheOperationContext withExpiryPolicy(ExpiryPolicy plc) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- plc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with noRetries flag. */
+ public CacheOperationContext withNoRetries() {
+ noRetries = true;
+ return this;
}
/**
- * @param noRetries No retries flag.
- * @return Operation context.
+ * @return Application attributes.
*/
- public CacheOperationContext setNoRetries(boolean noRetries) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ @Nullable public Map<String, String> applicationAttributes() {
+ return appAttrs;
}
- /**
- * @param dataCenterId Data center id.
- * @return Operation context.
- */
- public CacheOperationContext setDataCenterId(byte dataCenterId) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with application attributes. */
+ public CacheOperationContext withApplicationAttributes(Map<String, String>
attrs) {
+ appAttrs = Collections.unmodifiableMap(attrs);
+ return this;
}
/**
- * @param recovery Recovery flag.
- * @return New instance of CacheOperationContext with recovery flag.
+ * @return Skip store.
*/
- public CacheOperationContext setRecovery(boolean recovery) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ public boolean skipStore() {
+ return skipStore;
}
- /**
- * @param readRepairStrategy Read Repair strategy.
- * @return New instance of CacheOperationContext with Read Repair flag.
- */
- public CacheOperationContext setReadRepairStrategy(ReadRepairStrategy
readRepairStrategy) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- appAttrs);
+ /** Context with skipStore flag. */
+ public CacheOperationContext withSkipStore() {
+ skipStore = true;
+ return this;
}
/**
- * @param appAttrs Application attributes.
- * @return New instance of CacheOperationContext with application
attributes.
+ * @return Skip read-through cache store.
*/
- public CacheOperationContext setApplicationAttributes(Map<String, String>
appAttrs) {
- return new CacheOperationContext(
- skipStore,
- skipReadThrough,
- keepBinary,
- expiryPlc,
- noRetries,
- dataCenterId,
- recovery,
- readRepairStrategy,
- new HashMap<>(appAttrs));
+ public boolean skipReadThrough() {
+ return skipReadThrough;
}
- /**
- * @return Partition recover flag.
- */
- public boolean recovery() {
- return recovery;
+ /** Context with {@link CacheOperationContext#skipReadThrough} flag. */
+ public CacheOperationContext withSkipReadThrough() {
+ skipReadThrough = true;
+ return this;
}
- /**
- * @return Read Repair strategy.
- */
- public ReadRepairStrategy readRepairStrategy() {
- return readRepairStrategy;
+ /** @return Calcite engine execution flag. */
+ public boolean calciteEngine() {
+ return calciteEngineCall;
}
- /**
- * @return No retries flag.
- */
- public boolean noRetries() {
- return noRetries;
+ /** Context with {@link CacheOperationContext#keepBinary} flag. */
+ public CacheOperationContext withCalciteEngine() {
+ calciteEngineCall = true;
+ return this;
}
Review Comment:
Javadoc for `withCalciteEngine()` references the `keepBinary` flag, but the
method actually sets `calciteEngineCall`. This is misleading when reading the
API.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java:
##########
@@ -270,7 +269,7 @@ public interface IgniteInternalCache<K, V> extends
Iterable<Cache.Entry<K, V>> {
*
* @return New internal cache instance for binary objects.
*/
- public <K1, V1> IgniteInternalCache<K1, V1> keepBinary();
+ public IgniteInternalCache<K, V> keepBinary();
Review Comment:
`keepBinary()` now returns `IgniteInternalCache<K, V>` instead of a re-typed
projection (previously `<K1, V1> IgniteInternalCache<K1, V1>`). This reduces
type-safety and also makes the existing Javadoc examples earlier in this
interface incorrect (they still show `IgniteInternalCache<Integer,
GridBinaryObject> prj = ...keepBinary();`).
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java:
##########
@@ -1338,6 +1338,8 @@ protected void checkValid(boolean checkTimeout) throws
IgniteCheckedException {
* @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 calciteOpCall Calcite engine opearation call.
Review Comment:
Typo in Javadoc param description: "opearation" -> "operation".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]