public synchronized boolean contains(TsFileResource tsFile, boolean isClosed) {
    return (isClosed && closedFileReaderMap.containsKey(tsFile.getTsFilePath()))
        || (!isClosed && unclosedFileReaderMap.containsKey(tsFile.getTsFilePath()));
  }
This method is only for unit tests.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/read/control/FileReaderManager.java