Class MostUsableSpaceStrategy
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<DiskAllocationStrategy>
-
- org.jenkinsci.plugins.ewm.DiskAllocationStrategy
-
- org.jenkinsci.plugins.ewm.strategies.MostUsableSpaceStrategy
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<DiskAllocationStrategy>
@Extension public class MostUsableSpaceStrategy extends DiskAllocationStrategy
DiskAllocationStrategy
implementation that allocates the disk with the most usable space.- Author:
- Alexandru Somai
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MostUsableSpaceStrategy.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description MostUsableSpaceStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Disk
allocateDisk(List<Disk> disks)
Allocates a disk from the given list.void
setEstimatedWorkspaceSize(long estimatedWorkspaceSize)
Sets the estimated workspace size.-
Methods inherited from class org.jenkinsci.plugins.ewm.DiskAllocationStrategy
all, allDescriptors, getEstimatedWorkspaceSize, retrieveUsableSpaceInBytes, retrieveUsableSpaceInMegaBytes
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Method Detail
-
setEstimatedWorkspaceSize
@DataBoundSetter public void setEstimatedWorkspaceSize(long estimatedWorkspaceSize)
Description copied from class:DiskAllocationStrategy
Sets the estimated workspace size. It must be set in MB.- Overrides:
setEstimatedWorkspaceSize
in classDiskAllocationStrategy
- Parameters:
estimatedWorkspaceSize
- the estimated workspace size in MB
-
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
-
-