public void pinMemTable(long memTableId) throws MemTablePinException {
    infoLock.lock();
    try {
      if (!memTableId2Info.containsKey(memTableId)) {
        throw new MemTablePinException(
            String.format(
                "Fail to pin memTable-%d because this memTable doesn't exist in the wal.",
                memTableId));
      }
      MemTableInfo memTableInfo = memTableId2Info.get(memTableId);
      if (!memTableInfo.isPinned()) {
        WALInsertNodeCache.getInstance().addMemTable(memTableId);
      }
      memTableInfo.pin();
    } finally {
      infoLock.unlock();
    }
  }
Pin the wal files of the given memory table. Notice: cannot pin one memTable too long,
otherwise the wal disk usage may too large.

@throws MemTablePinException If the memTable has been flushed
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/checkpoint/CheckpointManager.java