Package hudson.model
Class RunMap<R extends Run<?,R>>
java.lang.Object
java.util.AbstractMap<Integer,R>
jenkins.model.lazy.AbstractLazyLoadRunMap<R>
hudson.model.RunMap<R>
public final class RunMap<R extends Run<?,R>>
extends AbstractLazyLoadRunMap<R>
implements Iterable<R>
Map from build number to Run.
This class is multi-thread safe by using copy-on-write technique,
and it also updates the bi-directional links within Run
accordingly.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRunMap.Constructor<R extends Run<?,R>> Runfactory.Nested classes/interfaces inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
AbstractLazyLoadRunMap.DirectionNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsFields inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
dir -
Constructor Summary
ConstructorsConstructorDescriptionRunMap()Deprecated.as of 1.485 UseRunMap(Job, Constructor).RunMap(Job<?, ?> job, RunMap.Constructor<R> cons) RunMap(File baseDir, RunMap.Constructor<R> cons) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanallowLoad(int buildNumber) protected IntPredicateprotected BuildReference<R> createReference(R r) Reuses the same reference as much as we can.protected StringSubtype to provideRun.getId()so that this class doesn't have to depend on it.protected intgetNumberOf(R r) Subtype to provideRun.getNumber()so that this class doesn't have to depend on it.getView()Gets the read-only view of this map.iterator()Walks through builds, newer ones first.voidload(Job job, RunMap.Constructor<R> cons) Deprecated.as of 1.485 UseRunMap(File, Constructor)This is the newest build (with the biggest build number)This is the oldest build (with the smallest build number)Add a new build to the map.booleanbooleanremoveValue(R run) protected RParsesRinstance from data in the specified directory.Methods inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
_put, baseDirInitialized, comparator, containsKey, containsValue, entrySet, equals, firstKey, get, get, getByNumber, getLoadedBuilds, hashCode, headMap, initBaseDir, isEmpty, keySet, lastKey, maxNumberOnDisk, newestBuild, oldestBuild, proposeNewNumber, purgeCache, put, putAll, recognizeNumber, remove, reset, runExists, search, subMap, tailMap, updateBaseDir, valuesMethods inherited from class java.util.AbstractMap
clear, clone, size, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
Field Details
-
COMPARATOR
Deprecated.as of 1.485 UseComparator.reverseOrder()
-
-
Constructor Details
-
RunMap
Deprecated.as of 1.485 UseRunMap(Job, Constructor). -
RunMap
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public RunMap(@NonNull Job<?, ?> job) -
RunMap
- Parameters:
cons- Used to create new instance ofRun.- Since:
- 2.451
-
RunMap
Deprecated.
-
-
Method Details
-
remove
-
iterator
Walks through builds, newer ones first. -
removeValue
- Overrides:
removeValuein classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
getView
Gets the read-only view of this map. -
newestValue
This is the newest build (with the biggest build number) -
oldestValue
This is the oldest build (with the smallest build number) -
getNumberOf
Description copied from class:AbstractLazyLoadRunMapSubtype to provideRun.getNumber()so that this class doesn't have to depend on it.- Specified by:
getNumberOfin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
getIdOf
Description copied from class:AbstractLazyLoadRunMapSubtype to provideRun.getId()so that this class doesn't have to depend on it.- Overrides:
getIdOfin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
put
Add a new build to the map. Do not use when loading existing builds (useAbstractLazyLoadRunMap.putAll(Map)).- Overrides:
putin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
getById
- Overrides:
getByIdin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
createReference
Reuses the same reference as much as we can.If concurrency ends up creating a few extra, that's OK, because we are really just trying to reduce the # of references we create.
- Overrides:
createReferencein classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
allowLoad
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) protected boolean allowLoad(int buildNumber) - Overrides:
allowLoadin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
createLoadAllower
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) protected IntPredicate createLoadAllower()- Overrides:
createLoadAllowerin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
retrieve
Description copied from class:AbstractLazyLoadRunMapParsesRinstance from data in the specified directory.- Specified by:
retrievein classAbstractLazyLoadRunMap<R extends Run<?,R>> - Returns:
- null if the parsing failed.
- Throws:
IOException- if the parsing failed. This is just like returning null except the caller will catch the exception and report it.
-
getBuildClass
- Specified by:
getBuildClassin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
load
Deprecated.as of 1.485 UseRunMap(File, Constructor)Backward compatibility method that notifiesRunMapof who the owner is. Traditionally, this method blocked and loaded all the build records on the disk, but now all the actual loading happens lazily.- Parameters:
job- Job that owns this map.cons- Used to create new instance ofRun.
-
Comparator.reverseOrder()