@Override
  public void truncate(long size) {
    try (FileOutputStream outputStream =
        new FileOutputStream(FSFactoryProducer.getFSFactory().getFile(filePath), true)) {
      outputStream.getChannel().truncate(size);
      logger.warn("The modifications[{}] will be truncated to size {}.", filePath, size);
    } catch (FileNotFoundException e) {
      logger.debug(NO_MODIFICATION_MSG, filePath);
    } catch (IOException e) {
      logger.error(
          "An error occurred when truncating modifications[{}] to size {}.", filePath, size, e);
    }
  }
Construct a LocalTextModificationAccessor using a file specified by filePath.

@param filePath the path of the file that is used for storing modifications.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/modification/v1/io/LocalTextModificationAccessor.java