Package org.apache.solr.update
Class SolrCoreState
java.lang.Object
org.apache.solr.update.SolrCoreState
- Direct Known Subclasses:
DefaultSolrCoreState
The state in this class can be easily shared between SolrCores across SolrCore reloads.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabstract voidclose(SolrCoreState.IndexWriterCloser closer) abstract voidcloseIndexWriter(SolrCore core, boolean rollback) Expert method that closes the IndexWriter - you must callopenIndexWriter(SolrCore)in a finally block after calling this method.booleanvoidDe-registers in-flight update requests to this core (marks them as completed)abstract voiddoRecovery(CoreContainer cc, CoreDescriptor cd) abstract Lockabstract DirectoryFactoryabstract RefCounted<org.apache.lucene.index.IndexWriter> getIndexWriter(SolrCore core) Get the current IndexWriter.abstract booleanabstract ActionThrottleabstract org.apache.lucene.search.SortGet the current Sort of the current IndexWriter's MergePolicy..abstract Lockabstract RecoveryStrategy.Buildervoidabstract voidnewIndexWriter(SolrCore core, boolean rollback) Force the creation of a new IndexWriter using the settings from the given SolrCore.abstract voidopenIndexWriter(SolrCore core) Expert method that opens the IndexWriter - you must callcloseIndexWriter(SolrCore, boolean)first, and then call this method in a finally block.voidPauses all update requests to this core and waits (indefinitely) for all in-flight update requests to finishbooleanRegisters in-flight update requests to this core.abstract voidrollbackIndexWriter(SolrCore core) Rollback the current IndexWriter.abstract voidsetLastReplicateIndexSuccess(boolean success)
-
Field Details
-
closed
protected boolean closed
-
-
Constructor Details
-
SolrCoreState
public SolrCoreState()
-
-
Method Details
-
getUpdateLock
-
getReloadLock
-
increfSolrCoreState
public void increfSolrCoreState() -
decrefSolrCoreState
-
pauseUpdatesAndAwaitInflightRequests
Pauses all update requests to this core and waits (indefinitely) for all in-flight update requests to finish- Throws:
TimeoutExceptionInterruptedException
-
registerInFlightUpdate
public boolean registerInFlightUpdate()Registers in-flight update requests to this core.- Returns:
- true if request was registered, false if update requests are paused
-
deregisterInFlightUpdate
public void deregisterInFlightUpdate()De-registers in-flight update requests to this core (marks them as completed) -
getCommitLock
-
newIndexWriter
Force the creation of a new IndexWriter using the settings from the given SolrCore.- Parameters:
rollback- close IndexWriter if false, else rollback- Throws:
IOException- If there is a low-level I/O error.
-
closeIndexWriter
Expert method that closes the IndexWriter - you must callopenIndexWriter(SolrCore)in a finally block after calling this method.- 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
Expert method that opens the IndexWriter - you must callcloseIndexWriter(SolrCore, boolean)first, and then call this method in a finally block.- Parameters:
core- that the IW belongs to- Throws:
IOException- If there is a low-level I/O error.
-
getIndexWriter
public abstract RefCounted<org.apache.lucene.index.IndexWriter> getIndexWriter(SolrCore core) throws IOException Get the current IndexWriter. If a new IndexWriter must be created, use the settings from the givenSolrCore.- Throws:
IOException- If there is a low-level I/O error.
-
rollbackIndexWriter
Rollback the current IndexWriter. When creating the new IndexWriter use the settings from the givenSolrCore.- Throws:
IOException- If there is a low-level I/O error.
-
getMergePolicySort
Get the current Sort of the current IndexWriter's MergePolicy..- Throws:
IOException- If there is a low-level I/O error.
-
getDirectoryFactory
- Returns:
- the
DirectoryFactorythat should be used.
-
getRecoveryStrategyBuilder
- Returns:
- the
RecoveryStrategy.Builderthat should be used.
-
doRecovery
-
cancelRecovery
public abstract void cancelRecovery() -
close
-
getLeaderThrottle
- Returns:
- throttle to limit how fast a core attempts to become leader
-
getLastReplicateIndexSuccess
public abstract boolean getLastReplicateIndexSuccess() -
setLastReplicateIndexSuccess
public abstract void setLastReplicateIndexSuccess(boolean success) -
getRecoveryLock
-
getTragicException
- Throws:
IOException
-