IGNITE-28773 CacheOperationContext refactoring#13242
Open
zstan wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors CacheOperationContext construction and usage across internal cache projections to reduce constructor/“setter” sprawl and align flag-setting APIs around withX() methods.
Changes:
- Replaces direct
new CacheOperationContext(...)/ mutator-style methods with aCacheOperationContext.builder()+withX()API. - Renames skip-store projection from
setSkipStore(boolean)towithSkipStore()and updates REST handler code paths accordingly. - Adds a new
withHandleBinaryInInterceptor()projection API and propagates it through cache proxies.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/DmlUtils.java | Switches keep-binary context creation to the new builder/with-style API. |
| modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandlerSelfTest.java | Simplifies the local cache proxy used in REST handler tests after projection API changes. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java | Updates REST cache-flag application to use withSkipStore() (conditional) and keep-binary projection. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java | Refactors keep-binary context setup to builder/with-style methods. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java | Updates projection API surface (withSkipStore) and introduces withHandleBinaryInInterceptor(). |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java | Reuses a shared default CacheOperationContext instance instead of allocating new defaults. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java | Reworks projection methods to build new immutable contexts via builder/with-style calls; adds interceptor-binary projection plumbing. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java | Updates adapter-level projection creation to use builder/with-style contexts and adds new projection API. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GatewayProtectedCacheProxy.java | Migrates to new CacheOperationContext “with” methods and extends keep-binary to also set the interceptor-binary flag. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java | Replaces hasDataCenterId() checks with dataCenterId() != null. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicAbstractUpdateFuture.java | Uses builder-based context creation for application attributes. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java | Uses builder-based context creation for application attributes and updates data center ID checks. |
| modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java | Introduces immutable builder-based CacheOperationContext, shared default instance, and new interceptor-binary flag. |
Comments suppressed due to low confidence (1)
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java:24
- Unused imports
java.util.Collectionsandjava.util.HashMapwill fail the repository's CheckstyleUnusedImportsrule; they are no longer referenced after the refactor and should be removed.
import java.io.Serial;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /** Read-repair strategy. */ | ||
| private final ReadRepairStrategy readRepairStrategy; | ||
| /** Read-repair strategy.*/ |
Contributor
There was a problem hiding this comment.
Space before end of the comment
| keepBinaryInInterceptor); | ||
| /** Context with read repair strategy. */ | ||
| public CacheOperationContext withReadRepairStrategy(ReadRepairStrategy strategy) { | ||
| if (readRepairStrategy() != null && readRepairStrategy() == strategy) |
Contributor
There was a problem hiding this comment.
Condition readRepairStrategy() != null is redundant
Comment on lines
+260
to
+267
| if (opCtx != null) { | ||
| if (opCtx.skipStore()) | ||
| return this; | ||
| else | ||
| newOpCtx = opCtx.withSkipStore(); | ||
| } | ||
| else | ||
| newOpCtx = CacheOperationContext.builder().skipStore(true).build(); |
Contributor
There was a problem hiding this comment.
newOpCtx = CacheOperationContext.of(opCtx).withSkipStore();
return newOpCtx == opCtx ? this : new GridCacheProxyImpl<>(ctx, delegate, newOpCtx);
alex-plekhanov
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.