Class AbstractDiskSpeedStrategy
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<DiskAllocationStrategy>
-
- org.jenkinsci.plugins.ewm.DiskAllocationStrategy
-
- org.jenkinsci.plugins.ewm.strategies.AbstractDiskSpeedStrategy
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<DiskAllocationStrategy>
- Direct Known Subclasses:
FastestReadSpeedStrategy
,FastestWriteSpeedStrategy
public abstract class AbstractDiskSpeedStrategy extends DiskAllocationStrategy
Base class that selects theDisk
with the highest speed provided by thegetDiskSpeed(DiskInfoProvider)
method- Author:
- Alexandru Somai
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description AbstractDiskSpeedStrategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Disk
allocateDisk(List<Disk> disks)
Allocates a disk from the given list.protected abstract int
getDiskSpeed(DiskInfoProvider diskInfo)
Override this method to return the speed property on which the selection should be made.-
Methods inherited from class org.jenkinsci.plugins.ewm.DiskAllocationStrategy
all, allDescriptors, getEstimatedWorkspaceSize, retrieveUsableSpaceInBytes, retrieveUsableSpaceInMegaBytes, setEstimatedWorkspaceSize
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Method Detail
-
allocateDisk
@Nonnull public Disk allocateDisk(@Nonnull List<Disk> disks) throws IOException
Description copied from class:DiskAllocationStrategy
Allocates a disk from the given list. The list contains at least oneDisk
entry.- Specified by:
allocateDisk
in classDiskAllocationStrategy
- Parameters:
disks
- the entries from which to allocate a disk. The list has at least one element- Returns:
- the selected disk
- Throws:
IOException
- if any mandatory field is missing from theDisk
entry, or if the disk allocation fails for any reason
-
getDiskSpeed
protected abstract int getDiskSpeed(@Nonnull DiskInfoProvider diskInfo)
Override this method to return the speed property on which the selection should be made.- Parameters:
diskInfo
- theDiskInfoProvider
that contains R/WDisk
speed- Returns:
- the value represented by the R/W speed
-
-