EVENT - The type of the event to process.public class GeterDun<EVENT> extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
GeterDun.CantGeterDunException |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static <EVENT> GeterDun<EVENT> |
geterDun(Class<EVENT> eventClass,
String location,
EventProcessor<EVENT> processor)
Creates a new GeterDun that swallows log corruption exceptions and
processing exceptions, and rotates logs every hour.
|
static <EVENT> GeterDun<EVENT> |
geterDun(Class<EVENT> eventClass,
String location,
EventProcessor<EVENT> processor,
CorruptionHandler corruptionHandler,
long frequency,
FailureHandler<EVENT> failureHandler) |
void |
geterDun(EVENT event)
Durably records an event and will periodically retry it if the first
attempt to write the event doesn't succeed.
|
public static <EVENT> GeterDun<EVENT> geterDun(Class<EVENT> eventClass, String location, EventProcessor<EVENT> processor, CorruptionHandler corruptionHandler, long frequency, FailureHandler<EVENT> failureHandler) throws GeterDun.CantGeterDunException
eventClass - The class of the event to process. Presently, must inherit from
Writable.location - A URI referencing a location for storing logs.processor - An implementation of a processing algorithm that will be applied
to each event.corruptionHandler - Gets notified of log corruption exceptions. These events should be
very rare, but are conditioned on the reliability of the
underlying file system.frequency - How frequently to rotate logs. Lower this parameter if you
encounter issues with OutOfMemoryErrors,
or if your log frequency exceeds more than about 4 billion entries
per hour.failureHandler - Gets notified of unrecoverable processing failures.GeterDun.CantGeterDunException - If a prerequisite is not met, such as access to the underlying
file system or one of the conditions above not being met.public static <EVENT> GeterDun<EVENT> geterDun(Class<EVENT> eventClass, String location, EventProcessor<EVENT> processor) throws GeterDun.CantGeterDunException
eventClass - The class of the event to process. Presently, must inherit from
Writable.location - A URI referencing a location for storing logs.processor - An implementation of a processing algorithm that will be applied
to each event.GeterDun.CantGeterDunException - If a prerequisite is not met, such as access to the underlying
file system or one of the conditions above not being met.public void geterDun(EVENT event) throws FinalFailureException, GeterDun.CantGeterDunException
event - The event to write.FinalFailureException - If the event cannot be processed and will never be processed.GeterDun.CantGeterDunException - If the event was recorded to the log and either was processed, or
may be processed in the future, but an error has prevented
communication with the log.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2014. All rights reserved.