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
  • Field Details

    • _id

      protected Long _id
      inserted database key
    • name

      @VoDml(id="execution:ComputeResource.name", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String name
      the 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 numberOfCores
      the 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 memory
      the 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 gpu
      whether 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 gpuType
      the 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

      public ComputeResource(ComputeResource other)
      Copy Constructor. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
      Returns:
      the id
    • updateUsing

      public void updateUsing(ComputeResource other)
      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

      public String getName()
      Returns name Attribute.
      Returns:
      name Attribute
    • setName

      public void setName(String pName)
      Set name Attribute.
      Parameters:
      pName - value to set
    • withName

      public ComputeResource withName(String pName)
      fluent setter for name Attribute.
      Parameters:
      pName - value to set
      Returns:
      ComputeResource
    • getNumberOfCores

      public Integer getNumberOfCores()
      Returns numberOfCores Attribute.
      Returns:
      numberOfCores Attribute
    • setNumberOfCores

      public void setNumberOfCores(Integer pNumberOfCores)
      Set numberOfCores Attribute.
      Parameters:
      pNumberOfCores - value to set
    • withNumberOfCores

      public ComputeResource withNumberOfCores(Integer pNumberOfCores)
      fluent setter for numberOfCores Attribute.
      Parameters:
      pNumberOfCores - value to set
      Returns:
      ComputeResource
    • getMemory

      public Double getMemory()
      Returns memory Attribute.
      Returns:
      memory Attribute
    • setMemory

      public void setMemory(Double pMemory)
      Set memory Attribute.
      Parameters:
      pMemory - value to set
    • withMemory

      public ComputeResource withMemory(Double pMemory)
      fluent setter for memory Attribute.
      Parameters:
      pMemory - value to set
      Returns:
      ComputeResource
    • getGpu

      public Boolean getGpu()
      Returns gpu Attribute.
      Returns:
      gpu Attribute
    • setGpu

      public void setGpu(Boolean pGpu)
      Set gpu Attribute.
      Parameters:
      pGpu - value to set
    • withGpu

      public ComputeResource withGpu(Boolean pGpu)
      fluent setter for gpu Attribute.
      Parameters:
      pGpu - value to set
      Returns:
      ComputeResource
    • getGpuType

      public String getGpuType()
      Returns gpuType Attribute.
      Returns:
      gpuType Attribute
    • setGpuType

      public void setGpuType(String pGpuType)
      Set gpuType Attribute.
      Parameters:
      pGpuType - value to set
    • withGpuType

      public ComputeResource withGpuType(String pGpuType)
      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:
      forceLoad in interface org.ivoa.vodml.jpa.JPAManipulations
    • delete

      public void delete(jakarta.persistence.EntityManager em)
      Specified by:
      delete in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>