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.
| Constructor and Description |
|---|
MockDataSource() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCache() |
void |
close()
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 .
|
void |
init(Context context,
Properties initProps)
Initializes the DataSource with the
Context and
initialization properties. |
static void |
setIterator(String query,
Iterator<Map<String,Object>> iter) |
public static void clearCache()
public void init(Context context, Properties initProps)
DataSourceContext and
initialization properties.
This is invoked by the DataImporter after creating an
instance of this class.
public Iterator<Map<String,Object>> getData(String query)
DataSourcegetData in class DataSource<Iterator<Map<String,Object>>>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.public void close()
DataSourceCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.