@Override
  public Config getOwnConfig(ConfigKeyPath configKey, String version) throws VersionDoesNotExistException {
    Preconditions.checkNotNull(configKey, "configKey cannot be null!");
    Preconditions.checkArgument(!Strings.isNullOrEmpty(version), "version cannot be null or empty!");

    Path datasetDir = getDatasetDirForKey(configKey, version);
    Path mainConfFile = new Path(datasetDir, MAIN_CONF_FILE_NAME);

    try {
      if (!this.fs.exists(mainConfFile)) {
        return ConfigFactory.empty();
      }

      FileStatus configFileStatus = this.fs.getFileStatus(mainConfFile);
      if (!configFileStatus.isDirectory()) {
        try (InputStream mainConfInputStream = this.fs.open(configFileStatus.getPath())) {
          return ConfigFactory.parseReader(new InputStreamReader(mainConfInputStream, Charsets.UTF_8));
        }
      }
      return ConfigFactory.empty();
    } catch (IOException e) {
      throw new RuntimeException(String.format("Error while getting config for configKey: \"%s\"", configKey), e);
    }
  }
@ Override public Config getOwnConfig ( ConfigKeyPath configKey , String version ) throws VersionDoesNotExistException { Preconditions . checkNotNull ( configKey , "configKey cannot be null!" ) ; Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( version ) , "version cannot be null or empty!" ) ; Path datasetDir = getDatasetDirForKey ( configKey , version ) ; Path mainConfFile = new Path ( datasetDir , MAIN_CONF_FILE_NAME ) ; try { if ( ! this . fs . exists ( mainConfFile ) ) { return ConfigFactory . empty ( ) ; } FileStatus configFileStatus = this . fs . getFileStatus ( mainConfFile ) ; if ( ! configFileStatus . isDirectory ( ) ) { try ( InputStream mainConfInputStream = this . fs . open ( configFileStatus . getPath ( ) ) ) { return ConfigFactory . parseReader ( new InputStreamReader ( mainConfInputStream , Charsets . UTF_8 ) ) ; } } return ConfigFactory . empty ( ) ; } catch ( IOException e ) { throw new RuntimeException ( String . format ( "Error while getting config for configKey: \"%s\"" , configKey ) , e ) ; } }
Retrieves the {@link Config} for the given {@link ConfigKeyPath} by reading the {@link #MAIN_CONF_FILE_NAME}
associated with the dataset specified by the given {@link ConfigKeyPath}. If the {@link Path} described by the
{@link ConfigKeyPath} does not exist then an empty {@link Config} is returned.

@param  configKey      the config key path whose properties are needed.
@param  version        the configuration version in the configuration store.

@return a {@link Config} for the given configKey.

@throws VersionDoesNotExistException if the version specified cannot be found in the {@link ConfigStore}.