public class ThriftUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DIGEST_MD5 |
static String |
GSSAPI |
Constructor and Description |
---|
ThriftUtil() |
Modifier and Type | Method and Description |
---|---|
static <T extends org.apache.thrift.TServiceClient> |
createClient(org.apache.thrift.TServiceClientFactory<T> factory,
org.apache.thrift.transport.TTransport transport)
Create a Thrift client using the given factory and transport
|
static org.apache.thrift.transport.TTransport |
createClientTransport(HostAndPort address,
int timeout,
SslConnectionParams sslParams,
SaslConnectionParams saslParams)
Create a TTransport for clients to the given address with the provided socket timeout and session-layer configuration
|
static org.apache.thrift.transport.TTransport |
createTransport(HostAndPort address,
ClientContext context)
Create a transport that is not pooled
|
static <T extends org.apache.thrift.TServiceClient> |
getClient(org.apache.thrift.TServiceClientFactory<T> factory,
HostAndPort address,
ClientContext context)
Create a Thrift client using the given factory with a pooled transport (if available), the address and client context.
|
static <T extends org.apache.thrift.TServiceClient> |
getClient(org.apache.thrift.TServiceClientFactory<T> factory,
HostAndPort address,
ClientContext context,
long timeout)
Create a Thrift client using the given factory with a pooled transport (if available) using the address, client context and timeou
|
static <T extends org.apache.thrift.TServiceClient> |
getClientNoTimeout(org.apache.thrift.TServiceClientFactory<T> factory,
HostAndPort address,
ClientContext context)
Create a Thrift client using the given factory with a pooled transport (if available), the address, and client context with no timeout.
|
static TabletClientService.Client |
getTServerClient(HostAndPort address,
ClientContext context)
Create a TabletServer Thrift client
|
static TabletClientService.Client |
getTServerClient(HostAndPort address,
ClientContext context,
long timeout)
Create a TabletServer Thrift client
|
static org.apache.thrift.protocol.TProtocolFactory |
protocolFactory()
An instance of
TraceProtocolFactory |
static void |
returnClient(org.apache.thrift.TServiceClient iface)
Return the transport used by the client to the shared pool.
|
static org.apache.thrift.transport.TTransportFactory |
transportFactory()
An instance of
TFramedTransport.Factory |
static org.apache.thrift.transport.TTransportFactory |
transportFactory(int maxFrameSize)
Get an instance of the TTransportFactory with the provided maximum frame size
|
static org.apache.thrift.transport.TTransportFactory |
transportFactory(long maxFrameSize) |
public static final String GSSAPI
public static final String DIGEST_MD5
public static org.apache.thrift.protocol.TProtocolFactory protocolFactory()
TraceProtocolFactory
public static org.apache.thrift.transport.TTransportFactory transportFactory()
TFramedTransport.Factory
public static <T extends org.apache.thrift.TServiceClient> T createClient(org.apache.thrift.TServiceClientFactory<T> factory, org.apache.thrift.transport.TTransport transport)
public static <T extends org.apache.thrift.TServiceClient> T getClientNoTimeout(org.apache.thrift.TServiceClientFactory<T> factory, HostAndPort address, ClientContext context) throws org.apache.thrift.transport.TTransportException
factory
- Thrift client factoryaddress
- Server address for client to connect tocontext
- RPC optionsorg.apache.thrift.transport.TTransportException
public static <T extends org.apache.thrift.TServiceClient> T getClient(org.apache.thrift.TServiceClientFactory<T> factory, HostAndPort address, ClientContext context) throws org.apache.thrift.transport.TTransportException
factory
- Thrift client factoryaddress
- Server address for client to connect tocontext
- RPC optionsorg.apache.thrift.transport.TTransportException
public static <T extends org.apache.thrift.TServiceClient> T getClient(org.apache.thrift.TServiceClientFactory<T> factory, HostAndPort address, ClientContext context, long timeout) throws org.apache.thrift.transport.TTransportException
factory
- Thrift client factoryaddress
- Server address for client to connect tocontext
- RPC optionstimeout
- Socket timeout which overrides the ClientContext timeoutorg.apache.thrift.transport.TTransportException
public static void returnClient(org.apache.thrift.TServiceClient iface)
iface
- The Client being returned or null.public static TabletClientService.Client getTServerClient(HostAndPort address, ClientContext context) throws org.apache.thrift.transport.TTransportException
address
- Server address for client to connect tocontext
- RPC optionsorg.apache.thrift.transport.TTransportException
public static TabletClientService.Client getTServerClient(HostAndPort address, ClientContext context, long timeout) throws org.apache.thrift.transport.TTransportException
address
- Server address for client to connect tocontext
- Options for connecting to the servertimeout
- Socket timeout which overrides the ClientContext timeoutorg.apache.thrift.transport.TTransportException
public static org.apache.thrift.transport.TTransport createTransport(HostAndPort address, ClientContext context) throws org.apache.thrift.TException
address
- Server address to open the transport tocontext
- RPC optionsorg.apache.thrift.TException
public static org.apache.thrift.transport.TTransportFactory transportFactory(int maxFrameSize)
maxFrameSize
- Maximum Thrift message frame sizepublic static org.apache.thrift.transport.TTransportFactory transportFactory(long maxFrameSize)
transportFactory(int)
public static org.apache.thrift.transport.TTransport createClientTransport(HostAndPort address, int timeout, SslConnectionParams sslParams, SaslConnectionParams saslParams) throws org.apache.thrift.transport.TTransportException
address
- Server address to connect totimeout
- Client socket timeoutsslParams
- RPC options for SSL serverssaslParams
- RPC options for SASL serversorg.apache.thrift.transport.TTransportException
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.