public static void writeOutput(List<List<String>> listValues, Path outputFile, HiveConf hiveConf, boolean update)
          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, update);
          for (List<String> values : listValues) {
            outStream.writeBytes((values.get(0) == null ? Utilities.nullStringOutput : values.get(0)));
            for (int i = 1; i < values.size(); i++) {
              outStream.write(Utilities.tabCode);
              outStream.writeBytes((values.get(i) == null ? Utilities.nullStringOutput : values.get(i)));
            }
            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