public void lock() throws IOException {
    synchronized (this) {
      //trace("Acquiring lock on " + file.getAbsolutePath)
      flock = channel.lock();
    }
  }
Lock the file or throw an exception if the lock is already held
ambry-utils/src/main/java/com/github/ambry/utils/FileLock.java