Class MockDataSource
- java.lang.Object
-
- org.apache.solr.handler.dataimport.DataSource<Iterator<Map<String,Object>>>
-
- org.apache.solr.handler.dataimport.MockDataSource
-
public class MockDataSource extends DataSource<Iterator<Map<String,Object>>>
A mock DataSource implementation which can be used for testing.
This API is experimental and may change in the future.
- Since:
- solr 1.3
-
-
Constructor Summary
Constructors Constructor Description MockDataSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearCache()voidclose()Cleans up resources of this DataSource after use.Iterator<Map<String,Object>>getData(String query)Get records for the given query.The return type depends on the implementation .voidinit(Context context, Properties initProps)Initializes the DataSource with theContextand initialization properties.static voidsetIterator(String query, Iterator<Map<String,Object>> iter)
-
-
-
Method Detail
-
clearCache
public static void clearCache()
-
init
public void init(Context context, Properties initProps)
Description copied from class:DataSourceInitializes the DataSource with theContextand initialization properties.This is invoked by the
DataImporterafter creating an instance of this class.
-
getData
public Iterator<Map<String,Object>> getData(String query)
Description copied from class:DataSourceGet records for the given query.The return type depends on the implementation .- Specified by:
getDatain classDataSource<Iterator<Map<String,Object>>>- 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:DataSourceCleans up resources of this DataSource after use.
-
-