Package org.apache.solr.update
Class UpdateHandler
- java.lang.Object
- 
- org.apache.solr.update.UpdateHandler
 
- 
- All Implemented Interfaces:
- AutoCloseable,- SolrInfoBean,- SolrMetricProducer
 - Direct Known Subclasses:
- DirectUpdateHandler2
 
 public abstract class UpdateHandler extends Object implements SolrInfoBean UpdateHandlerhandles requests to change the index (adds, deletes, commits, optimizes, etc).- Since:
- solr 0.9
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBeanSolrInfoBean.Category, SolrInfoBean.Group
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected Vector<SolrEventListener>commitCallbacksprotected SolrCorecoreprotected SchemaFieldidFieldprotected FieldTypeidFieldTypeprotected Vector<SolrEventListener>optimizeCallbacksprotected Vector<SolrEventListener>softCommitCallbacksprotected SolrMetricsContextsolrMetricsContextprotected UpdateLogulog
 - 
Constructor SummaryConstructors Constructor Description UpdateHandler(SolrCore core)UpdateHandler(SolrCore core, UpdateLog updateLog)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract intaddDoc(AddUpdateCommand cmd)protected voidcallPostCommitCallbacks()protected voidcallPostOptimizeCallbacks()protected voidcallPostSoftCommitCallbacks()abstract voidcommit(CommitUpdateCommand cmd)abstract voiddelete(DeleteUpdateCommand cmd)abstract voiddeleteByQuery(DeleteUpdateCommand cmd)SolrInfoBean.CategorygetCategory()Category of this componentabstract SolrCoreStategetSolrCoreState()SolrMetricsContextgetSolrMetricsContext()Implementations should return the context used inSolrMetricProducer.initializeMetrics(SolrMetricsContext, String)to ensure proper cleanup of metrics at the end of the life-cycle of this component.abstract UpdateLoggetUpdateLog()voidinformEventListeners(SolrCore core)Call theSolrCoreAware.inform(SolrCore)on all the applicable registered listeners.abstract intmergeIndexes(MergeIndexesCommand cmd)abstract voidnewIndexWriter(boolean rollback)Called when the Writer should be opened again - eg when replication replaces all of the index files.voidregisterCommitCallback(SolrEventListener listener)NOTE: this function is not thread safe.voidregisterOptimizeCallback(SolrEventListener listener)NOTE: this function is not thread safe.voidregisterSoftCommitCallback(SolrEventListener listener)NOTE: this function is not thread safe.abstract voidrollback(RollbackUpdateCommand cmd)abstract voidsplit(SplitIndexCommand cmd)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.core.SolrInfoBeangetDescription, getName
 - 
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducerclose, initializeMetrics
 
- 
 
- 
- 
- 
Field Detail- 
coreprotected final SolrCore core 
 - 
idFieldprotected final SchemaField idField 
 - 
idFieldTypeprotected final FieldType idFieldType 
 - 
commitCallbacksprotected Vector<SolrEventListener> commitCallbacks 
 - 
softCommitCallbacksprotected Vector<SolrEventListener> softCommitCallbacks 
 - 
optimizeCallbacksprotected Vector<SolrEventListener> optimizeCallbacks 
 - 
ulogprotected final UpdateLog ulog 
 - 
solrMetricsContextprotected SolrMetricsContext solrMetricsContext 
 
- 
 - 
Method Detail- 
informEventListenerspublic void informEventListeners(SolrCore core) Call theSolrCoreAware.inform(SolrCore)on all the applicable registered listeners.
 - 
callPostCommitCallbacksprotected void callPostCommitCallbacks() 
 - 
callPostSoftCommitCallbacksprotected void callPostSoftCommitCallbacks() 
 - 
callPostOptimizeCallbacksprotected void callPostOptimizeCallbacks() 
 - 
newIndexWriterpublic abstract void newIndexWriter(boolean rollback) throws IOExceptionCalled when the Writer should be opened again - eg when replication replaces all of the index files.- Parameters:
- rollback- IndexWriter if true else close
- Throws:
- IOException- If there is a low-level I/O error.
 
 - 
getSolrCoreStatepublic abstract SolrCoreState getSolrCoreState() 
 - 
addDocpublic abstract int addDoc(AddUpdateCommand cmd) throws IOException - Throws:
- IOException
 
 - 
deletepublic abstract void delete(DeleteUpdateCommand cmd) throws IOException - Throws:
- IOException
 
 - 
deleteByQuerypublic abstract void deleteByQuery(DeleteUpdateCommand cmd) throws IOException - Throws:
- IOException
 
 - 
mergeIndexespublic abstract int mergeIndexes(MergeIndexesCommand cmd) throws IOException - Throws:
- IOException
 
 - 
commitpublic abstract void commit(CommitUpdateCommand cmd) throws IOException - Throws:
- IOException
 
 - 
rollbackpublic abstract void rollback(RollbackUpdateCommand cmd) throws IOException - Throws:
- IOException
 
 - 
getUpdateLogpublic abstract UpdateLog getUpdateLog() 
 - 
registerCommitCallbackpublic void registerCommitCallback(SolrEventListener listener) NOTE: this function is not thread safe. However, it is safe to call within theinform( SolrCore core )function forSolrCoreAwareclasses. Outsideinform, this could potentially throw a ConcurrentModificationException- See Also:
- SolrCoreAware
 
 - 
registerSoftCommitCallbackpublic void registerSoftCommitCallback(SolrEventListener listener) NOTE: this function is not thread safe. However, it is safe to call within theinform( SolrCore core )function forSolrCoreAwareclasses. Outsideinform, this could potentially throw a ConcurrentModificationException- See Also:
- SolrCoreAware
 
 - 
registerOptimizeCallbackpublic void registerOptimizeCallback(SolrEventListener listener) NOTE: this function is not thread safe. However, it is safe to call within theinform( SolrCore core )function forSolrCoreAwareclasses. Outsideinform, this could potentially throw a ConcurrentModificationException- See Also:
- SolrCoreAware
 
 - 
splitpublic abstract void split(SplitIndexCommand cmd) throws IOException - Throws:
- IOException
 
 - 
getCategorypublic SolrInfoBean.Category getCategory() Description copied from interface:SolrInfoBeanCategory of this component- Specified by:
- getCategoryin interface- SolrInfoBean
 
 - 
getSolrMetricsContextpublic SolrMetricsContext getSolrMetricsContext() Description copied from interface:SolrMetricProducerImplementations should return the context used inSolrMetricProducer.initializeMetrics(SolrMetricsContext, String)to ensure proper cleanup of metrics at the end of the life-cycle of this component. This should be the child context if one was created, or null if the parent context was used.- Specified by:
- getSolrMetricsContextin interface- SolrMetricProducer
 
 
- 
 
-