code: private URI getStoreRoot(FileSystem fs, URI configKey) throws ConfigStoreCreationException {
      if (Strings.isNullOrEmpty(configKey.getAuthority())) {
        if (getDefaultStoreURILazy() != null) {
          return getDefaultStoreURILazy();
        } else if (isAuthorityRequired()) {
          throw new ConfigStoreCreationException(configKey, "No default store has been configured.");
        }
      }
  
      Path path = new Path(configKey.getPath());
  
      while (path != null) {
        try {
          // the abs URI may point to an unexist path for
          // 1. phantom node
          // 2. as URI did not specify the version
          if (fs.exists(path)) {
            for (FileStatus fileStatus : fs.listStatus(path)) {
              if (fileStatus.isDirectory()
                  && fileStatus.getPath().getName().equals(SimpleHadoopFilesystemConfigStore.CONFIG_STORE_NAME)) {
                return fs.getUri().resolve(fileStatus.getPath().getParent().toUri());
              }
            }
          }
        } catch (IOException e) {
          throw new ConfigStoreCreationException(configKey, e);
        }
  
        path = path.getParent();
      }
      throw new ConfigStoreCreationException(configKey, "Cannot find the store root!");
    }
docs: This method determines the physical location of the {@link SimpleHadoopFilesystemConfigStore} root directory on HDFS. It does
  this by taking the {@link URI} given by the user and back-tracing the path. It checks if each parent directory
  contains the folder {@link SimpleHadoopFilesystemConfigStore#CONFIG_STORE_NAME}. It the assumes this {@link Path} is the root
  directory.
  
  <p>
  If the given configKey does not have an authority, then this method assumes the given {@link URI#getPath()} does
  not contain the dataset root. In which case it uses the {@link #getDefaultRootDir()} as the root directory. If
  the default root dir does not contain the {@link SimpleHadoopFilesystemConfigStore#CONFIG_STORE_NAME} then a
  {@link ConfigStoreCreationException} is thrown.
  </p>