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()
VirtualMachineLeasehostname in interface VirtualMachineLeasepublic java.lang.String getVMID()
VirtualMachineLeasegetVMID in interface VirtualMachineLeasepublic double cpuCores()
VirtualMachineLeasecpuCores in interface VirtualMachineLeasepublic double memoryMB()
VirtualMachineLeasememoryMB in interface VirtualMachineLeasepublic double networkMbps()
VirtualMachineLeasenetworkMbps in interface VirtualMachineLeasepublic double diskMB()
VirtualMachineLeasediskMB in interface VirtualMachineLeasepublic org.apache.mesos.Protos.Offer getOffer()
VirtualMachineLeasegetOffer in interface VirtualMachineLeasepublic java.lang.String getId()
VirtualMachineLeasegetId in interface VirtualMachineLeasepublic long getOfferedTime()
VirtualMachineLeasegetOfferedTime in interface VirtualMachineLeasepublic java.util.List<VirtualMachineLease.Range> portRanges()
VirtualMachineLeaseportRanges in interface VirtualMachineLeasepublic java.util.Map<java.lang.String,org.apache.mesos.Protos.Attribute> getAttributeMap()
VirtualMachineLeasegetAttributeMap in interface VirtualMachineLeasepublic java.lang.Double getScalarValue(java.lang.String name)
VirtualMachineLeasename.getScalarValue in interface VirtualMachineLeasename - Name of the scalar resource.null otherwise.public java.util.Map<java.lang.String,java.lang.Double> getScalarValues()
VirtualMachineLeasegetScalarValues in interface VirtualMachineLeasepublic java.lang.String toString()
toString in class java.lang.Object