Copilot commented on code in PR #13242:
URL: https://github.com/apache/ignite/pull/13242#discussion_r3414669711
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java:
##########
@@ -151,214 +133,291 @@ public CacheOperationContext keepBinary() {
return dataCenterId;
}
- /**
- * @return Skip store.
- */
- public boolean skipStore() {
- return skipStore;
+ /** Context with dataCenterId. */
+ public CacheOperationContext withDataCenterId(Byte dataCenterId) {
+ return builder(this).dataCenterId(dataCenterId).build();
}
/**
- * 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() {
+ return builder(this).recovery(true).build();
}
/**
- * 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 withReadRepairStrategy(ReadRepairStrategy
strategy) {
+ return builder(this).readRepairStrategy(strategy).build();
}
/**
- * @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() {
+ return builder(this).noRetries(true).build();
}
/**
- * @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) {
+ return builder(this).applicationAttributes(attrs).build();
}
/**
- * @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() {
+ return builder(this).skipStore(true).build();
}
/**
- * @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() {
+ return builder(this).skipReadThrough(true).build();
+ }
+
+ /** @return Whether to handle binary in interceptor. */
+ public boolean handleBinaryInInterceptor() {
+ return handleBinaryInInterceptor;
+ }
+
+ /** Context with {@link CacheOperationContext#handleBinaryInInterceptor}
flag. */
+ public CacheOperationContext withHandleBinaryInInterceptor() {
+ return builder(this).handleBinaryInInterceptor(true).build();
Review Comment:
`withHandleBinaryInInterceptor()` sets a new flag in
`CacheOperationContext`, but there is currently no code path that reads this
flag when invoking `CacheInterceptor` callbacks (searching for
`handleBinaryInInterceptor` only finds its definition and setters). As a
result, enabling it has no runtime effect; either wire it into the interceptor
invocation/serialization logic or remove the API until it is supported.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java:
##########
@@ -1642,6 +1642,11 @@ public Iterator<Cache.Entry<K, V>> scanIterator(boolean
keepBinary, @Nullable Ig
*/
public IgniteInternalCache<K, V> withExpiryPolicy(ExpiryPolicy plc);
+ /**
+ * @return Cache with handle binary values during {@link CacheInterceptor}
execution flag.
+ */
+ public IgniteInternalCache<K, V> withHandleBinaryInInterceptor();
Review Comment:
The Javadoc here references `CacheInterceptor` only via import, which
triggers an `UnusedImports` failure. Prefer a fully-qualified link target (and
drop the import) and tighten the wording to describe what the flag actually
does.
--
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]