valepakh commented on code in PR #4778: URL: https://github.com/apache/ignite-3/pull/4778#discussion_r1862067858
########## modules/compute/src/main/java/org/apache/ignite/internal/compute/ComputeUtils.java: ########## @@ -394,6 +415,46 @@ private static Throwable mapToComputeException(Throwable origin) { ); } + /** + * Unmarshals the input from the {@link ComputeJobDataHolder} using provided marshaller if input was marshalled on the client. If the + * input was marshalled as a {@link Tuple} or POJO, then, if provided pojo type is not {@code null} and not a {@link Tuple}, unmarshals + * the input as a pojo using the provided pojo type, otherwise unmarshals it as a {@link Tuple}. + * + * @param marshaller Optional marshaller to unmarshal the input. + * @param argumentHolder Argument holder. + * @param pojoType Pojo type to use when unmarshalling as a pojo. + * @param <T> Result type. + * @return Unmarshalled object. + */ + private static <T> @Nullable T unmarshalFromDataHolder( + @Nullable Marshaller<T, byte[]> marshaller, + ComputeJobDataHolder argumentHolder, + @Nullable Class<?> pojoType + ) { + Loggers.forClass(ComputeUtils.class).info("unmarshalFromDataHolder {}", argumentHolder.type()); + ComputeJobDataType type = argumentHolder.type(); + switch (type) { + case TUPLE: // Fallthrough TODO https://issues.apache.org/jira/browse/IGNITE-23320 + case POJO: Review Comment: I don't really like putting lines between cases that are falling through, it's more clear to me that they follow the same path. -- 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-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org