Interface ScoreCaching
- All Known Implementing Classes:
FileScoreCaching,TableScoreCaching,TemporaryScoreCaching
public interface ScoreCaching
Store and retrieve self-significance scores for executables specified by md5.
These are generally too expensive to compute on the fly, so this class
provides a persistence model for obtaining them. These scores also depend
on specific threshold settings, so there is a method for checking the settings.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommitSelfScore(String md5, float score) Commit a new self-significance score for an executablefloatgetSelfScore(String md5) Retrieve the self-significance score for a given executabledoubledoublevoidprefetchScores(Set<ExecutableRecord> exeSet, List<ExecutableRecord> missing) Pre-load self-scores for a set of executables.voidresetStorage(double simThresh, double sigThresh) Clear out any existing scores, and reset to an empty database
-
Method Details
-
prefetchScores
void prefetchScores(Set<ExecutableRecord> exeSet, List<ExecutableRecord> missing) throws LSHException Pre-load self-scores for a set of executables.- Parameters:
exeSet- is the set of executables to checkmissing- (optional - may be null) will contain the list of exes missing a score- Throws:
LSHException- if there are problems loading scores
-
getSelfScore
Retrieve the self-significance score for a given executable- Parameters:
md5- is the 32-character md5 string specifying the executable- Returns:
- the corresponding score
- Throws:
LSHException- if the score is not obtainable
-
commitSelfScore
Commit a new self-significance score for an executable- Parameters:
md5- is the 32-character md5 string specifying the executablescore- is the score to commit- Throws:
LSHException- if there's a problem saving the value
-
getSimThreshold
- Returns:
- similarity threshold configured with this cache OR return -1 if the score is unconfigured
- Throws:
LSHException- for problems retrieving configuration
-
getSigThreshold
- Returns:
- significance threshold configured with this cache OR return -1 if the score is unconfigured
- Throws:
LSHException- for problems retrieving configuration
-
resetStorage
Clear out any existing scores, and reset to an empty database- Parameters:
simThresh- is new similarity threshold to associate with scoressigThresh- is new significance threshold to associate with scores- Throws:
LSHException- if there is a problem modifying storage
-