@Override
  public LockHeartbeatResponse lockHeartbeat(RpcController controller, LockHeartbeatRequest request)
    throws ServiceException {
    try {
      if (
        server.getLockManager().remoteLocks().lockHeartbeat(request.getProcId(),
          request.getKeepAlive())
      ) {
        return LockHeartbeatResponse.newBuilder()
          .setTimeoutMs(server.getConfiguration().getInt(LockProcedure.REMOTE_LOCKS_TIMEOUT_MS_CONF,
            LockProcedure.DEFAULT_REMOTE_LOCKS_TIMEOUT_MS))
          .setLockStatus(LockHeartbeatResponse.LockStatus.LOCKED).build();
      } else {
        return LockHeartbeatResponse.newBuilder()
          .setLockStatus(LockHeartbeatResponse.LockStatus.UNLOCKED).build();
      }
    } catch (IOException e) {
      throw new ServiceException(e);
    }
  }
@return LOCKED, if procedure is found and it has the lock; else UNLOCKED.
@throws ServiceException if given proc id is found but it is not a LockProcedure.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java