/** * De-serializes the {@link RequestFailure} sent to the * {@link org.apache.flink.queryablestate.network.Client} in case of * protocol related errors. * <pre> * <b>The buffer is expected to be at the correct position.</b> * </pre> * @param buf The {@link ByteBuf} containing the serialized failure message. * @return The failure message. */ public static RequestFailure deserializeRequestFailure(final ByteBuf buf) throws IOException, ClassNotFoundException { long requestId = buf.readLong(); Throwable cause; try (ByteBufInputStream bis = new ByteBufInputStream(buf); ObjectInputStream in = new ObjectInputStream(bis)) { cause = (Throwable) in.readObject(); } return new RequestFailure(requestId, cause); }
/** * De-serializes the {@link RequestFailure} sent to the * {@link org.apache.flink.queryablestate.network.Client} in case of * protocol related errors. * <pre> * <b>The buffer is expected to be at the correct position.</b> * </pre> * @param buf The {@link ByteBuf} containing the serialized failure message. * @return The failure message. */ public static RequestFailure deserializeRequestFailure(final ByteBuf buf) throws IOException, ClassNotFoundException { long requestId = buf.readLong(); Throwable cause; try (ByteBufInputStream bis = new ByteBufInputStream(buf); ObjectInputStream in = new ObjectInputStream(bis)) { cause = (Throwable) in.readObject(); } return new RequestFailure(requestId, cause); }
/** * De-serializes the {@link RequestFailure} sent to the * {@link org.apache.flink.queryablestate.network.Client} in case of * protocol related errors. * <pre> * <b>The buffer is expected to be at the correct position.</b> * </pre> * @param buf The {@link ByteBuf} containing the serialized failure message. * @return The failure message. */ public static RequestFailure deserializeRequestFailure(final ByteBuf buf) throws IOException, ClassNotFoundException { long requestId = buf.readLong(); Throwable cause; try (ByteBufInputStream bis = new ByteBufInputStream(buf); ObjectInputStream in = new ObjectInputStream(bis)) { cause = (Throwable) in.readObject(); } return new RequestFailure(requestId, cause); }