org.apache.flume.sink.kite.policy
Class RetryPolicy

java.lang.Object
  extended by org.apache.flume.sink.kite.policy.RetryPolicy
All Implemented Interfaces:
FailurePolicy

public class RetryPolicy
extends Object
implements FailurePolicy

A failure policy that logs the error and then forces a retry by throwing EventDeliveryException.


Nested Class Summary
static class RetryPolicy.Builder
           
 
Method Summary
 void close()
          Close this FailurePolicy and release any resources.
 void handle(Event event, Throwable cause)
          Handle a non-recoverable event.
 void sync()
          Ensure any handled events are on stable storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

handle

public void handle(Event event,
                   Throwable cause)
            throws EventDeliveryException
Description copied from interface: FailurePolicy
Handle a non-recoverable event.

Specified by:
handle in interface FailurePolicy
Parameters:
event - The event
cause - The cause of the failure
Throws:
EventDeliveryException - The policy failed to handle the event. When this is thrown, the Flume transaction will be rolled back and the event will be retried along with the rest of the batch.

sync

public void sync()
          throws EventDeliveryException
Description copied from interface: FailurePolicy
Ensure any handled events are on stable storage. This allows the policy implementation to sync any data that it may not have fully handled. See Syncable.sync().

Specified by:
sync in interface FailurePolicy
Throws:
EventDeliveryException - The policy failed while syncing data. When this is thrown, the Flume transaction will be rolled back and the batch will be retried.

close

public void close()
           throws EventDeliveryException
Description copied from interface: FailurePolicy
Close this FailurePolicy and release any resources.

Specified by:
close in interface FailurePolicy
Throws:
EventDeliveryException - The policy failed while closing resources. When this is thrown, the Flume transaction will be rolled back and the batch will be retried.


Copyright © 2009-2015 Apache Software Foundation. All Rights Reserved.