public static void writeOutput(String content, Path outputFile, HiveConf hiveConf)
          throws SemanticException {
    Retryable retryable = Retryable.builder()
      .withHiveConf(hiveConf)
      .withRetryOnException(IOException.class).build();
    try {
      retryable.executeCallable((Callable<Void>) () -> {
        DataOutputStream outStream = null;
        try {
          FileSystem fs = outputFile.getFileSystem(hiveConf);
          outStream = fs.create(outputFile);
          outStream.writeBytes(content);
          outStream.write(Utilities.newLineCode);
        } finally {
          if (outStream != null) {
            outStream.close();
          }
        }
        return null;
      });
    } catch (Exception e) {
      throw new SemanticException(e);
    }
  }
Given a ReplChangeManger's encoded uri, it replaces the nameservice and returns the modified encoded uri.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java