org.apache.solr.update
Class DirectUpdateHandler2

java.lang.Object
  extended by org.apache.solr.update.UpdateHandler
      extended by org.apache.solr.update.DirectUpdateHandler2
All Implemented Interfaces:
SolrInfoMBean, SolrCoreState.IndexWriterCloser

public class DirectUpdateHandler2
extends UpdateHandler
implements SolrCoreState.IndexWriterCloser

TODO: add soft commitWithin support DirectUpdateHandler2 implements an UpdateHandler where documents are added directly to the main Lucene index as opposed to adding to a separate smaller index.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean
SolrInfoMBean.Category
 
Field Summary
protected  Lock commitLock
           
static boolean commitOnClose
           
protected  org.apache.solr.update.CommitTracker commitTracker
           
protected  org.apache.solr.update.CommitTracker softCommitTracker
           
protected  SolrCoreState solrCoreState
           
 
Fields inherited from class org.apache.solr.update.UpdateHandler
commitCallbacks, core, idField, idFieldType, log, optimizeCallbacks, schema, softCommitCallbacks, ulog
 
Constructor Summary
DirectUpdateHandler2(SolrCore core)
           
DirectUpdateHandler2(SolrCore core, UpdateHandler updateHandler)
           
 
Method Summary
 int addDoc(AddUpdateCommand cmd)
           
 void close()
           
 void closeWriter(IndexWriter writer)
           
 void commit(CommitUpdateCommand cmd)
           
 void decref()
          Called when a SolrCore using this UpdateHandler is closed.
 void delete(DeleteUpdateCommand cmd)
           
 void deleteByQuery(DeleteUpdateCommand cmd)
           
 SolrInfoMBean.Category getCategory()
          Purpose of this Class
 String getDescription()
          Simple one or two line description
 URL[] getDocs()
          Documentation URL list.
 String getName()
          Simple common usage name, e.g.
 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 incref()
          Called when this UpdateHandler is shared with another SolrCore.
 int mergeIndexes(MergeIndexesCommand cmd)
           
 void newIndexWriter()
          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()
           
 String toString()
           
 
Methods inherited from class org.apache.solr.update.UpdateHandler
callPostCommitCallbacks, callPostOptimizeCallbacks, callPostSoftCommitCallbacks, registerCommitCallback, registerOptimizeCallback, registerSoftCommitCallback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

solrCoreState

protected final SolrCoreState solrCoreState

commitLock

protected final Lock commitLock

commitTracker

protected final org.apache.solr.update.CommitTracker commitTracker

softCommitTracker

protected final org.apache.solr.update.CommitTracker softCommitTracker

commitOnClose

public static boolean commitOnClose
Constructor Detail

DirectUpdateHandler2

public DirectUpdateHandler2(SolrCore core)
                     throws IOException
Throws:
IOException

DirectUpdateHandler2

public DirectUpdateHandler2(SolrCore core,
                            UpdateHandler updateHandler)
                     throws IOException
Throws:
IOException
Method Detail

rollbackWriter

protected void rollbackWriter()
                       throws IOException
Throws:
IOException

addDoc

public int addDoc(AddUpdateCommand cmd)
           throws IOException
Specified by:
addDoc in class UpdateHandler
Throws:
IOException

delete

public void delete(DeleteUpdateCommand cmd)
            throws IOException
Specified by:
delete in class UpdateHandler
Throws:
IOException

deleteByQuery

public void deleteByQuery(DeleteUpdateCommand cmd)
                   throws IOException
Specified by:
deleteByQuery in class UpdateHandler
Throws:
IOException

mergeIndexes

public int mergeIndexes(MergeIndexesCommand cmd)
                 throws IOException
Specified by:
mergeIndexes in class UpdateHandler
Throws:
IOException

prepareCommit

public void prepareCommit(CommitUpdateCommand cmd)
                   throws IOException
Throws:
IOException

commit

public void commit(CommitUpdateCommand cmd)
            throws IOException
Specified by:
commit in class UpdateHandler
Throws:
IOException

newIndexWriter

public void newIndexWriter()
                    throws IOException
Description copied from class: UpdateHandler
Called when the Writer should be opened again - eg when replication replaces all of the index files.

Specified by:
newIndexWriter in class UpdateHandler
Throws:
IOException

rollback

public void rollback(RollbackUpdateCommand cmd)
              throws IOException
Specified by:
rollback in class UpdateHandler
Throws:
IOException
Since:
Solr 1.4

getUpdateLog

public UpdateLog getUpdateLog()
Specified by:
getUpdateLog in class UpdateHandler

close

public void close()
           throws IOException
Specified by:
close in class UpdateHandler
Throws:
IOException

closeWriter

public void closeWriter(IndexWriter writer)
                 throws IOException
Specified by:
closeWriter in interface SolrCoreState.IndexWriterCloser
Throws:
IOException

getName

public String getName()
Description copied from interface: SolrInfoMBean
Simple common usage name, e.g. BasicQueryHandler, or fully qualified clas name.

Specified by:
getName in interface SolrInfoMBean

getVersion

public String getVersion()
Description copied from interface: SolrInfoMBean
Simple common usage version, e.g. 2.0

Specified by:
getVersion in interface SolrInfoMBean

getDescription

public String getDescription()
Description copied from interface: SolrInfoMBean
Simple one or two line description

Specified by:
getDescription in interface SolrInfoMBean

getCategory

public SolrInfoMBean.Category getCategory()
Description copied from interface: SolrInfoMBean
Purpose of this Class

Specified by:
getCategory in interface SolrInfoMBean

getSource

public String getSource()
Description copied from interface: SolrInfoMBean
CVS Source, SVN Source, etc

Specified by:
getSource in interface SolrInfoMBean

getDocs

public URL[] getDocs()
Description copied from interface: SolrInfoMBean
Documentation URL list.

Suggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...

Specified by:
getDocs in interface SolrInfoMBean

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

toString

public String toString()
Overrides:
toString in class Object

getSolrCoreState

public SolrCoreState getSolrCoreState()
Specified by:
getSolrCoreState in class UpdateHandler

decref

public void decref()
Description copied from class: UpdateHandler
Called when a SolrCore using this UpdateHandler is closed.

Specified by:
decref in class UpdateHandler

incref

public void incref()
Description copied from class: UpdateHandler
Called when this UpdateHandler is shared with another SolrCore.

Specified by:
incref in class UpdateHandler


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