Пример #1
0
  public FileIDMigrator(File dataFile, long minReloadIntervalMS) {
    longToString = new FastByIDMap<String>(100);
    this.dataFile = Preconditions.checkNotNull(dataFile);
    if (!dataFile.exists() || dataFile.isDirectory()) {
      throw new FileNotFoundException(dataFile.toString());
    }

    log.info("Creating FileReadonlyIDMigrator for file {}", dataFile);

    this.reloadLock = new ReentrantLock();
    this.lastModified = dataFile.lastModified();
    this.minReloadIntervalMS = minReloadIntervalMS;

    reload();
  }