|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.serialization.BodyTextEventSerializer
public class BodyTextEventSerializer
This class simply writes the body of the event to the output stream and appends a newline after each event.
Nested Class Summary | |
---|---|
static class |
BodyTextEventSerializer.Builder
|
Field Summary |
---|
Fields inherited from interface org.apache.flume.serialization.EventSerializer |
---|
CTX_PREFIX |
Method Summary | |
---|---|
void |
afterCreate()
Hook to write a header after file is opened for the first time. |
void |
afterReopen()
Hook to handle any framing needed when file is re-opened (for write). Could have been named afterOpenForAppend() . |
void |
beforeClose()
Hook to write a trailer before the stream is closed. |
void |
configure(Context context)
Request the implementing class to (re)configure itself. |
void |
flush()
Hook to flush any internal write buffers to the underlying stream. |
boolean |
supportsReopen()
Specify whether this output format supports reopening files for append. |
void |
write(Event e)
Serialize and write the given event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void configure(Context context)
Configurable
Request the implementing class to (re)configure itself.
When configuration parameters are changed, they must be reflected by the component asap.
There are no thread safety guarrantees on when configure might be called.
configure
in interface Configurable
public boolean supportsReopen()
EventSerializer
false
if
EventSerializer.beforeClose()
writes a trailer that "finalizes" the file
(this type of behavior is file format-specific).supportsAppend()
.
supportsReopen
in interface EventSerializer
public void afterCreate()
EventSerializer
afterCreate
in interface EventSerializer
public void afterReopen()
EventSerializer
afterOpenForAppend()
.
afterReopen
in interface EventSerializer
public void beforeClose()
EventSerializer
beforeClose
in interface EventSerializer
public void write(Event e) throws IOException
EventSerializer
write
in interface EventSerializer
e
- Event to write to the underlying stream.
IOException
public void flush() throws IOException
EventSerializer
flush
in interface EventSerializer
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |