Baunsgaard commented on code in PR #2363:
URL: https://github.com/apache/systemds/pull/2363#discussion_r2593226491
##########
src/main/java/org/apache/sysds/runtime/util/UnixPipeUtils.java:
##########
@@ -22,25 +22,36 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.sysds.common.Types;
+import org.apache.sysds.runtime.frame.data.columns.Array;
+import org.apache.sysds.runtime.frame.data.columns.ArrayFactory;
import org.apache.sysds.runtime.matrix.data.MatrixBlock;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.EOFException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.io.*;
Review Comment:
no wildcard imports
##########
src/main/java/org/apache/sysds/runtime/util/UnixPipeUtils.java:
##########
@@ -74,18 +85,21 @@ public static void readHandshake(int expectedId,
BufferedInputStream bis) throws
bis.close();
throw new IOException("Failed to read handshake integer
from pipe");
}
+ compareHandshakeIds(expectedId, bis, buffer);
+ }
- // Convert bytes to int (assuming little-endian to match
typical Python struct.pack)
- int receivedId =
ByteBuffer.wrap(buffer).order(ByteOrder.LITTLE_ENDIAN).getInt();
- expectedId += 1000;
+ private static void compareHandshakeIds(int expectedId,
BufferedInputStream bis, byte[] buffer) throws IOException {
+ // Convert bytes to int (assuming little-endian to match typical
Python struct.pack)
+ int receivedId =
ByteBuffer.wrap(buffer).order(ByteOrder.LITTLE_ENDIAN).getInt();
+ expectedId += 1000;
- if (receivedId != expectedId) {
- bis.close();
- throw new IllegalStateException("Handshake ID mismatch:
expected " + expectedId + ", got " + receivedId);
- }
- }
+ if (receivedId != expectedId) {
+ bis.close();
Review Comment:
change indentation to tabs
##########
src/main/python/tests/py2j_data_transfer/__init__.py:
##########
Review Comment:
Maybe, rename folder to py4j if that is what you use for the transfer.
--
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]