public static void waitOnSafeMode(final Configuration conf, final long wait) throws IOException {
    FileSystem fs = FileSystem.get(conf);
    if (!supportSafeMode(fs)) {
      return;
    }
    // Make sure dfs is not in safe mode
    while (isInSafeMode(fs)) {
      LOG.info("Waiting for dfs to exit safe mode...");
      try {
        Thread.sleep(wait);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw (InterruptedIOException) new InterruptedIOException().initCause(e);
      }
    }
  }
If DFS, check safe mode and if so, wait until we clear it.
@param conf configuration
@param wait Sleep between retries
@throws IOException e
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java