hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/StorageContainerManager.java
public static boolean scmInit(OzoneConfiguration conf) throws IOException {
    SCMStorage scmStorage = new SCMStorage(conf);
    StorageState state = scmStorage.getState();
    if (state != StorageState.INITIALIZED) {
      try {
        String clusterId = StartupOption.INIT.getClusterId();
        if (clusterId != null && !clusterId.isEmpty()) {
          scmStorage.setClusterId(clusterId);
        }
        scmStorage.initialize();
        System.out.println("SCM initialization succeeded." +
            "Current cluster id for sd=" + scmStorage.getStorageDir() + ";cid="
                + scmStorage.getClusterID());
        return true;
      } catch (IOException ioe) {
        LOG.error("Could not initialize SCM version file", ioe);
        return false;
      }
    } else {
      System.out.println("SCM already initialized. Reusing existing" +
          " cluster id for sd=" + scmStorage.getStorageDir() + ";cid="
              + scmStorage.getClusterID());
      return true;
    }
  }
/**
   * Routine to set up the Version info for StorageContainerManager.
   *
   * @param conf OzoneConfiguration
   * @return true if SCM initialization is successful, false otherwise.
   * @throws IOException if init fails due to I/O error
   */
Routine to set up the Version info for StorageContainerManager.
@param conf OzoneConfiguration
@return true if SCM initialization is successful, false otherwise.
@throws IOException if init fails due to I/O error
Routine to set up the Version info for StorageContainerManager . @param conf OzoneConfiguration @return true if SCM initialization is successful false otherwise . @throws IOException if init fails due to I / O error
public static boolean scmInit(OzoneConfiguration conf) throws IOException {
    SCMStorage scmStorage = new SCMStorage(conf);
    StorageState state = scmStorage.getState();
    if (state != StorageState.INITIALIZED) {
      try {
        String clusterId = StartupOption.INIT.getClusterId();
        if (clusterId != null && !clusterId.isEmpty()) {
          scmStorage.setClusterId(clusterId);
        }
        scmStorage.initialize();
        System.out.println("SCM initialization succeeded." +
            "Current cluster id for sd=" + scmStorage.getStorageDir() + ";cid="
                + scmStorage.getClusterID());
        return true;
      } catch (IOException ioe) {
        LOG.error("Could not initialize SCM version file", ioe);
        return false;
      }
    } else {
      System.out.println("SCM already initialized. Reusing existing" +
          " cluster id for sd=" + scmStorage.getStorageDir() + ";cid="
              + scmStorage.getClusterID());
      return true;
    }
  }
public static boolean scmInit ( OzoneConfiguration conf ) throws IOException { SCMStorage scmStorage = new SCMStorage ( conf ) ; StorageState state = scmStorage . getState ( ) ; if ( state != StorageState . INITIALIZED ) { try { String clusterId = StartupOption . INIT . getClusterId ( ) ; if ( clusterId != null && ! clusterId . isEmpty ( ) ) { scmStorage . setClusterId ( clusterId ) ; } scmStorage . initialize ( ) ; System . out . println ( "SCM initialization succeeded." + "Current cluster id for sd=" + scmStorage . getStorageDir ( ) + ";cid=" + scmStorage . getClusterID ( ) ) ; return true ; } catch ( IOException ioe ) { LOG . error ( "Could not initialize SCM version file" , ioe ) ; return false ; } } else { System . out . println ( "SCM already initialized. Reusing existing" + " cluster id for sd=" + scmStorage . getStorageDir ( ) + ";cid=" + scmStorage . getClusterID ( ) ) ; return true ; } }
Routine to set up the Version info for StorageContainerManager.
Routine to set up the Version info for StorageContainerManager .