public abstract class AbstractSolrIndexUpdateServiceImpl extends Object implements SolrIndexUpdateService, org.springframework.beans.factory.DisposableBean
Lock and a BlockingQueue. The providers for these components, SolrIndexQueueProvider and
SolrIndexLockProvider provide an isDistributed() method. They must both return the same value. Note that if
isDistributed() returns false, then care must be taken to ensure that 2 or more nodes (i.e. JVMs) cannot execute at the same time.
This is typically done by ensuring that only a single node will receive calls/events to update a Solr index.| Constructor and Description |
|---|
AbstractSolrIndexUpdateServiceImpl(String commandGroup,
SolrIndexQueueProvider queueProvider,
SolrIndexUpdateCommandHandler commandHandler) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.solr.common.SolrInputDocument |
buildDocument(Indexable indexable)
Provides an interface for a caller to convert an
Indexable into a SolrInputDocument. |
org.apache.solr.common.SolrInputDocument |
buildDocument(Indexable indexable,
List<IndexField> fields,
List<Locale> locales)
Provides an interface for a caller to convert an
Indexable into a SolrInputDocument. |
void |
destroy() |
String |
getCommandGroup()
This is any arbitrary name to identify or group commands, typically based on the Solr index (or indexes) being updated.
|
protected long |
getQueueOfferTime()
Amount of time that will be waited, assuming the queue is full, for space to become available in the queue.
|
protected long |
getQueuePollTime()
Amount of time in millis that the queue will be polled before returning an item or null.
|
static boolean |
isRunning(String commandIdentifier) |
void |
rebuildIndex()
Default behavior is to truncate the background collection (offline index), populate it with documents,
commit, and then swap (re-alias) so that it becomes the foreground collection and the foreground collection becomes the background.
|
protected <C extends SolrUpdateCommand> |
scheduleCommand(C command) |
static void |
shutdownAll()
Stops all threads that are listening to various command queues.
|
void |
updateIndex(List<org.apache.solr.common.SolrInputDocument> documents)
This is for relatively small, autonomous, incremental updates to the main (customer-facing) foreground Solr collection / index.
|
void |
updateIndex(List<org.apache.solr.common.SolrInputDocument> documents,
List<String> deleteQueries)
This is for relatively small, autonomous, incremental updates to the main (customer-facing) foreground Solr collection / index.
|
public AbstractSolrIndexUpdateServiceImpl(String commandGroup, SolrIndexQueueProvider queueProvider, SolrIndexUpdateCommandHandler commandHandler)
public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanExceptionpublic static void shutdownAll()
public final String getCommandGroup()
protected final <C extends SolrUpdateCommand> void scheduleCommand(C command)
public static boolean isRunning(String commandIdentifier)
public void rebuildIndex()
throws ServiceException
SolrIndexUpdateServicerebuildIndex in interface SolrIndexUpdateServiceServiceExceptionpublic void updateIndex(List<org.apache.solr.common.SolrInputDocument> documents)
SolrIndexUpdateServiceupdateIndex in interface SolrIndexUpdateServicepublic void updateIndex(List<org.apache.solr.common.SolrInputDocument> documents, List<String> deleteQueries)
SolrIndexUpdateServiceupdateIndex in interface SolrIndexUpdateServicepublic org.apache.solr.common.SolrInputDocument buildDocument(Indexable indexable)
SolrIndexUpdateServiceIndexable into a SolrInputDocument. This may return null if the implementor does not want
the specified Indexable indexed.buildDocument in interface SolrIndexUpdateServicepublic org.apache.solr.common.SolrInputDocument buildDocument(Indexable indexable, List<IndexField> fields, List<Locale> locales)
SolrIndexUpdateServiceIndexable into a SolrInputDocument. This may return null if the implementor does not want
the specified Indexable indexed.buildDocument in interface SolrIndexUpdateServiceprotected long getQueuePollTime()
protected long getQueueOfferTime()
Copyright © 2023. All rights reserved.