code: private void unlockJob() {
      if (this.jobLockOptional.isPresent()) {
        try {
          // Unlock so the next run of the same job can proceed
          this.jobLockOptional.get().unlock();
        } catch (JobLockException ioe) {
          LOG.error(String.format("Failed to unlock for job %s: %s", this.jobContext.getJobId(), ioe), ioe);
        } finally {
          try {
            this.jobLockOptional.get().close();
          } catch (IOException e) {
            LOG.error(String.format("Failed to close job lock for job %s: %s", this.jobContext.getJobId(), e), e);
          } finally {
            this.jobLockOptional = Optional.absent();
          }
        }
      }
    }
docs: Unlock a completed or failed job.