public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState.IndexWriterCloser, SolrMetricProducer
DirectUpdateHandler2 implements an UpdateHandler where documents are added
 directly to the main Lucene index as opposed to adding to a separate smaller index.
 TODO: add soft commitWithin support
SolrInfoMBean.Category, SolrInfoMBean.Group| Modifier and Type | Field and Description | 
|---|---|
| static boolean | commitOnClose | 
| protected CommitTracker | commitTracker | 
| protected boolean | commitWithinSoftCommit | 
| protected boolean | indexWriterCloseWaitsForMerges | 
| protected CommitTracker | softCommitTracker | 
| protected SolrCoreState | solrCoreState | 
commitCallbacks, core, idField, idFieldType, optimizeCallbacks, softCommitCallbacks, ulog| Constructor and Description | 
|---|
| DirectUpdateHandler2(SolrCore core) | 
| DirectUpdateHandler2(SolrCore core,
                    UpdateHandler updateHandler) | 
| Modifier and Type | Method and Description | 
|---|---|
| int | addDoc(AddUpdateCommand cmd) | 
| void | clearIndex() | 
| void | close() | 
| void | closeWriter(IndexWriter writer) | 
| void | commit(CommitUpdateCommand cmd) | 
| void | delete(DeleteUpdateCommand cmd) | 
| void | deleteByQuery(DeleteUpdateCommand cmd) | 
| CommitTracker | getCommitTracker() | 
| String | getDescription()Simple one or two line description | 
| URL[] | getDocs()Documentation URL list. | 
| String | getName()Simple common usage name, e.g. | 
| CommitTracker | getSoftCommitTracker() | 
| SolrCoreState | getSolrCoreState() | 
| String | getSource()CVS Source, SVN Source, etc | 
| NamedList | getStatistics()Any statistics this instance would like to be publicly available via
 the Solr Administration interface. | 
| UpdateLog | getUpdateLog() | 
| String | getVersion()Simple common usage version, e.g. | 
| void | initializeMetrics(SolrMetricManager manager,
                 String registry,
                 String scope)Initializes metrics specific to this producer | 
| int | mergeIndexes(MergeIndexesCommand cmd) | 
| void | newIndexWriter(boolean rollback)Called when the Writer should be opened again - eg when replication replaces
 all of the index files. | 
| void | prepareCommit(CommitUpdateCommand cmd) | 
| void | rollback(RollbackUpdateCommand cmd) | 
| protected void | rollbackWriter() | 
| void | split(SplitIndexCommand cmd) | 
| String | toString() | 
callPostCommitCallbacks, callPostOptimizeCallbacks, callPostSoftCommitCallbacks, getCategory, informEventListeners, registerCommitCallback, registerOptimizeCallback, registerSoftCommitCallbackprotected final SolrCoreState solrCoreState
protected final CommitTracker commitTracker
protected final CommitTracker softCommitTracker
protected boolean commitWithinSoftCommit
protected boolean indexWriterCloseWaitsForMerges
public static boolean commitOnClose
public DirectUpdateHandler2(SolrCore core)
public DirectUpdateHandler2(SolrCore core, UpdateHandler updateHandler)
public void initializeMetrics(SolrMetricManager manager, String registry, String scope)
SolrMetricProducerinitializeMetrics in interface SolrMetricProducermanager - an instance of SolrMetricManagerregistry - registry name where metrics are registeredscope - scope of the metrics (eg. handler name) to separate metrics of
              instances of the same component executing in different contextsprotected void rollbackWriter()
                       throws IOException
IOExceptionpublic int addDoc(AddUpdateCommand cmd) throws IOException
addDoc in class UpdateHandlerIOExceptionpublic void delete(DeleteUpdateCommand cmd) throws IOException
delete in class UpdateHandlerIOExceptionpublic void clearIndex()
                throws IOException
IOExceptionpublic void deleteByQuery(DeleteUpdateCommand cmd) throws IOException
deleteByQuery in class UpdateHandlerIOExceptionpublic int mergeIndexes(MergeIndexesCommand cmd) throws IOException
mergeIndexes in class UpdateHandlerIOExceptionpublic void prepareCommit(CommitUpdateCommand cmd) throws IOException
IOExceptionpublic void commit(CommitUpdateCommand cmd) throws IOException
commit in class UpdateHandlerIOExceptionpublic void newIndexWriter(boolean rollback)
                    throws IOException
UpdateHandlernewIndexWriter in class UpdateHandlerrollback - IndexWriter if true else closeIOException - If there is a low-level I/O error.public void rollback(RollbackUpdateCommand cmd) throws IOException
rollback in class UpdateHandlerIOExceptionpublic UpdateLog getUpdateLog()
getUpdateLog in class UpdateHandlerpublic void close()
           throws IOException
close in class UpdateHandlerIOExceptionpublic void closeWriter(IndexWriter writer) throws IOException
closeWriter in interface SolrCoreState.IndexWriterCloserIOExceptionpublic void split(SplitIndexCommand cmd) throws IOException
split in class UpdateHandlerIOExceptionpublic String getName()
SolrInfoMBeangetName in interface SolrInfoMBeanpublic String getVersion()
SolrInfoMBeangetVersion in interface SolrInfoMBeanpublic String getDescription()
SolrInfoMBeangetDescription in interface SolrInfoMBeanpublic String getSource()
SolrInfoMBeangetSource in interface SolrInfoMBeanpublic URL[] getDocs()
SolrInfoMBeanSuggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...
getDocs in interface SolrInfoMBeanpublic NamedList getStatistics()
SolrInfoMBean
 Any Object type may be stored in the list, but only the
 toString() representation will be used.
 
getStatistics in interface SolrInfoMBeanpublic SolrCoreState getSolrCoreState()
getSolrCoreState in class UpdateHandlerpublic CommitTracker getCommitTracker()
public CommitTracker getSoftCommitTracker()
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.