Class ShardLock

  • All Implemented Interfaces:, java.lang.AutoCloseable

    public abstract class ShardLock
    extends java.lang.Object
    A shard lock guarantees exclusive access to a shards data directory. Internal processes should acquire a lock on a shard before executing any write operations on the shards data directory.
    See Also:
    • Constructor Summary

      Constructor Description
      ShardLock​(ShardId id)  
    • Method Summary

      Modifier and Type Method Description
      void close()  
      protected abstract void closeInternal()  
      ShardId getShardId()
      Returns the locks shards Id.
      boolean isOpen()
      Returns true if this lock is still open ie.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ShardLock

        public ShardLock​(ShardId id)
    • Method Detail

      • getShardId

        public final ShardId getShardId()
        Returns the locks shards Id.
      • close

        public final void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface
      • closeInternal

        protected abstract void closeInternal()
      • isOpen

        public final boolean isOpen()
        Returns true if this lock is still open ie. has not been closed yet.
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object