Class UpdateLocks

java.lang.Object
org.apache.solr.update.UpdateLocks

public class UpdateLocks extends Object
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 Details

    • UpdateLocks

      public UpdateLocks(long docLockTimeoutMs)
  • Method Details

    • 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 provided Condition 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()