|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.flume.api.AbstractRpcClient
org.apache.flume.api.FailoverRpcClient
public class FailoverRpcClient
Avro/Netty implementation of RpcClient which supports failover. This
takes a list of hostname port combinations and connects to the next available
(looping back to the first) host, from a given list of agents in the order
provided.
The properties used to build a FailoverRpcClient must have:
hosts = alias_for_host1 alias_for_host2
...hosts.alias_for_host1 = hostname1:port1.
hosts.alias_for_host2 = hostname2:port2.
etcOptionally it can also have a
batch-size = batchSize max-attempts = maxAttempts Given a failure, this client will attempt to append to maxAttempts clients in the hosts list immediately following the failed host (looping back to the beginning of the hosts list.
| Field Summary |
|---|
| Fields inherited from class org.apache.flume.api.AbstractRpcClient |
|---|
batchSize, connectTimeout, requestTimeout |
| Constructor Summary | |
|---|---|
protected |
FailoverRpcClient()
|
| Method Summary | |
|---|---|
void |
append(Event event)
Tries to append an event to the currently connected client. |
void |
appendBatch(List<Event> events)
Tries to append a list of events to the currently connected client. |
void |
close()
Close the connection. |
void |
configure(Properties properties)
Configure the client using the given properties object. |
protected InetSocketAddress |
getLastConnectedServerAddress()
Get the last socket address this client connected to. |
protected Integer |
getMaxTries()
Get the maximum number of "failed" hosts the client will try to establish connection to before throwing an exception. |
boolean |
isActive()
Returns true if this object appears to be in a usable state, and
it returns false if this object is permanently disabled. |
| Methods inherited from class org.apache.flume.api.AbstractRpcClient |
|---|
getBatchSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.flume.api.RpcClient |
|---|
getBatchSize |
| Constructor Detail |
|---|
protected FailoverRpcClient()
| Method Detail |
|---|
protected Integer getMaxTries()
public void append(Event event)
throws EventDeliveryException
append in interface RpcClientappend in class AbstractRpcClientevent - The event to be appended.
EventDeliveryException
public void appendBatch(List<Event> events)
throws EventDeliveryException
appendBatch in interface RpcClientappendBatch in class AbstractRpcClientevents - The events to be appended.
EventDeliveryExceptionpublic 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 AbstractRpcClient
public void close()
throws FlumeException
close in interface RpcClientclose in class AbstractRpcClientFlumeExceptionprotected InetSocketAddress getLastConnectedServerAddress()
public void configure(Properties properties)
throws FlumeException
AbstractRpcClient
configure in class AbstractRpcClientFlumeException - if the client can not be configured using this
method, or if the client was already configured once.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||