public interface FailurePolicy
EntityParser
2. A schema mismatch between the schema of an event and the schema of the
destination dataset.
3. A missing schema from the Event header when using the
AvroEntityParser
.
The life cycle of a FailurePolicy mimics the life cycle of the
DatasetSink.writer
:
1. When a new writer is created, the policy will be instantiated.
2. As Event failures happen,
handle(org.apache.flume.Event, java.lang.Throwable)
will be
called to let the policy handle the failure.
3. If the DatasetSink
is configured to commit on batch, then the
sync()
method will be called when the batch is committed.
4. When the writer is closed, the policy's close()
method will be
called.Modifier and Type | Interface and Description |
---|---|
static interface |
FailurePolicy.Builder
Knows how to build
FailurePolicy s. |
Modifier and Type | Method and Description |
---|---|
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.
|
void handle(Event event, Throwable cause) throws EventDeliveryException
event
- The eventcause
- The cause of the failureEventDeliveryException
- 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.void sync() throws EventDeliveryException
Syncable.sync()
.EventDeliveryException
- The policy failed while syncing data.
When this is thrown, the Flume transaction
will be rolled back and the batch will be
retried.void close() throws EventDeliveryException
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–2019 Apache Software Foundation. All rights reserved.