You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Vladsz83 (via GitHub)" <gi...@apache.org> on 2025/10/15 08:03:14 UTC
[PR] IGNITE-26716 : Refactor serialization of CacheEntryPredicateAdapter and CacheEntrySerializablePredicate [ignite]
Vladsz83 opened a new pull request, #12424:
URL: https://github.com/apache/ignite/pull/12424
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26716 : Refactor serialization of CacheEntryPredicateAdapter and CacheEntrySerializablePredicate [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12424:
URL: https://github.com/apache/ignite/pull/12424#issuecomment-3438421813
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12424) **Quality Gate failed**
Failed conditions
 [4 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12424) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12424)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26716 : Refactor serialization of CacheEntryPredicateAdapter and CacheEntrySerializablePredicate [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12424:
URL: https://github.com/apache/ignite/pull/12424#issuecomment-3437493839
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12424) **Quality Gate failed**
Failed conditions
 [4 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12424) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12424)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26716 : Refactor serialization of CacheEntryPredicateAdapter and CacheEntrySerializablePredicate [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja merged PR #12424:
URL: https://github.com/apache/ignite/pull/12424
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26716 : Refactor serialization of CacheEntryPredicateAdapter and CacheEntrySerializablePredicate [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12424:
URL: https://github.com/apache/ignite/pull/12424#discussion_r2456294243
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java:
##########
@@ -50,37 +75,122 @@ public abstract class CacheEntryPredicateAdapter implements CacheEntryPredicate
/** {@inheritDoc} */
@Override public short directType() {
- assert false : this;
+ return 98;
+ }
- return 0;
+ /** */
+ public PredicateType type() {
+ return type;
+ }
+
+ /**
+ * @param entry Entry.
+ * @return Value.
+ */
+ @Nullable protected CacheObject peekVisibleValue(GridCacheEntryEx entry) {
+ return locked ? entry.rawGet() : entry.peekVisibleValue();
}
/** {@inheritDoc} */
- @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
- reader.setBuffer(buf);
+ @Override public boolean apply(GridCacheEntryEx e) {
+ switch (type) {
+ case VALUE: {
+ CacheObject val = peekVisibleValue(e);
+
+ if (this.val == null && val == null)
+ return true;
+
+ if (this.val == null || val == null)
+ return false;
+
+ GridCacheContext<?, ?> cctx = e.context();
- return true;
+ if (this.val instanceof BinaryObject && val instanceof BinaryObject)
+ return Objects.equals(val, this.val);
+
+ Object thisVal = CU.value(this.val, cctx, false);
+ Object cacheVal = CU.value(val, cctx, false);
+
+ if (thisVal.getClass().isArray())
+ return Objects.deepEquals(thisVal, cacheVal);
+
+ return Objects.equals(thisVal, cacheVal);
+ }
+
+ case HAS_VALUE:
+ return peekVisibleValue(e) != null;
+
+ case HAS_NO_VALUE:
+ return peekVisibleValue(e) == null;
+
+ case ALWAYS_FALSE:
+ return false;
+ }
+
+ throw new IllegalStateException("Unknown cache entry predicate type: " + type);
}
/** {@inheritDoc} */
- @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
- writer.setBuffer(buf);
+ @Override public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException {
+ if (type == PredicateType.VALUE)
+ val.finishUnmarshal(ctx.cacheObjectContext(), ldr);
+ }
- if (!writer.isHeaderWritten()) {
- if (!writer.writeHeader(directType()))
- return false;
+ /** {@inheritDoc} */
+ @Override public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException {
+ if (type == PredicateType.VALUE)
+ val.prepareMarshal(ctx.cacheObjectContext());
+ }
+
+ /** */
+ public @Nullable CacheObject val() {
Review Comment:
```suggestion
public @Nullable CacheObject value() {
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-26716 : Refactor serialization of CacheEntryPredicateAdapter and CacheEntrySerializablePredicate [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12424:
URL: https://github.com/apache/ignite/pull/12424#discussion_r2456290382
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java:
##########
@@ -50,37 +75,122 @@ public abstract class CacheEntryPredicateAdapter implements CacheEntryPredicate
/** {@inheritDoc} */
@Override public short directType() {
- assert false : this;
+ return 98;
+ }
- return 0;
+ /** */
+ public PredicateType type() {
+ return type;
+ }
+
+ /**
+ * @param entry Entry.
+ * @return Value.
+ */
+ @Nullable protected CacheObject peekVisibleValue(GridCacheEntryEx entry) {
Review Comment:
```suggestion
@Nullable private CacheObject peekVisibleValue(GridCacheEntryEx entry) {
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org