private QuorumStateData readStateFromFile(File file) {
        try (final BufferedReader reader = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) {
            final String line = reader.readLine();
            if (line == null) {
                throw new EOFException("File ended prematurely.");
            }

            final ObjectMapper objectMapper = new ObjectMapper();
            JsonNode readNode = objectMapper.readTree(line);

            if (!(readNode instanceof ObjectNode)) {
                throw new IOException("Deserialized node " + readNode +
                    " is not an object node");
            }
            final ObjectNode dataObject = (ObjectNode) readNode;

            JsonNode dataVersionNode = dataObject.get(DATA_VERSION);
            if (dataVersionNode == null) {
                throw new IOException("Deserialized node " + readNode +
                    " does not have " + DATA_VERSION + " field");
            }

            final short dataVersion = dataVersionNode.shortValue();
            if (dataVersion < LOWEST_SUPPORTED_VERSION || dataVersion > HIGHEST_SUPPORTED_VERSION) {
                throw new IllegalStateException(
                    String.format(
                        "data_version (%d) is not within the min (%d) and max (%d) supported version",
                        dataVersion,
                        LOWEST_SUPPORTED_VERSION,
                        HIGHEST_SUPPORTED_VERSION
                    )
                );
            }

            return QuorumStateDataJsonConverter.read(dataObject, dataVersion);
        } catch (IOException e) {
            throw new UncheckedIOException(
                String.format("Error while reading the Quorum status from the file %s", file), e);
        }
    }
Local file based quorum state store. It takes the JSON format of {@link QuorumStateData}
with an extra data version number field (data_version) as part of the data.

Example version 0 format:
<pre>
{
  "clusterId": "",
  "leaderId": 1,
  "leaderEpoch": 2,
  "votedId": -1,
  "appliedOffset": 0,
  "currentVoters": [],
  "data_version": 0
}
</pre>

Example version 1 format:
<pre>
{
  "leaderId": -1,
  "leaderEpoch": 2,
  "votedId": 1,
  "votedDirectoryId": "J8aAPcfLQt2bqs1JT_rMgQ",
  "data_version": 1
}
</pre>
raft/src/main/java/org/apache/kafka/raft/FileQuorumStateStore.java