public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAware
A Handler which provides a REST API for replication and serves replication requests from Followers.
When running on the leader, it provides the following commands
When running on the follower, it provides the following commands
Modifier and Type | Class and Description |
---|---|
static interface |
ReplicationHandler.PollListener |
SolrInfoBean.Category, SolrInfoBean.Group
appends, defaults, httpCaching, initArgs, invariants, solrMetricsContext
TYPE
Constructor and Description |
---|
ReplicationHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
abortFetch() |
IndexFetcher.IndexFetchResult |
doFetch(SolrParams solrParams,
boolean forceReplication) |
SolrInfoBean.Category |
getCategory()
Category of this component
|
String |
getDescription()
Simple one or two line description
|
void |
handleRequestBody(SolrQueryRequest req,
SolrQueryResponse rsp) |
void |
inform(SolrCore core) |
void |
initializeMetrics(SolrMetricsContext parentContext,
String scope)
Initialize metrics specific to this producer.
|
void |
setPollListener(ReplicationHandler.PollListener pollListener) |
void |
shutdown() |
getApis, getInitArgs, getMetricNames, getName, getPluginInfo, getRequestHandler, getSolrMetricsContext, getSolrParamsFromNamedList, getSubHandler, handleRequest, init, setPluginInfo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricRegistry, getMetricsSnapshot, registerMetricName
close, getUniqueMetricTag, initializeMetrics
registerV1, registerV2
public static final String PATH
public static final String LEADER_URL
@Deprecated public static final String LEGACY_LEADER_URL
public static final String FETCH_FROM_LEADER
public static final String SKIP_COMMIT_ON_LEADER_VERSION_ZERO
@Deprecated public static final String LEGACY_SKIP_COMMIT_ON_LEADER_VERSION_ZERO
public static final String STATUS
public static final String MESSAGE
public static final String COMMAND
public static final String CMD_DETAILS
public static final String CMD_BACKUP
public static final String CMD_RESTORE
public static final String CMD_RESTORE_STATUS
public static final String CMD_FETCH_INDEX
public static final String CMD_ABORT_FETCH
public static final String CMD_GET_FILE_LIST
public static final String CMD_GET_FILE
public static final String CMD_DISABLE_POLL
public static final String CMD_DISABLE_REPL
public static final String CMD_ENABLE_REPL
public static final String CMD_ENABLE_POLL
public static final String CMD_INDEX_VERSION
public static final String CMD_SHOW_COMMITS
public static final String CMD_DELETE_BACKUP
public static final String GENERATION
public static final String OFFSET
public static final String LEN
public static final String FILE
public static final String SIZE
public static final String MAX_WRITE_PER_SECOND
public static final String CONF_FILE_SHORT
public static final String TLOG_FILE
public static final String CHECKSUM
public static final String ALIAS
public static final String CONF_CHECKSUM
public static final String CONF_FILES
public static final String TLOG_FILES
public static final String REPLICATE_AFTER
public static final String FILE_STREAM
public static final String POLL_INTERVAL
public static final String INTERVAL_ERR_MSG
public static final int PACKET_SZ
public static final String RESERVE
public static final String COMPRESSION
public static final String EXTERNAL
public static final String INTERNAL
public static final String ERR_STATUS
public static final String OK_STATUS
public static final String NEXT_EXECUTION_AT
public static final String NUMBER_BACKUPS_TO_KEEP_REQUEST_PARAM
public static final String NUMBER_BACKUPS_TO_KEEP_INIT_PARAM
public static final String WAIT
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.public void setPollListener(ReplicationHandler.PollListener pollListener)
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
handleRequestBody
in class RequestHandlerBase
Exception
public boolean abortFetch()
public IndexFetcher.IndexFetchResult doFetch(SolrParams solrParams, boolean forceReplication)
public SolrInfoBean.Category getCategory()
SolrInfoBean
getCategory
in interface SolrInfoBean
getCategory
in class RequestHandlerBase
public String getDescription()
SolrInfoBean
getDescription
in interface SolrInfoBean
getDescription
in class RequestHandlerBase
public void initializeMetrics(SolrMetricsContext parentContext, String scope)
SolrMetricProducer
initializeMetrics
in interface SolrMetricProducer
initializeMetrics
in class RequestHandlerBase
parentContext
- parent metrics context. If this component has the same life-cycle as the parent
it can simply use the parent context, otherwise it should obtain a child context
using SolrMetricsContext.getChildContext(Object)
passing this
as the child.scope
- component scopepublic void inform(SolrCore core)
inform
in interface SolrCoreAware
public void shutdown()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.