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/10 11:50:53 UTC
[PR] IGNITE-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Vladsz83 opened a new pull request, #12409:
URL: https://github.com/apache/ignite/pull/12409
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12409:
URL: https://github.com/apache/ignite/pull/12409#discussion_r2435065626
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -75,12 +69,13 @@ public GridNearTxFinishResponse(int part,
this.nearThreadId = nearThreadId;
this.miniId = miniId;
- this.err = err;
+
+ this.errMsg = new ErrorMessage(err);
Review Comment:
```suggestion
errMsg = new ErrorMessage(err);
```
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -79,41 +79,37 @@ public int miniId() {
return miniId;
}
- /**
- * @return Error for check committed backup requests.
- */
- public Throwable checkCommittedError() {
- return checkCommittedErr;
+ /** Sets mini future ID. */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
}
- /**
- * @param checkCommittedErr Error for check committed backup requests.
- */
- public void checkCommittedError(Throwable checkCommittedErr) {
- this.checkCommittedErr = checkCommittedErr;
+ /** @return The check committed error serialization message. */
+ public @Nullable ErrorMessage checkCommittedErrorMessage() {
+ return checkCommittedErrMsg;
}
- /**
- * @return Check committed flag.
- */
- public boolean checkCommitted() {
- return isFlag(CHECK_COMMITTED_FLAG_MASK);
+ /** Sets the check committed error serialization message. */
+ public void checkCommittedErrorMessage(@Nullable ErrorMessage checkCommittedErrMsg) {
+ this.checkCommittedErrMsg = checkCommittedErrMsg;
+ }
+
+ /** Sets the flag indicating if this is a check-committed response. */
+ public void checkCommitted(boolean checkCommited) {
Review Comment:
```suggestion
public void checkCommitted(boolean checkCommitted) {
```
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12409:
URL: https://github.com/apache/ignite/pull/12409#discussion_r2433106726
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -75,12 +69,14 @@ public GridNearTxFinishResponse(int part,
this.nearThreadId = nearThreadId;
this.miniId = miniId;
- this.err = err;
+
+ if (err != null)
Review Comment:
Didn't catch. err is @Nullable.
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12409:
URL: https://github.com/apache/ignite/pull/12409#discussion_r2433126399
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -79,41 +79,53 @@ public int miniId() {
return miniId;
}
+ /** Sets mini future ID. */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Error for check committed backup requests.
*/
- public Throwable checkCommittedError() {
- return checkCommittedErr;
+ @Nullable public Throwable checkCommittedError() {
Review Comment:
Not sure. The error is nullable. checkCommittedErrMsg might be null. Double nulls check. On Throwable too
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12409:
URL: https://github.com/apache/ignite/pull/12409#issuecomment-3411190464
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12409) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12409&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12409&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12409&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12409&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12409&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12409)
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja merged PR #12409:
URL: https://github.com/apache/ignite/pull/12409
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12409:
URL: https://github.com/apache/ignite/pull/12409#discussion_r2432789277
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -79,41 +79,53 @@ public int miniId() {
return miniId;
}
+ /** Sets mini future ID. */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Error for check committed backup requests.
*/
- public Throwable checkCommittedError() {
- return checkCommittedErr;
+ @Nullable public Throwable checkCommittedError() {
+ ErrorMessage checkCommittedErrMsg = this.checkCommittedErrMsg;
+
+ return checkCommittedErrMsg == null ? null : checkCommittedErrMsg.toThrowable();
}
/**
* @param checkCommittedErr Error for check committed backup requests.
*/
- public void checkCommittedError(Throwable checkCommittedErr) {
- this.checkCommittedErr = checkCommittedErr;
+ public void checkCommittedError(@Nullable Throwable checkCommittedErr) {
Review Comment:
Actually, there is only one usage,and there error can not be null.
And alse we can remove this method.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -17,40 +17,40 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
-import java.nio.ByteBuffer;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.GridDirectTransient;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.managers.communication.ErrorMessage;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.processors.cache.GridCacheReturn;
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxFinishResponse;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
+import org.jetbrains.annotations.Nullable;
/**
* DHT transaction finish response.
*/
-public class GridDhtTxFinishResponse extends GridDistributedTxFinishResponse {
- /** Flag indicating if this is a check-committed response. */
- private static final int CHECK_COMMITTED_FLAG_MASK = 0x01;
-
+public final class GridDhtTxFinishResponse extends GridDistributedTxFinishResponse {
/** Mini future ID. */
+ @Order(6)
private int miniId;
/** Error. */
Review Comment:
```suggestion
/** Error message. */
```
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -75,12 +69,14 @@ public GridNearTxFinishResponse(int part,
this.nearThreadId = nearThreadId;
this.miniId = miniId;
- this.err = err;
+
+ if (err != null)
Review Comment:
Redundant check, `ErrorMessage` is `null` safe.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -154,95 +163,15 @@ public GridCacheReturn returnValue() {
return retVal;
}
- /** {@inheritDoc} */
- @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
- writer.setBuffer(buf);
-
- if (!super.writeTo(buf, writer))
- return false;
-
- if (!writer.isHeaderWritten()) {
- if (!writer.writeHeader(directType()))
- return false;
-
- writer.onHeaderWritten();
- }
-
- switch (writer.state()) {
- case 7:
- if (!writer.writeByteArray(checkCommittedErrBytes))
- return false;
-
- writer.incrementState();
-
- case 8:
- if (!writer.writeInt(miniId))
- return false;
-
- writer.incrementState();
-
- case 9:
- if (!writer.writeMessage(retVal))
- return false;
-
- writer.incrementState();
-
- }
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
- reader.setBuffer(buf);
-
- if (!super.readFrom(buf, reader))
- return false;
-
- switch (reader.state()) {
- case 7:
- checkCommittedErrBytes = reader.readByteArray();
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 8:
- miniId = reader.readInt();
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 9:
- retVal = reader.readMessage();
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- }
-
- return true;
- }
-
/** {@inheritDoc} */
@Override public short directType() {
return 33;
}
/** {@inheritDoc} */
@Override public String toString() {
- StringBuilder flags = new StringBuilder();
-
- if (checkCommitted())
- appendFlag(flags, "checkComm");
-
return S.toString(GridDhtTxFinishResponse.class, this,
- "flags", flags.toString(),
+ "chechCommited", checkCommitted,
Review Comment:
```suggestion
"checkCommited", checkCommitted,
```
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -90,102 +86,39 @@ public int miniId() {
return miniId;
}
+ /**
+ * Sets mini future ID.
+ */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Near thread ID.
*/
public long threadId() {
return nearThreadId;
}
- /** {@inheritDoc} */
- @Override public void prepareMarshal(GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException {
- super.prepareMarshal(ctx);
-
- if (err != null && errBytes == null)
- errBytes = U.marshal(ctx, err);
- }
-
- /** {@inheritDoc} */
- @Override public void finishUnmarshal(GridCacheSharedContext<?, ?> ctx, ClassLoader ldr) throws IgniteCheckedException {
- super.finishUnmarshal(ctx, ldr);
-
- if (errBytes != null && err == null)
- err = U.unmarshal(ctx, errBytes, U.resolveClassLoader(ldr, ctx.gridConfig()));
+ /**
+ * Sets near thread ID.
+ */
+ public void threadId(long nearThreadId) {
+ this.nearThreadId = nearThreadId;
}
- /** {@inheritDoc} */
- @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
- writer.setBuffer(buf);
-
- if (!super.writeTo(buf, writer))
- return false;
-
- if (!writer.isHeaderWritten()) {
- if (!writer.writeHeader(directType()))
- return false;
-
- writer.onHeaderWritten();
- }
-
- switch (writer.state()) {
- case 7:
- if (!writer.writeByteArray(errBytes))
- return false;
-
- writer.incrementState();
-
- case 8:
- if (!writer.writeInt(miniId))
- return false;
-
- writer.incrementState();
-
- case 9:
- if (!writer.writeLong(nearThreadId))
- return false;
-
- writer.incrementState();
-
- }
-
- return true;
+ /**
+ * @return Error serialization message.
+ */
+ public @Nullable ErrorMessage errorMessage() {
+ return errMsg;
}
- /** {@inheritDoc} */
- @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
- reader.setBuffer(buf);
-
- if (!super.readFrom(buf, reader))
- return false;
-
- switch (reader.state()) {
- case 7:
- errBytes = reader.readByteArray();
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 8:
- miniId = reader.readInt();
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- case 9:
- nearThreadId = reader.readLong();
-
- if (!reader.isLastRead())
- return false;
-
- reader.incrementState();
-
- }
-
- return true;
+ /**
+ * Sets error serialization message.
Review Comment:
```suggestion
* Sets error message.
```
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -90,102 +86,39 @@ public int miniId() {
return miniId;
}
+ /**
+ * Sets mini future ID.
+ */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Near thread ID.
*/
public long threadId() {
return nearThreadId;
}
- /** {@inheritDoc} */
- @Override public void prepareMarshal(GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException {
- super.prepareMarshal(ctx);
-
- if (err != null && errBytes == null)
- errBytes = U.marshal(ctx, err);
- }
-
- /** {@inheritDoc} */
- @Override public void finishUnmarshal(GridCacheSharedContext<?, ?> ctx, ClassLoader ldr) throws IgniteCheckedException {
- super.finishUnmarshal(ctx, ldr);
-
- if (errBytes != null && err == null)
- err = U.unmarshal(ctx, errBytes, U.resolveClassLoader(ldr, ctx.gridConfig()));
+ /**
+ * Sets near thread ID.
+ */
+ public void threadId(long nearThreadId) {
+ this.nearThreadId = nearThreadId;
}
- /** {@inheritDoc} */
- @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
- writer.setBuffer(buf);
-
- if (!super.writeTo(buf, writer))
- return false;
-
- if (!writer.isHeaderWritten()) {
- if (!writer.writeHeader(directType()))
- return false;
-
- writer.onHeaderWritten();
- }
-
- switch (writer.state()) {
- case 7:
- if (!writer.writeByteArray(errBytes))
- return false;
-
- writer.incrementState();
-
- case 8:
- if (!writer.writeInt(miniId))
- return false;
-
- writer.incrementState();
-
- case 9:
- if (!writer.writeLong(nearThreadId))
- return false;
-
- writer.incrementState();
-
- }
-
- return true;
+ /**
+ * @return Error serialization message.
Review Comment:
```suggestion
* @return Error message.
```
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -79,41 +79,53 @@ public int miniId() {
return miniId;
}
+ /** Sets mini future ID. */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Error for check committed backup requests.
*/
- public Throwable checkCommittedError() {
- return checkCommittedErr;
+ @Nullable public Throwable checkCommittedError() {
+ ErrorMessage checkCommittedErrMsg = this.checkCommittedErrMsg;
+
+ return checkCommittedErrMsg == null ? null : checkCommittedErrMsg.toThrowable();
}
/**
* @param checkCommittedErr Error for check committed backup requests.
*/
- public void checkCommittedError(Throwable checkCommittedErr) {
- this.checkCommittedErr = checkCommittedErr;
+ public void checkCommittedError(@Nullable Throwable checkCommittedErr) {
+ this.checkCommittedErrMsg = checkCommittedErr == null ? null : new ErrorMessage(checkCommittedErr);
}
- /**
- * @return Check committed flag.
- */
- public boolean checkCommitted() {
- return isFlag(CHECK_COMMITTED_FLAG_MASK);
+ /** @return The check committed error serialization message. */
+ public ErrorMessage checkCommittedErrorMessage() {
+ return checkCommittedErrMsg;
+ }
+
+ /** Sets the check committed error serialization message. */
+ public void checkCommittedErrorMessage(ErrorMessage checkCommittedErrMsg) {
+ this.checkCommittedErrMsg = checkCommittedErrMsg;
+ }
+
+ /** Sets the lag indicating if this is a check-committed response. */
Review Comment:
```suggestion
/** Sets the flag indicating if this is a check-committed response. */
```
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -75,12 +69,14 @@ public GridNearTxFinishResponse(int part,
this.nearThreadId = nearThreadId;
this.miniId = miniId;
- this.err = err;
+
+ if (err != null)
+ this.errMsg = new ErrorMessage(err);
}
/** {@inheritDoc} */
@Nullable @Override public Throwable error() {
- return err;
+ return errMsg == null ? null : errMsg.toThrowable();
Review Comment:
We can move such checks, for example, to some static method in `ErrorMessage`.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -79,41 +79,53 @@ public int miniId() {
return miniId;
}
+ /** Sets mini future ID. */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Error for check committed backup requests.
*/
- public Throwable checkCommittedError() {
- return checkCommittedErr;
+ @Nullable public Throwable checkCommittedError() {
Review Comment:
I think, we can remove this method and return `ErrorMessage`.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -79,41 +79,53 @@ public int miniId() {
return miniId;
}
+ /** Sets mini future ID. */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Error for check committed backup requests.
*/
- public Throwable checkCommittedError() {
- return checkCommittedErr;
+ @Nullable public Throwable checkCommittedError() {
+ ErrorMessage checkCommittedErrMsg = this.checkCommittedErrMsg;
+
+ return checkCommittedErrMsg == null ? null : checkCommittedErrMsg.toThrowable();
}
/**
* @param checkCommittedErr Error for check committed backup requests.
*/
- public void checkCommittedError(Throwable checkCommittedErr) {
- this.checkCommittedErr = checkCommittedErr;
+ public void checkCommittedError(@Nullable Throwable checkCommittedErr) {
+ this.checkCommittedErrMsg = checkCommittedErr == null ? null : new ErrorMessage(checkCommittedErr);
}
- /**
- * @return Check committed flag.
- */
- public boolean checkCommitted() {
- return isFlag(CHECK_COMMITTED_FLAG_MASK);
+ /** @return The check committed error serialization message. */
+ public ErrorMessage checkCommittedErrorMessage() {
+ return checkCommittedErrMsg;
+ }
+
+ /** Sets the check committed error serialization message. */
+ public void checkCommittedErrorMessage(ErrorMessage checkCommittedErrMsg) {
+ this.checkCommittedErrMsg = checkCommittedErrMsg;
+ }
+
+ /** Sets the lag indicating if this is a check-committed response. */
+ public void checkCommitted(boolean checkCommited) {
+ this.checkCommitted = checkCommited;
}
/**
- * @param checkCommitted Check committed flag.
+ * @return The lag indicating if this is a check-committed response.
Review Comment:
```suggestion
* @return The flag indicating if this is a check-committed response.
```
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -17,34 +17,28 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
-import java.nio.ByteBuffer;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.GridDirectTransient;
-import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.managers.communication.ErrorMessage;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxFinishResponse;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import org.jetbrains.annotations.Nullable;
/**
* Reply for synchronous phase 2.
*/
-public class GridNearTxFinishResponse extends GridDistributedTxFinishResponse {
+public final class GridNearTxFinishResponse extends GridDistributedTxFinishResponse {
/** Heuristic error. */
Review Comment:
```suggestion
/** Error message. */
```
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12409:
URL: https://github.com/apache/ignite/pull/12409#discussion_r2433103204
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java:
##########
@@ -75,12 +69,14 @@ public GridNearTxFinishResponse(int part,
this.nearThreadId = nearThreadId;
this.miniId = miniId;
- this.err = err;
+
+ if (err != null)
+ this.errMsg = new ErrorMessage(err);
}
/** {@inheritDoc} */
@Nullable @Override public Throwable error() {
- return err;
+ return errMsg == null ? null : errMsg.toThrowable();
Review Comment:
errMsg is @Nullable. It can be null.
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12409:
URL: https://github.com/apache/ignite/pull/12409#discussion_r2433121150
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java:
##########
@@ -79,41 +79,53 @@ public int miniId() {
return miniId;
}
+ /** Sets mini future ID. */
+ public void miniId(int miniId) {
+ this.miniId = miniId;
+ }
+
/**
* @return Error for check committed backup requests.
*/
- public Throwable checkCommittedError() {
- return checkCommittedErr;
+ @Nullable public Throwable checkCommittedError() {
+ ErrorMessage checkCommittedErrMsg = this.checkCommittedErrMsg;
+
+ return checkCommittedErrMsg == null ? null : checkCommittedErrMsg.toThrowable();
}
/**
* @param checkCommittedErr Error for check committed backup requests.
*/
- public void checkCommittedError(Throwable checkCommittedErr) {
- this.checkCommittedErr = checkCommittedErr;
+ public void checkCommittedError(@Nullable Throwable checkCommittedErr) {
Review Comment:
Why removing this method?
--
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-26589-Refactor GridNearTxFinishResponse and GridDhtTxFinishResponse [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12409:
URL: https://github.com/apache/ignite/pull/12409#issuecomment-3414247169
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12409) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12409&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12409&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12409&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12409&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12409&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12409)
--
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