Package org.apache.solr.update
Class UpdateLocks
- java.lang.Object
-
- org.apache.solr.update.UpdateLocks
-
-
Constructor Summary
Constructors Constructor Description UpdateLocks(long docLockTimeoutMs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
blockUpdates()
void
lockForUpdate()
<R> R
runWithLock(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.void
unblockUpdates()
void
unlockForUpdate()
-
-
-
Method Detail
-
runWithLock
public <R> R runWithLock(org.apache.lucene.util.BytesRef id, IOFunction<Condition,R> function) throws IOException
Acquires a lock for the given doc ID, executes the function, and releases the lock. The providedCondition
can 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()
-
-