runzhiwang commented on a change in pull request #210:
URL: https://github.com/apache/incubator-ratis/pull/210#discussion_r496309974
##########
File path:
ratis-netty/src/main/java/org/apache/ratis/netty/client/DataStreamReplyDecoder.java
##########
@@ -29,25 +29,22 @@
@Override
protected void decode(ChannelHandlerContext channelHandlerContext,
- ByteBuf byteBuf, List<Object> list) throws Exception {
+ ByteBuf byteBuf, List<Object> list) {
if(byteBuf.readableBytes() >= 24){
long streamId = byteBuf.readLong();
long dataOffset = byteBuf.readLong();
long dataLength = byteBuf.readLong();
if(byteBuf.readableBytes() >= dataLength){
- DataStreamReplyImpl reply = new DataStreamReplyImpl(streamId,
+ DataStreamReplyByteBuffer reply = new
DataStreamReplyByteBuffer(streamId,
dataOffset,
byteBuf.slice(byteBuf.readerIndex(), (int)
dataLength).nioBuffer());
byteBuf.readerIndex(byteBuf.readerIndex() + (int)dataLength);
byteBuf.markReaderIndex();
list.add(reply);
} else {
byteBuf.resetReaderIndex();
- return;
Review comment:
if byteBuf.readableBytes() >= dataLength is false, do we need to print
err log ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]