public void processLoadSnapshot(final File snapshotDir) throws TException, IOException {

    final File snapshotFile = new File(snapshotDir, SNAPSHOT_FILENAME);
    if (!snapshotFile.exists() || !snapshotFile.isFile()) {
      LOGGER.error(
          "Failed to load snapshot,snapshot file [{}] is not exist.",
          snapshotFile.getAbsolutePath());
      return;
    }

    try (final BufferedInputStream fileInputStream =
            new BufferedInputStream(
                Files.newInputStream(snapshotFile.toPath()), PARTITION_TABLE_BUFFER_SIZE);
        final TIOStreamTransport tioStreamTransport = new TIOStreamTransport(fileInputStream)) {
      final TProtocol protocol = new TBinaryProtocol(tioStreamTransport);
      // before restoring a snapshot, clear all old data
      clear();

      // start to restore
      nextRegionGroupId.set(ReadWriteIOUtils.readInt(fileInputStream));

      // restore databasePartitionTable
      int length = ReadWriteIOUtils.readInt(fileInputStream);
      for (int i = 0; i < length; i++) {
        final String database = ReadWriteIOUtils.readString(fileInputStream);
        if (database == null) {
          throw new IOException("Failed to load snapshot because get null database name");
        }
        final DatabasePartitionTable databasePartitionTable = new DatabasePartitionTable(database);
        databasePartitionTable.deserialize(fileInputStream, protocol);
        databasePartitionTables.put(database, databasePartitionTable);
      }

      // restore deletedRegionSet
      length = ReadWriteIOUtils.readInt(fileInputStream);
      for (int i = 0; i < length; i++) {
        final RegionMaintainTask task =
            RegionMaintainTask.Factory.create(fileInputStream, protocol);
        regionMaintainTaskList.add(task);
      }
    }
  }
Get the last DataAllotTable of the specified Database.

@param database The specified Database
@return The last DataAllotTable
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java