Package org.ivoa.dm.execution
Class ComputeResource
java.lang.Object
org.ivoa.dm.execution.ComputeResource
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="execution:ComputeResource",
role=objectType)
public class ComputeResource
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A computational resource that can be used for executing a job.
objectType: ComputeResource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for ComputeResource, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longinserted database keyprotected Booleanwhether the resource has GPU capabilities.protected Stringthe type of GPU available, if any.protected Doublethe amount of RAM available in GB.protected Stringthe name of the compute resource.protected Integerthe number of CPU cores available. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ComputeResourcefull parameter constructor.ComputeResource(ComputeResource other) Copy Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic ComputeResourcecreate a ComputeResource in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidgetGpu()Returns gpu Attribute.Returns gpuType Attribute.getId()Returns memory Attribute.getName()Returns name Attribute.Returns numberOfCores Attribute.voidSet gpu Attribute.voidsetGpuType(String pGpuType) Set gpuType Attribute.voidSet memory Attribute.voidSet name Attribute.voidsetNumberOfCores(Integer pNumberOfCores) Set numberOfCores Attribute.voidupdateUsing(ComputeResource other) Update this object with the content of the given object.fluent setter for gpu Attribute.withGpuType(String pGpuType) fluent setter for gpuType Attribute.withMemory(Double pMemory) fluent setter for memory Attribute.fluent setter for name Attribute.withNumberOfCores(Integer pNumberOfCores) fluent setter for numberOfCores Attribute.
-
Field Details
-
_id
inserted database key -
name
@VoDml(id="execution:ComputeResource.name", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String namethe name of the compute resource. : Attribute name type ivoa:string : multiplicity 1 -
numberOfCores
@VoDml(id="execution:ComputeResource.numberOfCores", role=attribute, type="ivoa:integer", typeRole=primitiveType) protected Integer numberOfCoresthe number of CPU cores available. : Attribute numberOfCores type ivoa:integer : multiplicity 1 -
memory
@VoDml(id="execution:ComputeResource.memory", role=attribute, type="ivoa:real", typeRole=primitiveType) protected Double memorythe amount of RAM available in GB. : Attribute memory type ivoa:real : multiplicity 1 -
gpu
@VoDml(id="execution:ComputeResource.gpu", role=attribute, type="ivoa:boolean", typeRole=primitiveType) protected Boolean gpuwhether the resource has GPU capabilities. : Attribute gpu type ivoa:boolean : multiplicity 1 -
gpuType
@VoDml(id="execution:ComputeResource.gpuType", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String gpuTypethe type of GPU available, if any. : Attribute gpuType type ivoa:string : multiplicity 0..1
-
-
Constructor Details
-
ComputeResource
public ComputeResource()Creates a new ComputeResource -
ComputeResource
public ComputeResource(String name, Integer numberOfCores, Double memory, Boolean gpu, String gpuType) full parameter constructor.- Parameters:
name- the name of the compute resource.numberOfCores- the number of CPU cores available.memory- the amount of RAM available in GB.gpu- whether the resource has GPU capabilities.gpuType- the type of GPU available, if any.
-
ComputeResource
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>- Returns:
- the id
-
updateUsing
Update this object with the content of the given object. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
getName
Returns name Attribute.- Returns:
- name Attribute
-
setName
Set name Attribute.- Parameters:
pName- value to set
-
withName
fluent setter for name Attribute.- Parameters:
pName- value to set- Returns:
- ComputeResource
-
getNumberOfCores
Returns numberOfCores Attribute.- Returns:
- numberOfCores Attribute
-
setNumberOfCores
Set numberOfCores Attribute.- Parameters:
pNumberOfCores- value to set
-
withNumberOfCores
fluent setter for numberOfCores Attribute.- Parameters:
pNumberOfCores- value to set- Returns:
- ComputeResource
-
getMemory
Returns memory Attribute.- Returns:
- memory Attribute
-
setMemory
Set memory Attribute.- Parameters:
pMemory- value to set
-
withMemory
fluent setter for memory Attribute.- Parameters:
pMemory- value to set- Returns:
- ComputeResource
-
getGpu
Returns gpu Attribute.- Returns:
- gpu Attribute
-
setGpu
Set gpu Attribute.- Parameters:
pGpu- value to set
-
withGpu
fluent setter for gpu Attribute.- Parameters:
pGpu- value to set- Returns:
- ComputeResource
-
getGpuType
Returns gpuType Attribute.- Returns:
- gpuType Attribute
-
setGpuType
Set gpuType Attribute.- Parameters:
pGpuType- value to set
-
withGpuType
fluent setter for gpuType Attribute.- Parameters:
pGpuType- value to set- Returns:
- ComputeResource
-
createComputeResource
public static ComputeResource createComputeResource(Consumer<ComputeResource.ComputeResourceBuilder> f) create a ComputeResource in functional builder style.- Parameters:
f- the functional builder.- Returns:
- an object initialized from the builder.
-
forceLoad
public void forceLoad()- Specified by:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
-