|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.api.AbstractRpcClient
public abstract class AbstractRpcClient
Field Summary | |
---|---|
protected int |
batchSize
|
protected long |
connectTimeout
|
protected long |
requestTimeout
|
Constructor Summary | |
---|---|
AbstractRpcClient()
|
Method Summary | |
---|---|
abstract void |
append(Event event)
Send a single Event to the associated Flume source. |
abstract void |
appendBatch(List<Event> events)
Send a list of events to the associated Flume source. |
abstract void |
close()
Immediately closes the client so that it may no longer be used. |
protected abstract void |
configure(Properties properties)
Configure the client using the given properties object. |
int |
getBatchSize()
Returns the maximum number of events that may be batched
at once by appendBatch() . |
abstract 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int batchSize
protected long connectTimeout
protected long requestTimeout
Constructor Detail |
---|
public AbstractRpcClient()
Method Detail |
---|
public int getBatchSize()
RpcClient
events
that may be batched
at once by appendBatch()
.
getBatchSize
in interface RpcClient
public abstract void append(Event event) throws EventDeliveryException
RpcClient
Send 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 RpcClient
EventDeliveryException
- when an error prevents event delivery.public abstract void appendBatch(List<Event> events) throws EventDeliveryException
RpcClient
Send 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 RpcClient
events
- List of events to send
EventDeliveryException
- when an error prevents event delivery.public abstract boolean isActive()
RpcClient
Returns 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 RpcClient
public abstract void close() throws FlumeException
RpcClient
Immediately 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 RpcClient
FlumeException
protected abstract void configure(Properties properties) throws FlumeException
properties
-
FlumeException
- 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 |