public class ResourceInformation extends Object implements Comparable<ResourceInformation>
Modifier and Type | Field and Description |
---|---|
static String |
FPGA_URI |
static ResourceInformation |
FPGAS |
static String |
GPU_URI |
static ResourceInformation |
GPUS |
static ResourceInformation |
MEMORY_MB |
static String |
MEMORY_URI |
static Map<String,ResourceInformation> |
SPECIAL_RESOURCES
Special resources that should be treated separately
from arbitrary resource types.
|
static ResourceInformation |
VCORES |
static String |
VCORES_URI |
Constructor and Description |
---|
ResourceInformation() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ResourceInformation other) |
static void |
copy(ResourceInformation src,
ResourceInformation dst)
Copies the content of the source ResourceInformation object to the
destination object, overwriting all properties of the destination object.
|
boolean |
equals(Object obj) |
Map<String,String> |
getAttributes()
Get the attributes of the resource.
|
long |
getMaximumAllocation()
Get the maximum allocation for the resource.
|
long |
getMinimumAllocation()
Get the minimum allocation for the resource.
|
String |
getName()
Get the name for the resource.
|
ResourceTypes |
getResourceType()
Get the resource type.
|
String |
getShorthandRepresentation() |
Set<String> |
getTags()
Get resource tags.
|
String |
getUnits()
Get units for the resource.
|
long |
getValue()
Get the value for the resource.
|
int |
hashCode() |
static ResourceInformation |
newInstance(ResourceInformation other)
Create a new instance of ResourceInformation from another object.
|
static ResourceInformation |
newInstance(String name) |
static ResourceInformation |
newInstance(String name,
long value) |
static ResourceInformation |
newInstance(String name,
String units) |
static ResourceInformation |
newInstance(String name,
String units,
long value) |
static ResourceInformation |
newInstance(String name,
String units,
long minRes,
long maxRes) |
static ResourceInformation |
newInstance(String name,
String units,
long value,
ResourceTypes type,
long minimumAllocation,
long maximumAllocation) |
static ResourceInformation |
newInstance(String name,
String units,
long value,
ResourceTypes type,
long minimumAllocation,
long maximumAllocation,
Set<String> tags,
Map<String,String> attributes) |
static ResourceInformation |
newInstance(String name,
String units,
long value,
Set<String> tags,
Map<String,String> attributes) |
static ResourceInformation |
newInstance(String name,
String units,
ResourceTypes resourceType) |
void |
setAttributes(Map<String,String> attributes)
Set a map of attributes to the resource.
|
void |
setMaximumAllocation(long maximumAllocation)
Set the maximum allocation for the resource.
|
void |
setMinimumAllocation(long minimumAllocation)
Set the minimum allocation for the resource.
|
void |
setName(String rName)
Set the name for the resource.
|
void |
setResourceType(ResourceTypes type)
Set the resource type.
|
void |
setTags(Set<String> tags)
Add tags to the resource.
|
void |
setUnits(String rUnits)
Set the units for the resource.
|
void |
setUnitsWithoutValidation(String rUnits)
Checking if a unit included by KNOWN_UNITS is an expensive operation.
|
void |
setValue(long rValue)
Set the value for the resource.
|
String |
toString() |
public static final String MEMORY_URI
public static final String VCORES_URI
public static final String GPU_URI
public static final String FPGA_URI
public static final ResourceInformation MEMORY_MB
public static final ResourceInformation VCORES
public static final ResourceInformation GPUS
public static final ResourceInformation FPGAS
public static final Map<String,ResourceInformation> SPECIAL_RESOURCES
public String getName()
public void setName(String rName)
rName
- name for the resourcepublic String getUnits()
public void setUnits(String rUnits)
rUnits
- units for the resource@InterfaceAudience.Private public void setUnitsWithoutValidation(String rUnits)
rUnits
- units for the resourcepublic ResourceTypes getResourceType()
public void setResourceType(ResourceTypes type)
type
- the resource typepublic long getValue()
public void setValue(long rValue)
rValue
- the resource valuepublic long getMinimumAllocation()
public void setMinimumAllocation(long minimumAllocation)
minimumAllocation
- the minimum allocation for the resourcepublic long getMaximumAllocation()
public void setMaximumAllocation(long maximumAllocation)
maximumAllocation
- the maximum allocation for the resourcepublic Map<String,String> getAttributes()
public void setAttributes(Map<String,String> attributes)
attributes
- resource attributespublic void setTags(Set<String> tags)
tags
- resource tagspublic static ResourceInformation newInstance(ResourceInformation other)
other
- the object from which the new object should be createdpublic static ResourceInformation newInstance(String name, String units, long value, ResourceTypes type, long minimumAllocation, long maximumAllocation)
public static ResourceInformation newInstance(String name, String units, long value, ResourceTypes type, long minimumAllocation, long maximumAllocation, Set<String> tags, Map<String,String> attributes)
public static ResourceInformation newInstance(String name, String units, long value)
public static ResourceInformation newInstance(String name, String units)
public static ResourceInformation newInstance(String name, String units, long value, Set<String> tags, Map<String,String> attributes)
public static ResourceInformation newInstance(String name, String units, ResourceTypes resourceType)
public static ResourceInformation newInstance(String name, String units, long minRes, long maxRes)
public static ResourceInformation newInstance(String name, long value)
public static ResourceInformation newInstance(String name)
public static void copy(ResourceInformation src, ResourceInformation dst)
src
- Source ResourceInformation objectdst
- Destination ResourceInformation objectpublic String getShorthandRepresentation()
public int compareTo(ResourceInformation other)
compareTo
in interface Comparable<ResourceInformation>
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.