Github user pnowojski commented on a diff in the pull request:
https://github.com/apache/flink/pull/4517#discussion_r136831126
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
---
@@ -313,20 +308,20 @@ ByteBuf write(ByteBufAllocator allocator) throws
IOException {
}
}
- @Override
- void readFrom(ByteBuf buffer) throws Exception {
+ static ErrorResponse readFrom(ByteBuf buffer) throws Exception {
try (ObjectInputStream ois = new ObjectInputStream(new
ByteBufInputStream(buffer))) {
Object obj = ois.readObject();
if (!(obj instanceof Throwable)) {
throw new ClassCastException("Read
object expected to be of type Throwable, " +
"actual type is " +
obj.getClass() + ".");
} else {
- cause = (Throwable) obj;
+ ErrorResponse result = new
ErrorResponse((Throwable) obj);
if (buffer.readBoolean()) {
- receiverId =
InputChannelID.fromByteBuf(buffer);
+ result.receiverId =
InputChannelID.fromByteBuf(buffer);
--- End diff --
ditto
---