Search in sources :

Example 1 with FormatConfirmable

use of org.apache.hadoop.hdfs.server.common.Storage.FormatConfirmable in project hadoop by apache.

the class FSImage method confirmFormat.

/**
   * Check whether the storage directories and non-file journals exist.
   * If running in interactive mode, will prompt the user for each
   * directory to allow them to format anyway. Otherwise, returns
   * false, unless 'force' is specified.
   * 
   * @param force if true, format regardless of whether dirs exist
   * @param interactive prompt the user when a dir exists
   * @return true if formatting should proceed
   * @throws IOException if some storage cannot be accessed
   */
boolean confirmFormat(boolean force, boolean interactive) throws IOException {
    List<FormatConfirmable> confirms = Lists.newArrayList();
    for (StorageDirectory sd : storage.dirIterable(null)) {
        confirms.add(sd);
    }
    confirms.addAll(editLog.getFormatConfirmables());
    return Storage.confirmFormat(confirms, force, interactive);
}
Also used : FormatConfirmable(org.apache.hadoop.hdfs.server.common.Storage.FormatConfirmable) StorageDirectory(org.apache.hadoop.hdfs.server.common.Storage.StorageDirectory)

Aggregations

FormatConfirmable (org.apache.hadoop.hdfs.server.common.Storage.FormatConfirmable)1 StorageDirectory (org.apache.hadoop.hdfs.server.common.Storage.StorageDirectory)1