public class VMLeaseObject extends java.lang.Object implements VirtualMachineLease
VirtualMachineLease
. Pass a Mesos
Offer
to the VMLeaseObject
constructor to transform it into an
object that implements the VirtualMachineLease
interface.VirtualMachineLease.Range
Constructor and Description |
---|
VMLeaseObject(org.apache.mesos.Protos.Offer offer) |
Modifier and Type | Method and Description |
---|---|
double |
cpuCores()
Get the number of cores (CPUs) on this host that are available for assigning.
|
double |
diskMB()
Get the amount of disk space, in MB, on this host that is avaialble for assigning.
|
java.util.Map<java.lang.String,org.apache.mesos.Protos.Attribute> |
getAttributeMap()
Get the map of Mesos attributes associated with this lease (offer).
|
java.lang.String |
getId()
Get the ID of the lease (offer ID).
|
org.apache.mesos.Protos.Offer |
getOffer()
Get the Mesos resource offer associated with this lease.
|
long |
getOfferedTime()
Get the time that this lease (offer) was obtained.
|
java.lang.Double |
getScalarValue(java.lang.String name)
Get the value of the scalar resource for the given
name . |
java.util.Map<java.lang.String,java.lang.Double> |
getScalarValues()
Get a map of all of the scalar resources with resource names as the key and resource value as the value.
|
java.lang.String |
getVMID()
Get the ID of the host (mesos slave ID).
|
java.lang.String |
hostname()
Get the name of the host offered in this lease.
|
double |
memoryMB()
Get the amount of memory, in MBs, on this host that is available for assigning.
|
double |
networkMbps()
Get the amount of network bandwidth, in Mbps, on this host that is available for assigning.
|
java.util.List<VirtualMachineLease.Range> |
portRanges()
Get the list of port ranges on this host that are available for assigning.
|
java.lang.String |
toString() |
public java.lang.String hostname()
VirtualMachineLease
hostname
in interface VirtualMachineLease
public java.lang.String getVMID()
VirtualMachineLease
getVMID
in interface VirtualMachineLease
public double cpuCores()
VirtualMachineLease
cpuCores
in interface VirtualMachineLease
public double memoryMB()
VirtualMachineLease
memoryMB
in interface VirtualMachineLease
public double networkMbps()
VirtualMachineLease
networkMbps
in interface VirtualMachineLease
public double diskMB()
VirtualMachineLease
diskMB
in interface VirtualMachineLease
public org.apache.mesos.Protos.Offer getOffer()
VirtualMachineLease
getOffer
in interface VirtualMachineLease
public java.lang.String getId()
VirtualMachineLease
getId
in interface VirtualMachineLease
public long getOfferedTime()
VirtualMachineLease
getOfferedTime
in interface VirtualMachineLease
public java.util.List<VirtualMachineLease.Range> portRanges()
VirtualMachineLease
portRanges
in interface VirtualMachineLease
public java.util.Map<java.lang.String,org.apache.mesos.Protos.Attribute> getAttributeMap()
VirtualMachineLease
getAttributeMap
in interface VirtualMachineLease
public java.lang.Double getScalarValue(java.lang.String name)
VirtualMachineLease
name
.getScalarValue
in interface VirtualMachineLease
name
- Name of the scalar resource.null
otherwise.public java.util.Map<java.lang.String,java.lang.Double> getScalarValues()
VirtualMachineLease
getScalarValues
in interface VirtualMachineLease
public java.lang.String toString()
toString
in class java.lang.Object