public class FileIDMigrator extends AbstractIDMigrator
An IDMigrator backed by a file.
This class typically expects a file where each line
contains a single stringID to be stored in this migrator.
This class will reload data from the data file when refresh(Collection) is called, unless the file
has been reloaded very recently already.
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_MIN_RELOAD_INTERVAL_MS |
| Constructor and Description |
|---|
FileIDMigrator(File dataFile) |
FileIDMigrator(File dataFile,
long minReloadIntervalMS) |
| Modifier and Type | Method and Description |
|---|---|
void |
refresh(Collection<Refreshable> alreadyRefreshed)
Triggers "refresh" -- whatever that means -- of the implementation.
|
String |
toString() |
String |
toStringID(long longID) |
hash, toLongIDpublic static final long DEFAULT_MIN_RELOAD_INTERVAL_MS
public FileIDMigrator(File dataFile) throws FileNotFoundException
FileNotFoundExceptionpublic FileIDMigrator(File dataFile, long minReloadIntervalMS) throws FileNotFoundException
FileNotFoundExceptionpublic String toStringID(long longID)
public void refresh(Collection<Refreshable> alreadyRefreshed)
Refreshable
Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that any
Refreshable should always leave itself in a consistent, operational state, and that the refresh
atomically updates internal state from old to new.
refresh in interface Refreshablerefresh in class AbstractIDMigratoralreadyRefreshed - Refreshables that are known to have already been
refreshed as a result of an initial call to a {#refresh(Collection)} method on some
object. This ensure that objects in a refresh dependency graph aren't refreshed twice
needlessly.Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.