protected void storeRecord(HistoryRecord record) throws DatabaseHistoryException {
        if (record != null) {
            this.lock.write(() -> {
                if (!this.running.get()) {
                    throw new IllegalStateException("The history has been stopped and will not accept more records");
                } else {
                    try {
                        String line = this.writer.write(record.document());

                        try {
                            BufferedWriter historyWriter = Files
                                    .newBufferedWriter(this.path, StandardOpenOption.APPEND);

                            label58: {
                                try {
                                    try {
                                        historyWriter.append(line);
                                        historyWriter.newLine();
                                        this.schemaRecords.add(new SchemaRecord(record));
                                        break label58;
                                    } catch (IOException var7) {
                                        this.logger.error("Failed to add record to history at {}: {}",
                                                new Object[]{this.path, record, var7});
                                    }
                                } catch (Throwable var8) {
                                    if (historyWriter != null) {
                                        try {
                                            historyWriter.close();
                                        } catch (Throwable var6) {
                                            var8.addSuppressed(var6);
                                        }
                                    }

                                    throw var8;
                                }

                                if (historyWriter != null) {
                                    historyWriter.close();
                                }

                                return;
                            }

                            if (historyWriter != null) {
                                historyWriter.close();
                            }
                        } catch (IOException var9) {
                            throw new DatabaseHistoryException(
                                    "Unable to create writer for history file " + this.path + ": " + var9.getMessage(),
                                    var9);
                        }
                    } catch (IOException var10) {
                        this.logger.error("Failed to convert record to string: {}", record, var10);
                    }

                }
            });
        }
    }
A {@link DatabaseHistory} implementation that stores the schema history in a local file.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/utils/InLongDatabaseHistory.java