org.apache.accumulo.server.util
public class RpcWrapper extends Object
TException only, by wrapping RuntimeException and Error as TException, so it doesn't just close the connection and look like
a network issue, but informs the client that a TApplicationException had occurred, as it did in Thrift 0.9.0. This performs similar functions as
TraceWrap, but with the additional action of translating exceptions. See also ACCUMULO-1691 and ACCUMULO-2950.
ACCUMULO-4065 found that the above exception-wrapping is not appropriate for Thrift's implementation of oneway methods. Oneway methods are defined as a
method which the client does not wait for it to return. Normally, this is acceptable as these methods are void. Therefore, if another client reuses the
connection to send a new RPC, there is no "extra" data sitting on the InputStream from the Socket (that the server sent). However, the implementation of a
oneway method does send a response to the client when the implementation throws a TException. This message showing up on the client's
InputStream causes future use of the Thrift Connection to become unusable. As long as the Thrift implementation sends a message back when oneway methods
throw a TException, we much make sure that we don't re-wrap-and-throw any exceptions as TExceptions.| Constructor and Description |
|---|
RpcWrapper() |
| Modifier and Type | Method and Description |
|---|---|
protected static <T> RpcServerInvocationHandler<T> |
getInvocationHandler(T instance,
Set<String> onewayMethods) |
protected static Set<String> |
getOnewayMethods(Map<String,?> processorView) |
static <I> I |
service(I instance,
org.apache.thrift.TBaseProcessor<I> processor) |
public static <I> I service(I instance,
org.apache.thrift.TBaseProcessor<I> processor)
protected static <T> RpcServerInvocationHandler<T> getInvocationHandler(T instance, Set<String> onewayMethods)
Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.