code: public boolean waitForRegistered(long timeout, TimeUnit unit) {
      try {
        if (this.registeredLatch.await(timeout, unit)) {
          return true;
        }
      } catch (InterruptedException e) {
        LOG.severe("Failed to wait for mesos framework got registered");
        return false;
      }
  
      return false;
    }
docs: Causes the current thread to wait for MesosFramework got registered,
  unless the thread is interrupted, or the specified waiting time elapses.
  
  @param timeout the maximum time to wait
  @param unit the time unit of the timeout argument
  @return true MesosFramework got registered,
  and false if the waiting time elapsed before the count reached zero