|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.util.KeyedDataStorage<Fingerprint,hudson.model.FingerprintMap.FingerprintParams>
hudson.model.FingerprintMap
public final class FingerprintMap
Cache of Fingerprint
s.
This implementation makes sure that no two Fingerprint
objects
lie around for the same hash code, and that unused Fingerprint
will be adequately GC-ed to prevent memory leak.
Jenkins.getFingerprintMap()
Field Summary |
---|
Fields inherited from class hudson.util.KeyedDataStorage |
---|
cacheHit, loadFailure, totalQuery, weakRefLost |
Constructor Summary | |
---|---|
FingerprintMap()
|
Method Summary | |
---|---|
protected Fingerprint |
create(String md5sum,
hudson.model.FingerprintMap.FingerprintParams createParams)
Creates a new data object. |
protected Fingerprint |
get(String md5sum,
boolean createIfNotExist,
hudson.model.FingerprintMap.FingerprintParams createParams)
Implementation of get/getOrCreate. |
Fingerprint |
getOrCreate(AbstractBuild build,
String fileName,
byte[] md5sum)
|
Fingerprint |
getOrCreate(AbstractBuild build,
String fileName,
String md5sum)
|
Fingerprint |
getOrCreate(Run build,
String fileName,
String md5sum)
|
boolean |
isReady()
Returns true if there's some data in the fingerprint database. |
protected Fingerprint |
load(String key)
Attempts to load an existing data object from disk. |
Methods inherited from class hudson.util.KeyedDataStorage |
---|
get, getOrCreate, getPerformanceStats, resetPerformanceStats |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FingerprintMap()
Method Detail |
---|
public boolean isReady()
public Fingerprint getOrCreate(AbstractBuild build, String fileName, byte[] md5sum) throws IOException
build
- set to non-null if Fingerprint
to be created (if so)
will have this build as the owner. Otherwise null, to indicate
an owner-less build.
IOException
public Fingerprint getOrCreate(AbstractBuild build, String fileName, String md5sum) throws IOException
IOException
public Fingerprint getOrCreate(Run build, String fileName, String md5sum) throws IOException
IOException
protected Fingerprint get(String md5sum, boolean createIfNotExist, hudson.model.FingerprintMap.FingerprintParams createParams) throws IOException
KeyedDataStorage
get
in class KeyedDataStorage<Fingerprint,hudson.model.FingerprintMap.FingerprintParams>
IOException
protected Fingerprint create(String md5sum, hudson.model.FingerprintMap.FingerprintParams createParams) throws IOException
KeyedDataStorage
This method is called by KeyedDataStorage.getOrCreate(String,Object)
if the data that matches the specified key does not exist.
Because of concurrency, another thread might call KeyedDataStorage.get(String)
as soon as a new data object is created, so it's important that
this method returns a properly initialized "valid" object.
create
in class KeyedDataStorage<Fingerprint,hudson.model.FingerprintMap.FingerprintParams>
IOException
- if the method fails to create a new data object, it can throw
IOException
(or any other exception) and that will be
propagated to the caller.protected Fingerprint load(String key) throws IOException
KeyedDataStorage
KeyedDataStorage
class serializes the requests so that
no two threads call the KeyedDataStorage.load(String)
method with the
same parameter concurrently. This ensures that there's only
up to one data object for any key.
load
in class KeyedDataStorage<Fingerprint,hudson.model.FingerprintMap.FingerprintParams>
IOException
- if load operation fails. This exception will be
propagated to the caller.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |