Class ResponseInfo

  • All Implemented Interfaces:
    io.netty.buffer.ByteBufHolder, io.netty.util.ReferenceCounted

    public class ResponseInfo
    extends com.github.ambry.utils.AbstractByteBufHolder<ResponseInfo>
    The response from a NetworkClient comes in the form of an object of this class. This class consists of the request associated with this response, along with either a non-null exception if there was an error sending the request or a non-null ByteBuffer containing the successful response received for this request. Also, this class contains DataNodeId to which the request is issued.
    • Constructor Detail

      • ResponseInfo

        public ResponseInfo​(RequestInfo requestInfo,
                            NetworkClientErrorCode error,
                            io.netty.buffer.ByteBuf content)
        Constructs a ResponseInfo with the given parameters.
        Parameters:
        requestInfo - the RequestInfo associated with this response.
        error - the error encountered in sending this request, if there is any.
        content - the response received for this request.
      • ResponseInfo

        public ResponseInfo​(RequestInfo requestInfo,
                            NetworkClientErrorCode error,
                            io.netty.buffer.ByteBuf content,
                            DataNodeId dataNode)
        Constructs a ResponseInfo with the given parameters.
        Parameters:
        requestInfo - the RequestInfo associated with this response.
        error - the error encountered in sending this request, if there is any.
        content - the response received for this request.
        dataNode - the DataNodeId of this request.
    • Method Detail

      • getRequestInfo

        public RequestInfo getRequestInfo()
        Returns:
        the RequestInfo associated with this response.
      • getDataNode

        public DataNodeId getDataNode()
        Returns:
        the DataNodeId with which the response is associated.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • content

        public io.netty.buffer.ByteBuf content()
        Specified by:
        content in interface io.netty.buffer.ByteBufHolder
        Specified by:
        content in class com.github.ambry.utils.AbstractByteBufHolder<ResponseInfo>
      • replace

        public ResponseInfo replace​(io.netty.buffer.ByteBuf content)
        Specified by:
        replace in interface io.netty.buffer.ByteBufHolder
        Specified by:
        replace in class com.github.ambry.utils.AbstractByteBufHolder<ResponseInfo>