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>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRunMap.Constructor<R extends Run<?,R>>Runfactory.-
Nested classes/interfaces inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
AbstractLazyLoadRunMap.Direction
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Comparable>COMPARATORDeprecated.as of 1.485 UseComparator.reverseOrder()RunIdMigratorrunIdMigratorNormally overwritten byLazyBuildMixIn.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)orLazyBuildMixIn.onCreatedFromScratch(), in turn created duringJob.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String).-
Fields inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
dir
-
-
Constructor Summary
Constructors Constructor Description RunMap()Deprecated.as of 1.485 UseRunMap(Job, Constructor).RunMap(Job<?,?> job)RunMap(Job<?,?> job, RunMap.Constructor cons)RunMap(File baseDir, RunMap.Constructor cons)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleanallowLoad(int buildNumber)protected BuildReference<R>createReference(R r)Reuses the same reference as much as we can.RgetById(String id)protected StringgetIdOf(R r)Subtype 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.SortedMap<Integer,R>getView()Gets the read-only view of this map.Iterator<R>iterator()Walks through builds, newer ones first.voidload(Job job, RunMap.Constructor<R> cons)Deprecated.as of 1.485 UseRunMap(File, Constructor)RnewestValue()This is the newest build (with the biggest build number)RoldestValue()This is the oldest build (with the smallest build number)Rput(R r)Add a new build to the map.booleanremove(R run)booleanremoveValue(R run)protected Rretrieve(File d)ParsesRinstance from data in the specified directory.-
Methods inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
_put, baseDirInitialized, comparator, entrySet, equals, firstKey, get, get, getByNumber, getLoadedBuilds, hashCode, headMap, initBaseDir, isEmpty, keySet, lastKey, maxNumberOnDisk, newestBuild, oldestBuild, proposeNewNumber, purgeCache, put, putAll, recognizeNumber, reset, runExists, search, subMap, tailMap, updateBaseDir, values
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, remove, size, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getOrDefault, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
-
-
-
Field Detail
-
runIdMigrator
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public RunIdMigrator runIdMigrator
Normally overwritten byLazyBuildMixIn.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)orLazyBuildMixIn.onCreatedFromScratch(), in turn created duringJob.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String).
-
COMPARATOR
@Deprecated public static final Comparator<Comparable> COMPARATOR
Deprecated.as of 1.485 UseComparator.reverseOrder()
-
-
Constructor Detail
-
RunMap
@Deprecated public RunMap()
Deprecated.as of 1.485 UseRunMap(Job, Constructor).
-
RunMap
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public RunMap(@NonNull Job<?,?> job)
-
RunMap
public RunMap(@NonNull Job<?,?> job, RunMap.Constructor cons)- Parameters:
cons- Used to create new instance ofRun.- Since:
- 2.451
-
RunMap
@Deprecated public RunMap(File baseDir, RunMap.Constructor cons)
Deprecated.
-
-
Method Detail
-
remove
public boolean remove(R run)
-
removeValue
public boolean removeValue(R run)
- Overrides:
removeValuein classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
newestValue
public R newestValue()
This is the newest build (with the biggest build number)
-
oldestValue
public R oldestValue()
This is the oldest build (with the smallest build number)
-
getNumberOf
protected int getNumberOf(R r)
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
protected String getIdOf(R r)
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
public R put(R r)
Add a new build to the map. Do not use when loading existing builds (useAbstractLazyLoadRunMap.put(Integer, Object)).- Overrides:
putin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
getById
public R getById(String id)
- Overrides:
getByIdin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
createReference
protected BuildReference<R> createReference(R r)
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
protected boolean allowLoad(int buildNumber)
- Overrides:
allowLoadin classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
retrieve
protected R retrieve(File d) throws IOException
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.
-
load
@Deprecated public void load(Job job, RunMap.Constructor<R> cons)
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.
-
-