Interface LockManager

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    LockManagers.BaseLockManager

    public interface LockManager
    extends java.lang.AutoCloseable
    An interface for locking, used to ensure commit isolation.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean acquire​(java.lang.String entityId, java.lang.String ownerId)
      Try to acquire a lock
      void initialize​(java.util.Map<java.lang.String,​java.lang.String> properties)
      Initialize lock manager from catalog properties.
      boolean release​(java.lang.String entityId, java.lang.String ownerId)
      Release a lock exception must not be thrown for this method.
      • Methods inherited from interface java.lang.AutoCloseable

        close
    • Method Detail

      • acquire

        boolean acquire​(java.lang.String entityId,
                        java.lang.String ownerId)
        Try to acquire a lock
        Parameters:
        entityId - ID of the entity to lock
        ownerId - ID of the owner if the lock
        Returns:
        if the lock for the entity is acquired by the owner
      • release

        boolean release​(java.lang.String entityId,
                        java.lang.String ownerId)
        Release a lock exception must not be thrown for this method.
        Parameters:
        entityId - ID of the entity to lock
        ownerId - ID of the owner if the lock
        Returns:
        if the owner held the lock and successfully released it.
      • initialize

        void initialize​(java.util.Map<java.lang.String,​java.lang.String> properties)
        Initialize lock manager from catalog properties.
        Parameters:
        properties - catalog properties