Package org.apache.solr.update
Class DefaultSolrCoreState
java.lang.Object
org.apache.solr.update.SolrCoreState
org.apache.solr.update.DefaultSolrCoreState
- All Implemented Interfaces:
RecoveryStrategy.RecoveryListener
public final class DefaultSolrCoreState
extends SolrCoreState
implements RecoveryStrategy.RecoveryListener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.SolrCoreState
SolrCoreState.CoreIsClosedException, SolrCoreState.IndexWriterCloser -
Field Summary
Fields inherited from class org.apache.solr.update.SolrCoreState
closed -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSolrCoreState(DirectoryFactory directoryFactory) Deprecated.DefaultSolrCoreState(DirectoryFactory directoryFactory, RecoveryStrategy.Builder recoveryStrategyBuilder) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose(SolrCoreState.IndexWriterCloser closer) voidcloseIndexWriter(SolrCore core, boolean rollback) Expert method that closes the IndexWriter - you must callSolrCoreState.openIndexWriter(SolrCore)in a finally block after calling this method.voiddoRecovery(CoreContainer cc, CoreDescriptor cd) voidfailed()called from recoveryStrat on a failed recoveryRefCounted<org.apache.lucene.index.IndexWriter> getIndexWriter(SolrCore core) Get the current IndexWriter.booleanorg.apache.lucene.search.SortGet the current Sort of the current IndexWriter's MergePolicy..voidnewIndexWriter(SolrCore core, boolean rollback) Force the creation of a new IndexWriter using the settings from the given SolrCore.voidopenIndexWriter(SolrCore core) Expert method that opens the IndexWriter - you must callSolrCoreState.closeIndexWriter(SolrCore, boolean)first, and then call this method in a finally block.voidcalled from recoveryStrat on a successful recoveryvoidrollbackIndexWriter(SolrCore core) Rollback the current IndexWriter.voidsetLastReplicateIndexSuccess(boolean success) Methods inherited from class org.apache.solr.update.SolrCoreState
decrefSolrCoreState, deregisterInFlightUpdate, getReloadLock, getTragicException, getUpdateLock, increfSolrCoreState, pauseUpdatesAndAwaitInflightRequests, registerInFlightUpdate
-
Constructor Details
-
DefaultSolrCoreState
Deprecated. -
DefaultSolrCoreState
public DefaultSolrCoreState(DirectoryFactory directoryFactory, RecoveryStrategy.Builder recoveryStrategyBuilder)
-
-
Method Details
-
getIndexWriter
public RefCounted<org.apache.lucene.index.IndexWriter> getIndexWriter(SolrCore core) throws IOException Description copied from class:SolrCoreStateGet the current IndexWriter. If a new IndexWriter must be created, use the settings from the givenSolrCore.- Specified by:
getIndexWriterin classSolrCoreState- Throws:
IOException- If there is a low-level I/O error.
-
newIndexWriter
Description copied from class:SolrCoreStateForce the creation of a new IndexWriter using the settings from the given SolrCore.- Specified by:
newIndexWriterin classSolrCoreState- Parameters:
rollback- close IndexWriter if false, else rollback- Throws:
IOException- If there is a low-level I/O error.
-
closeIndexWriter
Description copied from class:SolrCoreStateExpert method that closes the IndexWriter - you must callSolrCoreState.openIndexWriter(SolrCore)in a finally block after calling this method.- Specified by:
closeIndexWriterin classSolrCoreState- Parameters:
core- that the IW belongs torollback- true if IW should rollback rather than close- Throws:
IOException- If there is a low-level I/O error.
-
openIndexWriter
Description copied from class:SolrCoreStateExpert method that opens the IndexWriter - you must callSolrCoreState.closeIndexWriter(SolrCore, boolean)first, and then call this method in a finally block.- Specified by:
openIndexWriterin classSolrCoreState- Parameters:
core- that the IW belongs to- Throws:
IOException- If there is a low-level I/O error.
-
rollbackIndexWriter
Description copied from class:SolrCoreStateRollback the current IndexWriter. When creating the new IndexWriter use the settings from the givenSolrCore.- Specified by:
rollbackIndexWriterin classSolrCoreState- Throws:
IOException- If there is a low-level I/O error.
-
getMergePolicySort
Description copied from class:SolrCoreStateGet the current Sort of the current IndexWriter's MergePolicy..- Specified by:
getMergePolicySortin classSolrCoreState- Throws:
IOException- If there is a low-level I/O error.
-
getDirectoryFactory
- Specified by:
getDirectoryFactoryin classSolrCoreState- Returns:
- the
DirectoryFactorythat should be used.
-
getRecoveryStrategyBuilder
- Specified by:
getRecoveryStrategyBuilderin classSolrCoreState- Returns:
- the
RecoveryStrategy.Builderthat should be used.
-
doRecovery
- Specified by:
doRecoveryin classSolrCoreState
-
cancelRecovery
public void cancelRecovery()- Specified by:
cancelRecoveryin classSolrCoreState
-
recovered
public void recovered()called from recoveryStrat on a successful recovery- Specified by:
recoveredin interfaceRecoveryStrategy.RecoveryListener
-
failed
public void failed()called from recoveryStrat on a failed recovery- Specified by:
failedin interfaceRecoveryStrategy.RecoveryListener
-
close
- Specified by:
closein classSolrCoreState
-
getCommitLock
- Specified by:
getCommitLockin classSolrCoreState
-
getLeaderThrottle
- Specified by:
getLeaderThrottlein classSolrCoreState- Returns:
- throttle to limit how fast a core attempts to become leader
-
getLastReplicateIndexSuccess
public boolean getLastReplicateIndexSuccess()- Specified by:
getLastReplicateIndexSuccessin classSolrCoreState
-
setLastReplicateIndexSuccess
public void setLastReplicateIndexSuccess(boolean success) - Specified by:
setLastReplicateIndexSuccessin classSolrCoreState
-
getRecoveryLock
- Specified by:
getRecoveryLockin classSolrCoreState
-