test_class.declarator: factory
test_class.modifier: private
test_class.original_string: private BloomFilterFactory factory;
test_class.type: BloomFilterFactory
test_class.var_name: factory
test_class.declarator: tempDirPath
test_class.modifier: private
test_class.original_string: private Path tempDirPath;
test_class.type: Path
test_class.var_name: tempDirPath
test_class.declarator: filterManager
test_class.modifier: private
test_class.original_string: private BloomFilterManager filterManager;
test_class.type: BloomFilterManager
test_class.var_name: filterManager
test_class.declarator: manager
test_class.modifier: private
test_class.original_string: private PersistentManager<BloomFilter> manager;
test_class.type: PersistentManager<BloomFilter>
test_class.var_name: manager
test_class.file: filter-service-core/src/test/java/cn/leancloud/filter/service/PersistentManagerTest.java
test_class.identifier: PersistentManagerTest
test_case.body: @Test
      public void testNoFilesToRecover() throws IOException {
          manager.recoverFilters(factory, true);
          verify(filterManager, never()).addFilters(anyCollection());
      }
test_case.class_method_signature: PersistentManagerTest.testNoFilesToRecover()
test_case.full_signature: @Test public void testNoFilesToRecover()
test_case.identifier: testNoFilesToRecover
test_case.invocations: recoverFilters addFilters verify never anyCollection
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNoFilesToRecover()
focal_class.declarator: logger = LoggerFactory.getLogger(PersistentManager.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(PersistentManager.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: LOCK_FILE_NAME = "lock"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOCK_FILE_NAME = "lock";
focal_class.type: String
focal_class.var_name: LOCK_FILE_NAME
focal_class.declarator: TEMPORARY_PERSISTENT_FILE_SUFFIX = ".tmp"
focal_class.modifier: private static final
focal_class.original_string: private static final String TEMPORARY_PERSISTENT_FILE_SUFFIX = ".tmp";
focal_class.type: String
focal_class.var_name: TEMPORARY_PERSISTENT_FILE_SUFFIX
focal_class.declarator: PERSISTENT_FILE_SUFFIX = ".db"
focal_class.modifier: private static final
focal_class.original_string: private static final String PERSISTENT_FILE_SUFFIX = ".db";
focal_class.type: String
focal_class.var_name: PERSISTENT_FILE_SUFFIX
focal_class.declarator: PERSISTENT_FILE_NAME = "snapshot"
focal_class.modifier: private static final
focal_class.original_string: private static final String PERSISTENT_FILE_NAME = "snapshot";
focal_class.type: String
focal_class.var_name: PERSISTENT_FILE_NAME
focal_class.declarator: basePath
focal_class.modifier: private final
focal_class.original_string: private final Path basePath;
focal_class.type: Path
focal_class.var_name: basePath
focal_class.declarator: fileLock
focal_class.modifier: private final
focal_class.original_string: private final FileLock fileLock;
focal_class.type: FileLock
focal_class.var_name: fileLock
focal_class.file: filter-service-core/src/main/java/cn/leancloud/filter/service/PersistentManager.java
focal_class.identifier: PersistentManager
focal_class.interfaces: implements Closeable
focal_class.class_method_signature: PersistentManager.PersistentManager(Path persistentPath)
focal_class.full_signature:   PersistentManager(Path persistentPath)
focal_class.identifier: PersistentManager
focal_class.parameters: (Path persistentPath)
focal_class.signature:  PersistentManager(Path persistentPath)
focal_class.class_method_signature: PersistentManager.freezeAllFilters(Iterable<FilterRecord<F>> records)
focal_class.full_signature: synchronized void freezeAllFilters(Iterable<FilterRecord<F>> records)
focal_class.identifier: freezeAllFilters
focal_class.modifiers: synchronized
focal_class.parameters: (Iterable<FilterRecord<F>> records)
focal_class.return: void
focal_class.signature: void freezeAllFilters(Iterable<FilterRecord<F>> records)
focal_class.class_method_signature: PersistentManager.recoverFilters(BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
focal_class.full_signature: synchronized List<FilterRecord<? extends F>> recoverFilters(BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
focal_class.identifier: recoverFilters
focal_class.modifiers: synchronized
focal_class.parameters: (BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
focal_class.return: List<FilterRecord<? extends F>>
focal_class.signature: List<FilterRecord<? extends F>> recoverFilters(BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
focal_class.class_method_signature: PersistentManager.close()
focal_class.full_signature: @Override public synchronized void close()
focal_class.identifier: close
focal_class.modifiers: @Override public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: PersistentManager.temporaryPersistentFilePath()
focal_class.full_signature:  Path temporaryPersistentFilePath()
focal_class.identifier: temporaryPersistentFilePath
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path temporaryPersistentFilePath()
focal_class.class_method_signature: PersistentManager.persistentFilePath()
focal_class.full_signature:  Path persistentFilePath()
focal_class.identifier: persistentFilePath
focal_class.parameters: ()
focal_class.return: Path
focal_class.signature: Path persistentFilePath()
focal_class.class_method_signature: PersistentManager.recoverFiltersFromFile(BloomFilterFactory<? extends F, ?> factory,
                                                                     boolean allowRecoverFromCorruptedFile,
                                                                     Path filePath)
focal_class.full_signature: private List<FilterRecord<? extends F>> recoverFiltersFromFile(BloomFilterFactory<? extends F, ?> factory,
                                                                     boolean allowRecoverFromCorruptedFile,
                                                                     Path filePath)
focal_class.identifier: recoverFiltersFromFile
focal_class.modifiers: private
focal_class.parameters: (BloomFilterFactory<? extends F, ?> factory,
                                                                     boolean allowRecoverFromCorruptedFile,
                                                                     Path filePath)
focal_class.return: List<FilterRecord<? extends F>>
focal_class.signature: List<FilterRecord<? extends F>> recoverFiltersFromFile(BloomFilterFactory<? extends F, ?> factory,
                                                                     boolean allowRecoverFromCorruptedFile,
                                                                     Path filePath)
focal_class.class_method_signature: PersistentManager.readFiltersFromFile(FilterRecordInputStream<? extends F> filterStream)
focal_class.full_signature: private Iterable<FilterRecord<? extends F>> readFiltersFromFile(FilterRecordInputStream<? extends F> filterStream)
focal_class.identifier: readFiltersFromFile
focal_class.modifiers: private
focal_class.parameters: (FilterRecordInputStream<? extends F> filterStream)
focal_class.return: Iterable<FilterRecord<? extends F>>
focal_class.signature: Iterable<FilterRecord<? extends F>> readFiltersFromFile(FilterRecordInputStream<? extends F> filterStream)
focal_method.body: synchronized List<FilterRecord<? extends F>> recoverFilters(BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
              throws IOException {
          final List<FilterRecord<? extends F>> records = new ArrayList<>();
          if (persistentFilePath().toFile().exists()) {
              records.addAll(recoverFiltersFromFile(factory, allowRecoverFromCorruptedFile, persistentFilePath()));
          }
  
          if (temporaryPersistentFilePath().toFile().exists()) {
              try {
                  records.addAll(recoverFiltersFromFile(factory, allowRecoverFromCorruptedFile, temporaryPersistentFilePath()));
              } catch (IOException | PersistentStorageException ex) {
                  logger.warn("Failed to recover from the file: \"{}\" and got error msg: \"{}\". We just ignore it and carry on.",
                          temporaryPersistentFilePath(), ex.getMessage());
              }
          }
  
          return records;
      }
focal_method.class_method_signature: PersistentManager.recoverFilters(BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
focal_method.full_signature: synchronized List<FilterRecord<? extends F>> recoverFilters(BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
focal_method.identifier: recoverFilters
focal_method.invocations: exists toFile persistentFilePath addAll recoverFiltersFromFile persistentFilePath exists toFile temporaryPersistentFilePath addAll recoverFiltersFromFile temporaryPersistentFilePath warn temporaryPersistentFilePath getMessage
focal_method.modifiers: synchronized
focal_method.parameters: (BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)
focal_method.return: List<FilterRecord<? extends F>>
focal_method.signature: List<FilterRecord<? extends F>> recoverFilters(BloomFilterFactory<? extends F, ?> factory,
                                                                  boolean allowRecoverFromCorruptedFile)