Class TsFileLock
- java.lang.Object
-
- org.apache.iotdb.db.engine.storagegroup.TsFileLock
-
public class TsFileLock extends java.lang.ObjectTsFileLock is a special read-write lock that can be locked by one thread but unlocked by another thread.When the query thread crashes, the locks it used can no longer be unlocked by itself and another thread must do the unlock for it. Unfortunately, normal Java ReentrantLock can only be unlocked by the thread which locked it, so we have to use a different implementation. It is also interesting to use a third-party implementation and if you do find a better one, please submit an issue on our website.
WARNING: as the lock holder is not recorded, the caller must assure that lock() and unlock() match, i.e., if you only call lock() once then do not call unlock() more than once and vice versa.
-
-
Constructor Summary
Constructors Constructor Description TsFileLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreadLock()voidreadUnlock()booleantryReadLock()booleantryWriteLock()voidwriteLock()voidwriteUnlock()
-