Package org.apache.solr.update
Class UpdateLocks
java.lang.Object
org.apache.solr.update.UpdateLocks
Locks associated with updates in connection with the
UpdateLog.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoid<R> RrunWithLock(org.apache.lucene.util.BytesRef id, IOFunction<Condition, R> function) Acquires a lock for the given doc ID, executes the function, and releases the lock.voidvoid
-
Constructor Details
-
UpdateLocks
public UpdateLocks(long docLockTimeoutMs)
-
-
Method Details
-
runWithLock
public <R> R runWithLock(org.apache.lucene.util.BytesRef id, IOFunction<Condition, R> function) throws IOExceptionAcquires a lock for the given doc ID, executes the function, and releases the lock. The providedConditioncan be used for wait/notify control. The per-doc locking is needed indirectly due to SolrCloud's internal out-of-order versioned update design.- Throws:
IOException
-
lockForUpdate
public void lockForUpdate() -
unlockForUpdate
public void unlockForUpdate() -
blockUpdates
public void blockUpdates() -
unblockUpdates
public void unblockUpdates()
-