shishkovilja commented on code in PR #12474:
URL: https://github.com/apache/ignite/pull/12474#discussion_r2483187140
##########
modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java:
##########
@@ -114,65 +120,94 @@ public GridJobExecuteResponse(UUID nodeId,
this.nodeId = nodeId;
this.sesId = sesId;
this.jobId = jobId;
- this.gridExBytes = gridExBytes;
- this.gridEx = gridEx;
- this.resBytes = resBytes;
this.res = res;
- this.jobAttrsBytes = jobAttrsBytes;
this.jobAttrs = jobAttrs;
this.isCancelled = isCancelled;
this.retry = retry;
+
+ this.gridEx = gridEx;
}
/**
* @return Task session ID.
*/
- public IgniteUuid getSessionId() {
+ public IgniteUuid sessionId() {
return sesId;
}
+ /** */
+ public void sessionId(IgniteUuid sesId) {
+ this.sesId = sesId;
+ }
+
/**
* @return Job ID.
*/
- public IgniteUuid getJobId() {
+ public IgniteUuid jobId() {
return jobId;
}
+ /** */
+ public void jobId(IgniteUuid jobId) {
+ this.jobId = jobId;
+ }
+
/**
* @return Serialized job result.
*/
- @Nullable public byte[] getJobResultBytes() {
+ @Nullable public byte[] jobResultBytes() {
return resBytes;
}
+ /** */
+ public void jobResultBytes(@Nullable byte[] resBytes) {
+ this.resBytes = resBytes;
+ }
+
/**
* @return Job result.
*/
@Nullable public Object getJobResult() {
return res;
}
- /**
- * @return Serialized job exception.
- */
- @Nullable public byte[] getExceptionBytes() {
- return gridExBytes;
- }
-
/**
* @return Job exception.
*/
- @Nullable public IgniteException getException() {
+ @Nullable public IgniteException exception() {
return gridEx;
}
+ /** */
+ public void exceptionMsg(@Nullable ErrorMessage gridExMsg) {
Review Comment:
```suggestion
public void exceptionMessage(@Nullable ErrorMessage gridExMsg) {
```
##########
modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java:
##########
@@ -17,62 +17,74 @@
package org.apache.ignite.internal;
-import java.nio.ByteBuffer;
import java.util.Map;
import java.util.UUID;
+import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.managers.communication.ErrorMessage;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.X;
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.marshaller.Marshaller;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
import org.jetbrains.annotations.Nullable;
/**
* Job execution response.
*/
public class GridJobExecuteResponse implements Message {
/** */
+ @Order(0)
private UUID nodeId;
/** */
+ @Order(value = 1, method = "sessionId")
private IgniteUuid sesId;
/** */
+ @Order(2)
private IgniteUuid jobId;
/** */
- private byte[] gridExBytes;
-
- /** */
- @GridDirectTransient
private IgniteException gridEx;
- /** */
- private byte[] resBytes;
+ /**
+ * Serialization call holder for {@code gridEx}. Works with {@link
#marshallUserData(Marshaller)}.
+ * Wraps also possible serialization error.
+ */
+ @Order(value = 3, method = "exceptionMsg")
Review Comment:
```suggestion
@Order(value = 3, method = "exceptionMessage")
```
##########
modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java:
##########
@@ -114,65 +120,94 @@ public GridJobExecuteResponse(UUID nodeId,
this.nodeId = nodeId;
this.sesId = sesId;
this.jobId = jobId;
- this.gridExBytes = gridExBytes;
- this.gridEx = gridEx;
- this.resBytes = resBytes;
this.res = res;
- this.jobAttrsBytes = jobAttrsBytes;
this.jobAttrs = jobAttrs;
this.isCancelled = isCancelled;
this.retry = retry;
+
+ this.gridEx = gridEx;
Review Comment:
Unnecessary change
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java:
##########
@@ -1672,15 +1672,15 @@ private void handleException(ClusterNode node,
GridJobExecuteRequest req, Ignite
locNodeId,
req.getSessionId(),
req.getJobId(),
- loc ? null : U.marshal(marsh, ex),
ex,
- loc ? null : U.marshal(marsh, null),
null,
- loc ? null : U.marshal(marsh, null),
null,
false,
null);
+ if (!loc)
+ jobRes.marshallUserData(marsh, null);
Review Comment:
With null logger error message we be lost. I suggest to pass `log` as
argument.
##########
modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java:
##########
@@ -114,65 +120,94 @@ public GridJobExecuteResponse(UUID nodeId,
this.nodeId = nodeId;
this.sesId = sesId;
this.jobId = jobId;
- this.gridExBytes = gridExBytes;
- this.gridEx = gridEx;
- this.resBytes = resBytes;
this.res = res;
- this.jobAttrsBytes = jobAttrsBytes;
this.jobAttrs = jobAttrs;
this.isCancelled = isCancelled;
this.retry = retry;
+
+ this.gridEx = gridEx;
}
/**
* @return Task session ID.
*/
- public IgniteUuid getSessionId() {
+ public IgniteUuid sessionId() {
return sesId;
}
+ /** */
+ public void sessionId(IgniteUuid sesId) {
+ this.sesId = sesId;
+ }
+
/**
* @return Job ID.
*/
- public IgniteUuid getJobId() {
+ public IgniteUuid jobId() {
return jobId;
}
+ /** */
+ public void jobId(IgniteUuid jobId) {
+ this.jobId = jobId;
+ }
+
/**
* @return Serialized job result.
*/
- @Nullable public byte[] getJobResultBytes() {
+ @Nullable public byte[] jobResultBytes() {
return resBytes;
}
+ /** */
+ public void jobResultBytes(@Nullable byte[] resBytes) {
+ this.resBytes = resBytes;
+ }
+
/**
* @return Job result.
*/
@Nullable public Object getJobResult() {
return res;
}
- /**
- * @return Serialized job exception.
- */
- @Nullable public byte[] getExceptionBytes() {
- return gridExBytes;
- }
-
/**
* @return Job exception.
*/
- @Nullable public IgniteException getException() {
+ @Nullable public IgniteException exception() {
return gridEx;
}
+ /** */
+ public void exceptionMsg(@Nullable ErrorMessage gridExMsg) {
+ if (gridExMsg == null) {
+ gridEx = null;
+
+ return;
+ }
+
+ Throwable t = gridExMsg.error();
+
+ gridEx = t instanceof IgniteException ? (IgniteException)t : new
IgniteException(t);
+ }
+
+ /** */
+ public @Nullable ErrorMessage exceptionMsg() {
Review Comment:
```suggestion
public @Nullable ErrorMessage exceptionMessage() {
```
--
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]