code: @Override
    public synchronized void writeToEvaluatorLog(final String formattedEntry) throws IOException {
      final Path writePath = getWritePath();
  
      // readPath is always not the writePath.
      final Path readPath = getAlternativePath(writePath);
  
      try (final FSDataOutputStream outputStream = this.fileSystem.create(writePath, true)) {
        InputStream inputStream = null;
        try {
          final InputStream newEntryInputStream = new ByteArrayInputStream(
              formattedEntry.getBytes(StandardCharsets.UTF_8));
  
          if (fileSystem.exists(readPath)) {
            inputStream = new SequenceInputStream(
                this.fileSystem.open(readPath), newEntryInputStream);
          } else {
            inputStream = newEntryInputStream;
          }
  
          IOUtils.copyBytes(inputStream, outputStream, 4096, false);
        } finally {
          outputStream.hsync();
          if (inputStream != null) {
            inputStream.close();
          }
        }
      }
    }
docs: Writes a formatted entry (addition or removal) for an Evaluator ID into the DFS evaluator log.
  The log is appended to by reading first, adding on the information, and then overwriting the entire log.
  Since the {@link FileSystem} does not support appends, this {@link DFSEvaluatorLogReaderWriter}
  uses a two-file approach, where when we write, we always overwrite the older file.
  @param formattedEntry The formatted entry (entry with evaluator ID and addition/removal information).
  @throws IOException when file cannot be written.