DataSource (Solr 3.6.2 API)
Keywords: org.apache.solr.handler.dataimport.DataSource class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.handler.dataimport
Class DataSource<T>

    java.lang.Object
      org.apache.solr.handler.dataimport.DataSource<T>

Direct Known Subclasses:
  BinContentStreamDataSource, BinFileDataSource, BinURLDataSource, ContentStreamDataSource, FieldReaderDataSource, FieldStreamDataSource, FileDataSource, JdbcDataSource, MockDataSource, URLDataSource

    public abstract class DataSource<T>

extends Object

Provides data from a source with a given query.

Implementation of this abstract class must provide a default no-arg constructor

Refer to http://wiki.apache.org/solr/DataImportHandler for more details.

This API is experimental and may change in the future.

Since:
  solr 1.3
Version:
  $Id: DataSource.java 684025 2008-08-08 17:50:11Z shalin $

Constructor Summary
`DataSource()`

Method Summary
`abstract void` | `close()` Cleans up resources of this DataSource after use.
`abstract T` | `getData(String query)` Get records for the given query.The return type depends on the implementation .
`abstract void` | `init(Context context, Properties initProps)` Initializes the DataSource with the `Context` and initialization properties.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DataSource

    public DataSource()

Method Detail

### init

    public abstract void init(Context context,
                              Properties initProps)

  Initializes the DataSource with the `Context` and initialization properties.

  This is invoked by the `DataImporter` after creating an instance of this class.

  Parameters:
    `context` -
    `initProps` -

### getData

    public abstract T getData(String query)

  Get records for the given query.The return type depends on the implementation .

  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 >

### close

    public abstract void close()

  Cleans up resources of this DataSource after use.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD