sarvekshayr commented on code in PR #9316:
URL: https://github.com/apache/ozone/pull/9316#discussion_r2536440016
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/stream/DirstreamClientHandler.java:
##########
@@ -80,6 +80,10 @@ public void doRead(ChannelHandlerContext ctx, ByteBuf buffer)
name.release();
buffer.skipBytes(1);
String[] parts = currentFileName.split(" ", 2);
+ if (parts.length < 2 || parts[1].isEmpty()) {
+ throw new IllegalArgumentException("Invalid file name format: " +
currentFileName
+ + ". Expected format: SIZE FILENAME");
Review Comment:
Could you improve the message here to make it clear?
Something like this -
```suggestion
throw new IllegalArgumentException("Invalid file name format: " +
currentFileName + ". " +
"Expected format: <size> <filename> where <size> is a number
and <filename> is a string " +
"separated by a single space. Example: '1024 myfile.txt'");
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]