public class ThriftRpcClient extends SSLContextAwareAbstractRpcClient
| Modifier and Type | Field and Description |
|---|---|
static String |
BINARY_PROTOCOL |
static String |
COMPACT_PROTOCOL |
static String |
CONFIG_PROTOCOL
Config param for the thrift protocol to use.
|
enableSsl, excludeCipherSuites, excludeProtocols, includeCipherSuites, includeProtocols, trustAllCerts, truststore, truststorePassword, truststoreTypebatchSize, connectTimeout| Constructor and Description |
|---|
ThriftRpcClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(Event event)
Send a single
Event to the associated Flume source. |
void |
appendBatch(List<Event> events)
Send a list of events to the associated Flume source.
|
void |
close()
Immediately closes the client so that it may no longer be used.
|
protected void |
configure(Properties properties)
Configure the client using the given properties object.
|
protected org.apache.thrift.transport.TTransport |
getTransport(org.apache.thrift.transport.TSocket tsocket) |
boolean |
isActive()
Returns
true if this object appears to be in a usable state, and
it returns false if this object is permanently disabled. |
configureSSLgetBatchSize, parseBatchSizepublic static final String CONFIG_PROTOCOL
public static final String BINARY_PROTOCOL
public static final String COMPACT_PROTOCOL
public void append(Event event) throws EventDeliveryException
RpcClientSend a single Event to the associated Flume source.
This method blocks until the RPC returns or until the request times out.
Note: If this method throws an
EventDeliveryException, there is no way to recover and the
application must invoke RpcClient.close() on this object to clean up system
resources.
append in interface RpcClientappend in class AbstractRpcClientEventDeliveryException - when an error prevents event delivery.public void appendBatch(List<Event> events) throws EventDeliveryException
RpcClientSend a list of events to the associated Flume source.
This method blocks until the RPC returns or until the request times out.
It is strongly recommended that the number of events in the List be no
more than RpcClient.getBatchSize(). If it is more, multiple RPC calls will
be required, and the likelihood of duplicate Events being stored will
increase.
Note: If this method throws an
EventDeliveryException, there is no way to recover and the
application must invoke RpcClient.close() on this object to clean up system
resources.
appendBatch in interface RpcClientappendBatch in class AbstractRpcClientevents - List of events to sendEventDeliveryException - when an error prevents event delivery.public boolean isActive()
RpcClientReturns true if this object appears to be in a usable state, and
it returns false if this object is permanently disabled.
If this method returns false, an application must call
RpcClient.close() on this object to clean up system resources.
isActive in interface RpcClientisActive in class AbstractRpcClientpublic void close()
throws FlumeException
RpcClientImmediately closes the client so that it may no longer be used.
Note: This method MUST be called by applications when they are done using the RPC client in order to clean up resources.
Multi-threaded applications may want to gracefully stop making
RPC calls before calling close(). Otherwise, they risk getting
EventDeliveryException thrown from their in-flight calls when the
underlying connection is disabled.
close in interface RpcClientclose in class AbstractRpcClientFlumeExceptionprotected void configure(Properties properties) throws FlumeException
AbstractRpcClientconfigure in class AbstractRpcClientFlumeException - if the client can not be configured using this
method, or if the client was already configured once.Copyright © 2009-2022 Apache Software Foundation. All Rights Reserved.