Package org.apache.solr.handler.loader
Class CSVLoaderBase
- java.lang.Object
-
- org.apache.solr.handler.loader.ContentStreamLoader
-
- org.apache.solr.handler.loader.CSVLoaderBase
-
public abstract class CSVLoaderBase extends ContentStreamLoader
-
-
Field Summary
Fields Modifier and Type Field Description static StringEMPTYstatic StringENCAPSULATORstatic StringESCAPEstatic StringFIELDNAMESstatic StringHEADERstatic StringLITERALS_PREFIXstatic StringMAPstatic StringOVERWRITEprotected UpdateRequestProcessorprocessorstatic StringROW_IDstatic StringROW_ID_OFFSETstatic StringSEPARATORstatic StringSKIPstatic StringSKIPLINESstatic StringSPLITprotected AddUpdateCommandtemplateAddstatic StringTRIM
-
Constructor Summary
Constructors Modifier Constructor Description protectedCSVLoaderBase(SolrQueryRequest req, UpdateRequestProcessor processor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddDoc(int line, String[] vals)called for each line of values (document)protected voiddoAdd(int line, String[] vals, SolrInputDocument doc, AddUpdateCommand template)this must be MT safe...voidload(SolrQueryRequest req, SolrQueryResponse rsp, ContentStream stream, UpdateRequestProcessor processor)load the CSV input-
Methods inherited from class org.apache.solr.handler.loader.ContentStreamLoader
getDefaultWT, init
-
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
- See Also:
- Constant Field Values
-
FIELDNAMES
public static final String FIELDNAMES
- See Also:
- Constant Field Values
-
HEADER
public static final String HEADER
- See Also:
- Constant Field Values
-
SKIP
public static final String SKIP
- See Also:
- Constant Field Values
-
SKIPLINES
public static final String SKIPLINES
- See Also:
- Constant Field Values
-
MAP
public static final String MAP
- See Also:
- Constant Field Values
-
TRIM
public static final String TRIM
- See Also:
- Constant Field Values
-
EMPTY
public static final String EMPTY
- See Also:
- Constant Field Values
-
SPLIT
public static final String SPLIT
- See Also:
- Constant Field Values
-
ENCAPSULATOR
public static final String ENCAPSULATOR
- See Also:
- Constant Field Values
-
ESCAPE
public static final String ESCAPE
- See Also:
- Constant Field Values
-
OVERWRITE
public static final String OVERWRITE
- See Also:
- Constant Field Values
-
LITERALS_PREFIX
public static final String LITERALS_PREFIX
- See Also:
- Constant Field Values
-
ROW_ID
public static final String ROW_ID
- See Also:
- Constant Field Values
-
ROW_ID_OFFSET
public static final String ROW_ID_OFFSET
- See Also:
- Constant Field Values
-
processor
protected final UpdateRequestProcessor processor
-
templateAdd
protected final AddUpdateCommand templateAdd
-
-
Constructor Detail
-
CSVLoaderBase
protected CSVLoaderBase(SolrQueryRequest req, UpdateRequestProcessor processor)
-
-
Method Detail
-
load
public void load(SolrQueryRequest req, SolrQueryResponse rsp, ContentStream stream, UpdateRequestProcessor processor) throws IOException
load the CSV input- Specified by:
loadin classContentStreamLoader- Parameters:
req- The inputSolrQueryRequestrsp- The response, in case the Loader wishes to add anythingstream- TheContentStreamto addprocessor- TheUpdateRequestProcessorto use- Throws:
IOException
-
addDoc
public abstract void addDoc(int line, String[] vals) throws IOExceptioncalled for each line of values (document)- Throws:
IOException
-
doAdd
protected void doAdd(int line, String[] vals, SolrInputDocument doc, AddUpdateCommand template) throws IOExceptionthis must be MT safe... may be called concurrently from multiple threads.- Throws:
IOException
-
-