org.apache.solr.handler

## Class ReplicationHandler

- java.lang.Object
- - org.apache.solr.handler.RequestHandlerBase
  - - org.apache.solr.handler.ReplicationHandler

- All Implemented Interfaces:
    SolrInfoMBean, NestedRequestHandler, SolrRequestHandler, SolrCoreAware

      public class ReplicationHandler
      extends RequestHandlerBase
      implements SolrCoreAware

  A Handler which provides a REST API for replication and serves replication requests from Slaves.

  When running on the master, it provides the following commands

  1. Get the current replicable index version (command=indexversion)
  2. Get the list of files for a given index version (command=filelist&indexversion=<VERSION>)
  3. Get full or a part (chunk) of a given index or a config file (command=filecontent&file=<FILE_NAME>) You can optionally specify an offset and length to get that chunk of the file. You can request a configuration file by using "cf" parameter instead of the "file" parameter.
  4. Get status/statistics (command=details)

  When running on the slave, it provides the following commands

  1. Perform an index fetch now (command=snappull)
  2. Get status/statistics (command=details)
  3. Abort an index fetch (command=abort)
  4. Enable/Disable polling the master for new versions (command=enablepoll or command=disablepoll)
  Since:
    solr 1.4

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean

      `SolrInfoMBean.Category`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ALIAS`
    `static String` | `CHECKSUM`
    `static String` | `CMD_ABORT_FETCH`
    `static String` | `CMD_BACKUP`
    `static String` | `CMD_DELETE_BACKUP`
    `static String` | `CMD_DETAILS`
    `static String` | `CMD_DISABLE_POLL`
    `static String` | `CMD_DISABLE_REPL`
    `static String` | `CMD_ENABLE_POLL`
    `static String` | `CMD_ENABLE_REPL`
    `static String` | `CMD_FETCH_INDEX`
    `static String` | `CMD_GET_FILE`
    `static String` | `CMD_GET_FILE_LIST`
    `static String` | `CMD_INDEX_VERSION`
    `static String` | `CMD_RESTORE`
    `static String` | `CMD_RESTORE_STATUS`
    `static String` | `CMD_SHOW_COMMITS`
    `static String` | `COMMAND`
    `static String` | `COMPRESSION`
    `static String` | `CONF_CHECKSUM`
    `static String` | `CONF_FILE_SHORT`
    `static String` | `CONF_FILES`
    `static String` | `ERR_STATUS`
    `static String` | `EXTERNAL`
    `static String` | `FILE`
    `static String` | `FILE_STREAM`
    `static String` | `GENERATION`
    `static String` | `INTERNAL`
    `static String` | `INTERVAL_ERR_MSG`
    `static String` | `LEN`
    `static String` | `MASTER_URL`
    `static String` | `MAX_WRITE_PER_SECOND`
    `static String` | `NEXT_EXECUTION_AT`
    `static String` | `NUMBER_BACKUPS_TO_KEEP_INIT_PARAM`
    `static String` | `NUMBER_BACKUPS_TO_KEEP_REQUEST_PARAM`
    `static String` | `OFFSET`
    `static String` | `OK_STATUS`
    `static int` | `PACKET_SZ`
    `static String` | `PATH`
    `static String` | `POLL_INTERVAL`
    `static String` | `REPLICATE_AFTER`
    `static String` | `RESERVE`
    `static String` | `SIZE`
    `static String` | `STATUS`
    `static String` | `TLOG_FILE`
    `static String` | `TLOG_FILES`
    `static String` | `WAIT` Boolean param for tests that can be specified when using `CMD_FETCH_INDEX` to force the current request to block until the fetch is complete.

    - ### Fields inherited from class org.apache.solr.handler.RequestHandlerBase

      `appends, defaults, httpCaching, initArgs, invariants`

    - ### Fields inherited from interface org.apache.solr.request.SolrRequestHandler

      `TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReplicationHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `abortFetch()`
    `boolean` | `doFetch(SolrParams solrParams, boolean forceReplication)`
    `String` | `getDescription()` Simple one or two line description
    `NamedList` | `getStatistics()` Any statistics this instance would like to be publicly available via the Solr Administration interface.
    `void` | `handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)`
    `void` | `inform(SolrCore core)`

    - ### Methods inherited from class org.apache.solr.handler.RequestHandlerBase

      `getCategory, getDocs, getInitArgs, getName, getPluginInfo, getRequestHandler, getSolrParamsFromNamedList, getSource, getSubHandler, getVersion, handleRequest, init, setPluginInfo`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PATH

          public static final String PATH

      See Also:
        Constant Field Values

    - #### MASTER_URL

          public static final String MASTER_URL

      See Also:
        Constant Field Values

    - #### STATUS

          public static final String STATUS

      See Also:
        Constant Field Values

    - #### COMMAND

          public static final String COMMAND

      See Also:
        Constant Field Values

    - #### CMD_DETAILS

          public static final String CMD_DETAILS

      See Also:
        Constant Field Values

    - #### CMD_BACKUP

          public static final String CMD_BACKUP

      See Also:
        Constant Field Values

    - #### CMD_RESTORE

          public static final String CMD_RESTORE

      See Also:
        Constant Field Values

    - #### CMD_RESTORE_STATUS

          public static final String CMD_RESTORE_STATUS

      See Also:
        Constant Field Values

    - #### CMD_FETCH_INDEX

          public static final String CMD_FETCH_INDEX

      See Also:
        Constant Field Values

    - #### CMD_ABORT_FETCH

          public static final String CMD_ABORT_FETCH

      See Also:
        Constant Field Values

    - #### CMD_GET_FILE_LIST

          public static final String CMD_GET_FILE_LIST

      See Also:
        Constant Field Values

    - #### CMD_GET_FILE

          public static final String CMD_GET_FILE

      See Also:
        Constant Field Values

    - #### CMD_DISABLE_POLL

          public static final String CMD_DISABLE_POLL

      See Also:
        Constant Field Values

    - #### CMD_DISABLE_REPL

          public static final String CMD_DISABLE_REPL

      See Also:
        Constant Field Values

    - #### CMD_ENABLE_REPL

          public static final String CMD_ENABLE_REPL

      See Also:
        Constant Field Values

    - #### CMD_ENABLE_POLL

          public static final String CMD_ENABLE_POLL

      See Also:
        Constant Field Values

    - #### CMD_INDEX_VERSION

          public static final String CMD_INDEX_VERSION

      See Also:
        Constant Field Values

    - #### CMD_SHOW_COMMITS

          public static final String CMD_SHOW_COMMITS

      See Also:
        Constant Field Values

    - #### CMD_DELETE_BACKUP

          public static final String CMD_DELETE_BACKUP

      See Also:
        Constant Field Values

    - #### GENERATION

          public static final String GENERATION

      See Also:
        Constant Field Values

    - #### OFFSET

          public static final String OFFSET

      See Also:
        Constant Field Values

    - #### LEN

          public static final String LEN

      See Also:
        Constant Field Values

    - #### FILE

          public static final String FILE

      See Also:
        Constant Field Values

    - #### SIZE

          public static final String SIZE

      See Also:
        Constant Field Values

    - #### MAX_WRITE_PER_SECOND

          public static final String MAX_WRITE_PER_SECOND

      See Also:
        Constant Field Values

    - #### CONF_FILE_SHORT

          public static final String CONF_FILE_SHORT

      See Also:
        Constant Field Values

    - #### TLOG_FILE

          public static final String TLOG_FILE

      See Also:
        Constant Field Values

    - #### CHECKSUM

          public static final String CHECKSUM

      See Also:
        Constant Field Values

    - #### ALIAS

          public static final String ALIAS

      See Also:
        Constant Field Values

    - #### CONF_CHECKSUM

          public static final String CONF_CHECKSUM

      See Also:
        Constant Field Values

    - #### CONF_FILES

          public static final String CONF_FILES

      See Also:
        Constant Field Values

    - #### TLOG_FILES

          public static final String TLOG_FILES

      See Also:
        Constant Field Values

    - #### REPLICATE_AFTER

          public static final String REPLICATE_AFTER

      See Also:
        Constant Field Values

    - #### FILE_STREAM

          public static final String FILE_STREAM

      See Also:
        Constant Field Values

    - #### POLL_INTERVAL

          public static final String POLL_INTERVAL

      See Also:
        Constant Field Values

    - #### INTERVAL_ERR_MSG

          public static final String INTERVAL_ERR_MSG

      See Also:
        Constant Field Values

    - #### PACKET_SZ

          public static final int PACKET_SZ

      See Also:
        Constant Field Values

    - #### RESERVE

          public static final String RESERVE

      See Also:
        Constant Field Values

    - #### COMPRESSION

          public static final String COMPRESSION

      See Also:
        Constant Field Values

    - #### EXTERNAL

          public static final String EXTERNAL

      See Also:
        Constant Field Values

    - #### INTERNAL

          public static final String INTERNAL

      See Also:
        Constant Field Values

    - #### ERR_STATUS

          public static final String ERR_STATUS

      See Also:
        Constant Field Values

    - #### OK_STATUS

          public static final String OK_STATUS

      See Also:
        Constant Field Values

    - #### NEXT_EXECUTION_AT

          public static final String NEXT_EXECUTION_AT

      See Also:
        Constant Field Values

    - #### NUMBER_BACKUPS_TO_KEEP_REQUEST_PARAM

          public static final String NUMBER_BACKUPS_TO_KEEP_REQUEST_PARAM

      See Also:
        Constant Field Values

    - #### NUMBER_BACKUPS_TO_KEEP_INIT_PARAM

          public static final String NUMBER_BACKUPS_TO_KEEP_INIT_PARAM

      See Also:
        Constant Field Values

    - #### WAIT

          public static final String WAIT

      Boolean param for tests that can be specified when using `CMD_FETCH_INDEX` to force the current request to block until the fetch is complete. NOTE: This param is not advised for non-test code, since the the duration of the fetch for non-trivial indexes will likeley cause the request to time out.
      See Also:
        Constant Field Values
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

  - ### Constructor Detail

    - #### ReplicationHandler

          public ReplicationHandler()

  - ### Method Detail

    - #### handleRequestBody

          public void handleRequestBody(SolrQueryRequest req,
                                        SolrQueryResponse rsp)
                                 throws Exception

      Specified by:
        `handleRequestBody` in class `RequestHandlerBase`
      Throws:
        `Exception`

    - #### abortFetch

          public boolean abortFetch()

    - #### doFetch

          public boolean doFetch(SolrParams solrParams,
                                 boolean forceReplication)

    - #### getDescription

          public String getDescription()

      Description copied from interface: `SolrInfoMBean`
      Simple one or two line description
      Specified by:
        `getDescription` in interface `SolrInfoMBean`
      Specified by:
        `getDescription` in class `RequestHandlerBase`

    - #### getStatistics

          public NamedList getStatistics()

      Description copied from interface: `SolrInfoMBean`
      Any statistics this instance would like to be publicly available via the Solr Administration interface.

      Any Object type may be stored in the list, but only the `toString()` representation will be used.

      Specified by:
        `getStatistics` in interface `SolrInfoMBean`
      Overrides:
        `getStatistics` in class `RequestHandlerBase`

    - #### inform

          public void inform(SolrCore core)

      Specified by:
        `inform` in interface `SolrCoreAware`

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