org.apache.mahout.cf.taste.impl.model.file
Class FileIDMigrator
java.lang.Object
org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator
org.apache.mahout.cf.taste.impl.model.file.FileIDMigrator
- All Implemented Interfaces:
- Refreshable, IDMigrator
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.
Method Summary |
void |
refresh(java.util.Collection<Refreshable> alreadyRefreshed)
Triggers "refresh" -- whatever that means -- of the implementation. |
java.lang.String |
toString()
|
java.lang.String |
toStringID(long longID)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_MIN_RELOAD_INTERVAL_MS
public static final long DEFAULT_MIN_RELOAD_INTERVAL_MS
- See Also:
- Constant Field Values
FileIDMigrator
public FileIDMigrator(java.io.File dataFile)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
FileIDMigrator
public FileIDMigrator(java.io.File dataFile,
long minReloadIntervalMS)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
toStringID
public java.lang.String toStringID(long longID)
- Returns:
- the string ID most recently associated with the given long ID, or null if doesn't exist
refresh
public void refresh(java.util.Collection<Refreshable> alreadyRefreshed)
- Description copied from interface:
Refreshable
Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that any
should always leave itself in a consistent, operational state, and that the refresh
atomically updates internal state from old to new.
- Specified by:
refresh
in interface Refreshable
- Overrides:
refresh
in class AbstractIDMigrator
- Parameters:
alreadyRefreshed
- s that are known to have already been
refreshed as a result of an initial call to a method on some
object. This ensure that objects in a refresh dependency graph aren't refreshed twice
needlessly.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.