Interface RemoteStoreCommitLevelLockManager
- All Known Implementing Classes:
RemoteSegmentStoreDirectory
public interface RemoteStoreCommitLevelLockManager
An Interface that defines Commit Level Lock in Remote Store. We can lock the segment files corresponding to a given
primaryTerm and Commit Generation.
- Opensearch.internal:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acquireLock
(long primaryTerm, long generation, String acquirerId) This method will be used to acquire lock on segment files of a specific commit.isLockAcquired
(long primaryTerm, long generation) This method will be used to check if a specific commit have any lock acquired on it or not.void
releaseLock
(long primaryTerm, long generation, String acquirerId) This method will be used to release lock on segment files of a specific commit, which got acquired by given resource.
-
Method Details
-
acquireLock
This method will be used to acquire lock on segment files of a specific commit.- Parameters:
primaryTerm
- Primary Term of index at the time of commit.generation
- Commit GenerationacquirerId
- Resource ID which wants to acquire lock on the commit.- Throws:
IOException
- in case there is a problem in acquiring lock on a commit.
-
releaseLock
This method will be used to release lock on segment files of a specific commit, which got acquired by given resource.- Parameters:
primaryTerm
- Primary Term of index at the time of commit.generation
- Commit GenerationacquirerId
- Resource ID for which lock needs to be released.- Throws:
IOException
- in case there is a problem in releasing lock on a commit.
-
isLockAcquired
This method will be used to check if a specific commit have any lock acquired on it or not.- Parameters:
primaryTerm
- Primary Term of index at the time of commit.generation
- Commit Generation- Returns:
- true if given commit is locked, else false.
- Throws:
IOException
- in case there is a problem in checking if a commit is locked or not.
-