|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.sink.solr.morphline.BlobDeserializer
@InterfaceAudience.Private @InterfaceStability.Evolving public class BlobDeserializer
A deserializer that reads a Binary Large Object (BLOB) per event, typically one BLOB per file; To be used in conjunction with Flume SpoolDirectorySource.
Note that this approach is not suitable for very large objects because it buffers up the entire BLOB.
Nested Class Summary | |
---|---|
static class |
BlobDeserializer.Builder
Builder implementations MUST have a public no-arg constructor |
Field Summary | |
---|---|
static int |
MAX_BLOB_LENGTH_DEFAULT
|
static String |
MAX_BLOB_LENGTH_KEY
|
Constructor Summary | |
---|---|
protected |
BlobDeserializer(Context context,
ResettableInputStream in)
|
Method Summary | |
---|---|
void |
close()
Calls EventDeserializer.reset() on the stream and then closes it. |
void |
mark()
Marks the underlying input stream, indicating that the events previously returned by this EventDeserializer have been successfully committed. |
Event |
readEvent()
Reads a BLOB from a file and returns an event |
List<Event> |
readEvents(int numEvents)
Batch BLOB read |
void |
reset()
Resets the underlying input stream to the last known mark (or beginning of the stream if EventDeserializer.mark() was never previously called. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MAX_BLOB_LENGTH_KEY
public static final int MAX_BLOB_LENGTH_DEFAULT
Constructor Detail |
---|
protected BlobDeserializer(Context context, ResettableInputStream in)
Method Detail |
---|
public Event readEvent() throws IOException
readEvent
in interface EventDeserializer
IOException
EventDeserializer.mark()
,
EventDeserializer.reset()
public List<Event> readEvents(int numEvents) throws IOException
readEvents
in interface EventDeserializer
numEvents
- Maximum number of events to return.
IOException
EventDeserializer.mark()
,
EventDeserializer.reset()
public void mark() throws IOException
EventDeserializer
mark
in interface EventDeserializer
mark
in interface Resettable
IOException
EventDeserializer.reset()
public void reset() throws IOException
EventDeserializer
EventDeserializer.mark()
was never previously called. This should
be done in the case of inability to commit previously-deserialized events.
reset
in interface EventDeserializer
reset
in interface Resettable
IOException
EventDeserializer.mark()
public void close() throws IOException
EventDeserializer
EventDeserializer.reset()
on the stream and then closes it.
In the case of successful completion of event consumption,
EventDeserializer.mark()
MUST be called before close()
.
close
in interface Closeable
close
in interface EventDeserializer
IOException
EventDeserializer.mark()
,
EventDeserializer.reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |