private static void handleSuccess(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable Object returnValue, @Nullable ThriftReply rawResponseContent) { reply.complete(returnValue); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleException(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable ThriftReply rawResponseContent, Exception cause) { reply.completeExceptionally(cause); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleOneWaySuccess( ServiceRequestContext ctx, RpcResponse rpcRes, CompletableFuture<HttpResponse> httpRes, SerializationFormat serializationFormat) { ctx.logBuilder().responseContent(rpcRes, null); respond(serializationFormat, HttpData.EMPTY_DATA, httpRes); }
private static HttpData encodeSuccess(ServiceRequestContext ctx, RpcResponse reply, SerializationFormat serializationFormat, String methodName, int seqId, TBase<?, ?> result) { final ByteBuf buf = ctx.alloc().buffer(128); boolean success = false; try { final TTransport transport = new TByteBufTransport(buf); final TProtocol outProto = ThriftProtocolFactories.get(serializationFormat).getProtocol(transport); final TMessage header = new TMessage(methodName, TMessageType.REPLY, seqId); outProto.writeMessageBegin(header); result.write(outProto); outProto.writeMessageEnd(); ctx.logBuilder().responseContent(reply, new ThriftReply(header, result)); final HttpData encoded = new ByteBufHttpData(buf, false); success = true; return encoded; } catch (TException e) { throw new Error(e); // Should never reach here. } finally { if (!success) { buf.release(); } } }
private void close(Status status) { ctx.logBuilder().responseContent(GrpcLogUtil.rpcResponse(status, firstResponse), null); req.abort(); responseReader.cancel(); try (SafeCloseable ignored = ctx.push()) { listener.onClose(status, EMPTY_METADATA); } notifyExecutor(); }
setClientStreamClosed(); messageFramer.close(); ctx.logBuilder().responseContent(GrpcLogUtil.rpcResponse(newStatus, firstResponse), null); if (newStatus.isOk()) { if (useBlockingTaskExecutor) {
outProto.writeMessageEnd(); ctx.logBuilder().responseContent(reply, new ThriftReply(header, appException));
ctx.logBuilder().responseContent(rpcRes, res); ctx.logBuilder().endResponse();
logBuilder.responseHeaders(HttpHeaders.of(HttpStatus.OK)); logBuilder.responseFirstBytesTransferred(); logBuilder.responseContent(rpcRes, res); logBuilder.endResponse();
log.responseLength(128); log.responseHeaders(HttpHeaders.of(200).set(HttpHeaderNames.DATE, "some-date")); log.responseContent(RPC_RES, THRIFT_REPLY); log.endResponse();
log.responseLength(128); log.responseHeaders(HttpHeaders.of(200).set(HttpHeaderNames.DATE, "some-date")); log.responseContent(RPC_RES, THRIFT_REPLY); log.endResponse();
private static void handleSuccess(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable Object returnValue, @Nullable ThriftReply rawResponseContent) { reply.complete(returnValue); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleSuccess(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable Object returnValue, @Nullable ThriftReply rawResponseContent) { reply.complete(returnValue); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleSuccess(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable Object returnValue, @Nullable ThriftReply rawResponseContent) { reply.complete(returnValue); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleException(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable ThriftReply rawResponseContent, Exception cause) { reply.completeExceptionally(cause); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleException(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable ThriftReply rawResponseContent, Exception cause) { reply.completeExceptionally(cause); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleException(ClientRequestContext ctx, DefaultRpcResponse reply, @Nullable ThriftReply rawResponseContent, Exception cause) { reply.completeExceptionally(cause); ctx.logBuilder().responseContent(reply, rawResponseContent); }
private static void handleOneWaySuccess( ServiceRequestContext ctx, RpcResponse rpcRes, CompletableFuture<HttpResponse> httpRes, SerializationFormat serializationFormat) { ctx.logBuilder().responseContent(rpcRes, null); respond(serializationFormat, HttpData.EMPTY_DATA, httpRes); }
private static void handleOneWaySuccess( ServiceRequestContext ctx, RpcResponse rpcRes, CompletableFuture<HttpResponse> httpRes, SerializationFormat serializationFormat) { ctx.logBuilder().responseContent(rpcRes, null); respond(serializationFormat, HttpData.EMPTY_DATA, httpRes); }
private static void handleOneWaySuccess( ServiceRequestContext ctx, RpcResponse rpcRes, CompletableFuture<HttpResponse> httpRes, SerializationFormat serializationFormat) { ctx.logBuilder().responseContent(rpcRes, null); respond(serializationFormat, HttpData.EMPTY_DATA, httpRes); }