MessageDecoder.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:dremio-oss 作者:
private void sendOutOfMemory(OutOfMemoryException e, final ChannelHandlerContext ctx, int coordinationId){
  final UserException uex = UserException.memoryError(e)
      .message("Out of memory while receiving data.")
      .build(logger);

  final OutboundRpcMessage outMessage = new OutboundRpcMessage(
      RpcMode.RESPONSE_FAILURE,
      0,
      coordinationId,
      uex.getOrCreatePBError(false)
      );

  if (RpcConstants.EXTRA_DEBUGGING) {
    logger.debug("Adding message to outbound buffer. {}", outMessage);
  }

  ChannelFuture future = ctx.writeAndFlush(outMessage);
  // if we were unable to report back the failure make sure we close the channel otherwise we may cause the sender
  // to block undefinitely waiting for an ACK on this message
  future.addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号