public abstract class AbstractSimpleExtractor<T> extends Object implements Extractor<T>
Extractor
instances that construct a single
object from a block of text stored in a String
, with support for error handling
and reporting.Modifier and Type | Method and Description |
---|---|
boolean |
errorOnLastRecord()
Returns true if the last call to
extract on this instance
threw an exception that was handled. |
T |
extract(String input)
Extract a value with the type of this instance.
|
T |
getDefaultValue()
Returns the default value for this
Extractor in case of an
error. |
ExtractorStats |
getStats()
Return statistics about how many errors this
Extractor instance
encountered while parsing input data. |
void |
initialize()
Perform any initialization required by this
Extractor during the
start of a map or reduce task. |
public void initialize()
Extractor
Extractor
during the
start of a map or reduce task.initialize
in interface Extractor<T>
public T extract(String input)
Extractor
public boolean errorOnLastRecord()
Extractor
extract
on this instance
threw an exception that was handled.errorOnLastRecord
in interface Extractor<T>
public T getDefaultValue()
Extractor
Extractor
in case of an
error.getDefaultValue
in interface Extractor<T>
public ExtractorStats getStats()
Extractor
Extractor
instance
encountered while parsing input data.Copyright © 2016 The Apache Software Foundation. All rights reserved.