org.apache.solr.morphlines.solr

## Interface DocumentLoader

- All Known Implementing Classes:
    SolrClientDocumentLoader

      public interface DocumentLoader

  A vehicle to load a list of Solr documents into some kind of destination, such as a SolrServer or MapReduce RecordWriter.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beginTransaction()` Begins a transaction
    `void` | `commitTransaction()` Sends any outstanding documents to the destination and waits for a positive or negative ack (i.e.
    `void` | `load(SolrInputDocument doc)` Loads the given document into the destination
    `SolrPingResponse` | `ping()` Issues a ping request to check if the server is alive
    `UpdateResponse` | `rollbackTransaction()` Performs a rollback of all non-committed documents pending.
    `void` | `shutdown()` Releases allocated resources

- - ### Method Detail

    - #### beginTransaction

          void beginTransaction()
                         throws IOException,
                                SolrServerException

      Begins a transaction
      Throws:
        `IOException`
        `SolrServerException`

    - #### load

          void load(SolrInputDocument doc)
             throws IOException,
                    SolrServerException

      Loads the given document into the destination
      Throws:
        `IOException`
        `SolrServerException`

    - #### commitTransaction

          void commitTransaction()
                          throws IOException,
                                 SolrServerException

      Sends any outstanding documents to the destination and waits for a positive or negative ack (i.e. exception). Depending on the outcome the caller should then commit or rollback the current flume transaction correspondingly.
      Throws:
        `IOException` - If there is a low-level I/O error.
        `SolrServerException`

    - #### rollbackTransaction

          UpdateResponse rollbackTransaction()
                                      throws IOException,
                                             SolrServerException

      Performs a rollback of all non-committed documents pending.

      Note that this is not a true rollback as in databases. Content you have previously added may have already been committed due to autoCommit, buffer full, other client performing a commit etc. So this is only a best-effort rollback.

      Throws:
        `IOException` - If there is a low-level I/O error.
        `SolrServerException`

    - #### shutdown

          void shutdown()
                 throws IOException,
                        SolrServerException

      Releases allocated resources
      Throws:
        `IOException`
        `SolrServerException`

    - #### ping

          SolrPingResponse ping()
                         throws IOException,
                                SolrServerException

      Issues a ping request to check if the server is alive
      Throws:
        `IOException` - If there is a low-level I/O error.
        `SolrServerException`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.