org.apache.solr.update
Class DefaultSolrCoreState

java.lang.Object
  extended by org.apache.solr.update.SolrCoreState
      extended by org.apache.solr.update.DefaultSolrCoreState

public final class DefaultSolrCoreState
extends SolrCoreState


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.solr.update.SolrCoreState
SolrCoreState.IndexWriterCloser
 
Field Summary
static org.slf4j.Logger log
           
 
Constructor Summary
DefaultSolrCoreState(DirectoryFactory directoryFactory)
           
 
Method Summary
 void cancelRecovery()
           
protected  SolrIndexWriter createMainIndexWriter(SolrCore core, String name, boolean removeAllExisting, boolean forceNewDirectory)
           
 void decref(SolrCoreState.IndexWriterCloser closer)
          Decrement the number of references to this state.
 void doRecovery(CoreContainer cc, String name)
           
 DirectoryFactory getDirectoryFactory()
           
 IndexWriter getIndexWriter(SolrCore core)
          Get the current IndexWriter.
 void incref()
          Increment the number of references to this state.
 void newIndexWriter(SolrCore core)
          Force the creation of a new IndexWriter using the settings from the given SolrCore.
 void rollbackIndexWriter(SolrCore core)
          Rollback the current IndexWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.slf4j.Logger log
Constructor Detail

DefaultSolrCoreState

public DefaultSolrCoreState(DirectoryFactory directoryFactory)
Method Detail

getIndexWriter

public IndexWriter getIndexWriter(SolrCore core)
                           throws IOException
Description copied from class: SolrCoreState
Get the current IndexWriter. If a new IndexWriter must be created, use the settings from the given SolrCore.

Specified by:
getIndexWriter in class SolrCoreState
Throws:
IOException

newIndexWriter

public void newIndexWriter(SolrCore core)
                    throws IOException
Description copied from class: SolrCoreState
Force the creation of a new IndexWriter using the settings from the given SolrCore.

Specified by:
newIndexWriter in class SolrCoreState
Throws:
IOException

decref

public void decref(SolrCoreState.IndexWriterCloser closer)
            throws IOException
Description copied from class: SolrCoreState
Decrement the number of references to this state. When then number of references hits 0, the state will close. If an optional closer is passed, that will be used to close the writer.

Specified by:
decref in class SolrCoreState
Throws:
IOException

incref

public void incref()
Description copied from class: SolrCoreState
Increment the number of references to this state.

Specified by:
incref in class SolrCoreState

rollbackIndexWriter

public void rollbackIndexWriter(SolrCore core)
                         throws IOException
Description copied from class: SolrCoreState
Rollback the current IndexWriter. When creating the new IndexWriter use the settings from the given SolrCore.

Specified by:
rollbackIndexWriter in class SolrCoreState
Throws:
IOException

createMainIndexWriter

protected SolrIndexWriter createMainIndexWriter(SolrCore core,
                                                String name,
                                                boolean removeAllExisting,
                                                boolean forceNewDirectory)
                                         throws IOException
Throws:
IOException

getDirectoryFactory

public DirectoryFactory getDirectoryFactory()
Specified by:
getDirectoryFactory in class SolrCoreState
Returns:
the DirectoryFactory that should be used.

doRecovery

public void doRecovery(CoreContainer cc,
                       String name)
Specified by:
doRecovery in class SolrCoreState

cancelRecovery

public void cancelRecovery()
Specified by:
cancelRecovery in class SolrCoreState


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