synchronized Optional<URL> getHiveSiteLocation() {
      try {
        Path confPath = generateKrbConfPath();
        if (ArrayUtils.isEmpty(metaStoreSite)) {
          return Optional.empty();
        }
        Path hiveSitePath = Paths.get(confPath.toAbsolutePath().toString(), "hive-site.xml");
        if (!hiveSitePath.toFile().exists()) {
          hiveSitePath =
              Paths.get(saveConfInPath(confPath, META_STORE_SITE_FILE_NAME, metaStoreSite));
        }
        org.apache.hadoop.fs.Path hadoopPath =
            new org.apache.hadoop.fs.Path(hiveSitePath.toAbsolutePath().toString());
        org.apache.hadoop.fs.Path hadoopPathWithSchema =
            new org.apache.hadoop.fs.Path("file://" + hadoopPath.toUri().toString());
        return Optional.of(hadoopPathWithSchema.toUri().toURL());
      } catch (MalformedURLException e) {
        throw new RuntimeException("Failed to generate hive site location", e);
      }
    }
Login with configured catalog user and create a proxy user ugi. Then the operations are
performed within the doAs method of this proxy user ugi.
amoro-common/src/main/java/org/apache/amoro/table/TableMetaStore.java