Class ServerMaintenanceLock

    • Constructor Detail

      • ServerMaintenanceLock

        public ServerMaintenanceLock​(@NotNull
                                     MultiNodeLocks multiNodeLocks)
    • Method Detail

      • tryCapture

        public boolean tryCapture​(@NotNull
                                  MaintenanceProcessKind processKind,
                                  long timeoutMillis)
        Description copied from interface: MaintenanceLock
        Tries to capture an exclusive lock for the specified maintenance process kind. If lock is taken by some other maintenance process, then this method repeats attempts untile the specified timeout happens
        Specified by:
        tryCapture in interface MaintenanceLock
        Parameters:
        processKind - a kind of the maintenance process
        timeoutMillis - repeats attempts to capture the lock until the timeout happens
        Returns:
        true if the lock was captured and false otherwise
      • release

        public void release​(@NotNull
                            MaintenanceProcessKind processKind)
        Description copied from interface: MaintenanceLock
        Releases the lock for the specified maintenance process kind
        Specified by:
        release in interface MaintenanceLock
        Parameters:
        processKind - a kind of a maintenance process whose lock should be released