public class LineEntityProcessor extends EntityProcessorBase
An EntityProcessor
instance which can stream lines of text read from a
datasource. Options allow lines to be explicitly skipped or included in the index.
Attribute summary
Although envisioned for reading lines from a file or url, LineEntityProcessor may also be useful for dealing with change lists, where each line contains filenames which can be used by subsequent entities to parse content from those files.
Refer to http://wiki.apache.org/solr/DataImportHandler for more details.
This API is experimental and may change in the future.
Pattern
Modifier and Type | Field and Description |
---|---|
static String |
ACCEPT_LINE_REGEX
Holds the name of entity attribute that will be parsed to obtain
the pattern to be used when checking to see if a line should
be returned.
|
static String |
SKIP_LINE_REGEX
Holds the name of entity attribute that will be parsed to obtain
the pattern to be used when checking to see if a line should
be ignored.
|
static String |
URL
Holds the name of entity attribute that will be parsed to obtain
the filename containing the changelist.
|
ABORT, cacheSupport, context, CONTINUE, entityName, isFirstInit, ON_ERROR, onError, query, rowIterator, SKIP, TRANSFORM_ROW, TRANSFORMER
Constructor and Description |
---|
LineEntityProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
closeResources() |
void |
destroy()
Invoked for each entity at the very end of the import to do any needed cleanup tasks.
|
void |
init(Context context)
Parses each of the entity attributes.
|
Map<String,Object> |
nextRow()
Reads lines from the url till it finds a lines that matches the
optional acceptLineRegex and does not match the optional skipLineRegex.
|
firstInit, getNext, initCache, nextDeletedRowKey, nextModifiedParentRowKey, nextModifiedRowKey
close, postTransform
public static final String URL
public static final String ACCEPT_LINE_REGEX
public static final String SKIP_LINE_REGEX
public void init(Context context)
init
in class EntityProcessorBase
context
- The current contextpublic Map<String,Object> nextRow()
nextRow
in class EntityProcessorBase
public void closeResources()
public void destroy()
EntityProcessor
destroy
in class EntityProcessorBase
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.