@Override public void removeLock(String taskid, TaskLock taskLockToRemove) { Preconditions.checkNotNull(taskid, "taskid"); Preconditions.checkNotNull(taskLockToRemove, "taskLockToRemove"); final Long lockId = handler.getLockId(taskid, taskLockToRemove); if (lockId == null) { log.warn("Cannot find lock[%s]", taskLockToRemove); } else { log.info("Deleting TaskLock with id[%d]: %s", lockId, taskLockToRemove); handler.removeLock(lockId); } }
@Override public void replaceLock(String taskid, TaskLock oldLock, TaskLock newLock) { Preconditions.checkNotNull(taskid, "taskid"); Preconditions.checkNotNull(oldLock, "oldLock"); Preconditions.checkNotNull(newLock, "newLock"); log.info( "Replacing an existing lock[%s] with a new lock[%s] for task: %s", oldLock, newLock, taskid ); final Long oldLockId = handler.getLockId(taskid, oldLock); if (oldLockId == null) { throw new ISE("Cannot find an existing lock[%s]", oldLock); } handler.replaceLock(taskid, oldLockId, newLock); }
@Override public void removeLock(String taskid, TaskLock taskLockToRemove) { Preconditions.checkNotNull(taskid, "taskid"); Preconditions.checkNotNull(taskLockToRemove, "taskLockToRemove"); final Long lockId = handler.getLockId(taskid, taskLockToRemove); if (lockId == null) { log.warn("Cannot find lock[%s]", taskLockToRemove); } else { log.info("Deleting TaskLock with id[%d]: %s", lockId, taskLockToRemove); handler.removeLock(lockId); } }
@Override public void replaceLock(String taskid, TaskLock oldLock, TaskLock newLock) { Preconditions.checkNotNull(taskid, "taskid"); Preconditions.checkNotNull(oldLock, "oldLock"); Preconditions.checkNotNull(newLock, "newLock"); log.info( "Replacing an existing lock[%s] with a new lock[%s] for task: %s", oldLock, newLock, taskid ); final Long oldLockId = handler.getLockId(taskid, oldLock); if (oldLockId == null) { throw new ISE("Cannot find an existing lock[%s]", oldLock); } handler.replaceLock(taskid, oldLockId, newLock); }