Class FieldStreamDataSource
- java.lang.Object
-
- org.apache.solr.handler.dataimport.DataSource<InputStream>
-
- org.apache.solr.handler.dataimport.FieldStreamDataSource
-
public class FieldStreamDataSource extends DataSource<InputStream>
This can be useful for users who have a DB field containing BLOBs which may be Rich documentsThe datasource may be configured as follows
<dataSource name="f1" type="FieldStreamDataSource" />
The entity which uses this datasource must keep and attribute dataField
The fieldname must be resolvable from
VariableResolver
This may be used with any
EntityProcessor
which uses aDataSource
<InputStream
> eg: TikaEntityProcessor- Since:
- 3.1
-
-
Field Summary
Fields Modifier and Type Field Description protected String
dataField
protected VariableResolver
vr
-
Constructor Summary
Constructors Constructor Description FieldStreamDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Cleans up resources of this DataSource after use.InputStream
getData(String query)
Get records for the given query.The return type depends on the implementation .void
init(Context context, Properties initProps)
Initializes the DataSource with theContext
and initialization properties.
-
-
-
Field Detail
-
vr
protected VariableResolver vr
-
dataField
protected String dataField
-
-
Method Detail
-
init
public void init(Context context, Properties initProps)
Description copied from class:DataSource
Initializes the DataSource with theContext
and initialization properties.This is invoked by the
DataImporter
after creating an instance of this class.- Specified by:
init
in classDataSource<InputStream>
-
getData
public InputStream getData(String query)
Description copied from class:DataSource
Get records for the given query.The return type depends on the implementation .- Specified by:
getData
in classDataSource<InputStream>
- Parameters:
query
- The query string. It can be a SQL for JdbcDataSource or a URL for HttpDataSource or a file location for FileDataSource or a custom format for your own custom DataSource.- Returns:
- Depends on the implementation. For instance JdbcDataSource returns an Iterator<Map <String,Object>>
-
close
public void close()
Description copied from class:DataSource
Cleans up resources of this DataSource after use.- Specified by:
close
in classDataSource<InputStream>
-
-