/** * Serializes the response sent to the * {@link org.apache.flink.queryablestate.network.Client}. * * @param alloc The {@link ByteBufAllocator} used to allocate the buffer to serialize the message into. * @param requestId The id of the request to which the message refers to. * @param response The response to be serialized. * @return A {@link ByteBuf} containing the serialized message. */ public static <RESP extends MessageBody> ByteBuf serializeResponse( final ByteBufAllocator alloc, final long requestId, final RESP response) { Preconditions.checkNotNull(response); return writePayload(alloc, requestId, MessageType.REQUEST_RESULT, response.serialize()); }
/** * Serializes the request sent to the * {@link org.apache.flink.queryablestate.network.AbstractServerBase}. * * @param alloc The {@link ByteBufAllocator} used to allocate the buffer to serialize the message into. * @param requestId The id of the request to which the message refers to. * @param request The request to be serialized. * @return A {@link ByteBuf} containing the serialized message. */ public static <REQ extends MessageBody> ByteBuf serializeRequest( final ByteBufAllocator alloc, final long requestId, final REQ request) { Preconditions.checkNotNull(request); return writePayload(alloc, requestId, MessageType.REQUEST, request.serialize()); }
/** * Serializes the request sent to the * {@link org.apache.flink.queryablestate.network.AbstractServerBase}. * * @param alloc The {@link ByteBufAllocator} used to allocate the buffer to serialize the message into. * @param requestId The id of the request to which the message refers to. * @param request The request to be serialized. * @return A {@link ByteBuf} containing the serialized message. */ public static <REQ extends MessageBody> ByteBuf serializeRequest( final ByteBufAllocator alloc, final long requestId, final REQ request) { Preconditions.checkNotNull(request); return writePayload(alloc, requestId, MessageType.REQUEST, request.serialize()); }
/** * Serializes the response sent to the * {@link org.apache.flink.queryablestate.network.Client}. * * @param alloc The {@link ByteBufAllocator} used to allocate the buffer to serialize the message into. * @param requestId The id of the request to which the message refers to. * @param response The response to be serialized. * @return A {@link ByteBuf} containing the serialized message. */ public static <RESP extends MessageBody> ByteBuf serializeResponse( final ByteBufAllocator alloc, final long requestId, final RESP response) { Preconditions.checkNotNull(response); return writePayload(alloc, requestId, MessageType.REQUEST_RESULT, response.serialize()); }
/** * Serializes the request sent to the * {@link org.apache.flink.queryablestate.network.AbstractServerBase}. * * @param alloc The {@link ByteBufAllocator} used to allocate the buffer to serialize the message into. * @param requestId The id of the request to which the message refers to. * @param request The request to be serialized. * @return A {@link ByteBuf} containing the serialized message. */ public static <REQ extends MessageBody> ByteBuf serializeRequest( final ByteBufAllocator alloc, final long requestId, final REQ request) { Preconditions.checkNotNull(request); return writePayload(alloc, requestId, MessageType.REQUEST, request.serialize()); }
/** * Serializes the response sent to the * {@link org.apache.flink.queryablestate.network.Client}. * * @param alloc The {@link ByteBufAllocator} used to allocate the buffer to serialize the message into. * @param requestId The id of the request to which the message refers to. * @param response The response to be serialized. * @return A {@link ByteBuf} containing the serialized message. */ public static <RESP extends MessageBody> ByteBuf serializeResponse( final ByteBufAllocator alloc, final long requestId, final RESP response) { Preconditions.checkNotNull(response); return writePayload(alloc, requestId, MessageType.REQUEST_RESULT, response.serialize()); }