platinumhamburg commented on code in PR #1370:
URL: https://github.com/apache/fluss/pull/1370#discussion_r2252969092
##########
fluss-common/src/main/java/com/alibaba/fluss/memory/MemorySegmentInputView.java:
##########
@@ -71,6 +76,16 @@ public short readShort() throws IOException {
}
}
+ @Override
+ public int readUnsignedShort() throws IOException {
+ return 0;
Review Comment:
Same as above.
##########
fluss-common/src/main/java/com/alibaba/fluss/memory/MemorySegmentInputView.java:
##########
@@ -60,6 +60,11 @@ public byte readByte() throws IOException {
}
}
+ @Override
+ public int readUnsignedByte() throws IOException {
+ return 0;
Review Comment:
What is the semantic meaning of returning zero here? Could this lead to
undefined behavior?
##########
fluss-common/src/main/java/com/alibaba/fluss/memory/MemorySegmentOutputView.java:
##########
@@ -150,6 +156,15 @@ public void writeDouble(double v) throws IOException {
position += 8;
}
+ @Override
+ public void writeBytes(String s) throws IOException {}
Review Comment:
Same as above.
##########
fluss-common/src/main/java/com/alibaba/fluss/row/BinarySection.java:
##########
@@ -35,7 +35,7 @@ abstract class BinarySection implements MemoryAwareGetters,
Serializable {
private static final long serialVersionUID = 1L;
- protected MemorySegment[] segments;
+ protected transient MemorySegment[] segments;
protected int offset;
Review Comment:
offset and sizeInBytes should also be transient
##########
fluss-common/src/main/java/com/alibaba/fluss/memory/MemorySegmentInputView.java:
##########
@@ -71,6 +76,16 @@ public short readShort() throws IOException {
}
}
+ @Override
+ public int readUnsignedShort() throws IOException {
+ return 0;
+ }
+
+ @Override
+ public char readChar() throws IOException {
+ return 0;
Review Comment:
Same as above.
##########
fluss-common/src/main/java/com/alibaba/fluss/memory/MemorySegmentOutputView.java:
##########
@@ -106,6 +109,9 @@ public void writeShort(int v) throws IOException {
position += 2;
}
+ @Override
+ public void writeChar(int v) throws IOException {}
Review Comment:
Same as above.
##########
fluss-common/src/main/java/com/alibaba/fluss/memory/MemorySegmentOutputView.java:
##########
@@ -73,6 +73,9 @@ public void writeByte(int b) throws IOException {
memorySegment.put(position++, (byte) (b & 0xff));
}
+ @Override
+ public void write(int b) throws IOException {}
Review Comment:
Empty implementations may lead to undefined behavior or misuse. I think it's
better to throw an UnsupportedOperationException instead of relying on default
behavior like this.
##########
fluss-common/src/main/java/com/alibaba/fluss/memory/MemorySegmentOutputView.java:
##########
@@ -150,6 +156,15 @@ public void writeDouble(double v) throws IOException {
position += 8;
}
+ @Override
+ public void writeBytes(String s) throws IOException {}
+
+ @Override
+ public void writeChars(String s) throws IOException {}
Review Comment:
Same as above.
--
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]