class ToFileDumpProcessor {
    /** Date format. */
    public static final DateTimeFormatter DATE_FMT = DateTimeFormatter
        .ofPattern("yyyy_MM_dd_HH_mm_ss_SSS")
        .withZone(ZoneId.systemDefault());

    /** File name prefix. */
    public static final String PREFIX_NAME = "page_lock_dump_";

    /**
     * @param pageLockDump Dump.
     * @param dir Directory to save.
     */
    public static String toFileDump(SharedPageLockTrackerDump pageLockDump, Path dir, String name) throws IgniteCheckedException {<FILL_FUNCTION_BODY>}
}

        try {
            Files.createDirectories(dir);

            String dumpName = PREFIX_NAME + name + "_" + DATE_FMT.format(Instant.ofEpochMilli(pageLockDump.time));

            Path file = dir.resolve(dumpName);

            Files.write(file, toStringDump(pageLockDump).getBytes(StandardCharsets.UTF_8));

            return file.toAbsolutePath().toString();
        }
        catch (IOException e) {
            throw new IgniteCheckedException(e);
        }
    
<no_super_class>