Constructor and Description |
---|
ResourceVector() |
Modifier and Type | Method and Description |
---|---|
void |
decrement(ResourceVector otherResourceVector)
Decrements values for each resource defined in the given resource vector.
|
void |
decrement(String resourceName,
double value)
Decrements the given resource by the specified value.
|
boolean |
equals(Object o) |
Set<String> |
getResourceNames() |
double |
getValue(String resourceName) |
int |
hashCode() |
void |
increment(String resourceName,
double value)
Increments the given resource by the specified value.
|
boolean |
isEmpty() |
Iterator<Map.Entry<String,Double>> |
iterator() |
static ResourceVector |
newInstance()
Creates a new
ResourceVector with all pre-defined resources set to
zero. |
static ResourceVector |
of(double value)
Creates a new
ResourceVector with all pre-defined resources set to
the same value. |
static ResourceVector |
of(org.apache.hadoop.yarn.api.records.Resource resource)
Creates a new
ResourceVector with the values set in a
Resource object. |
void |
setValue(String resourceName,
double value) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static ResourceVector newInstance()
ResourceVector
with all pre-defined resources set to
zero.public static ResourceVector of(double value)
ResourceVector
with all pre-defined resources set to
the same value.value
- the value to set all resources topublic static ResourceVector of(org.apache.hadoop.yarn.api.records.Resource resource)
ResourceVector
with the values set in a
Resource
object.resource
- resource object the resource vector will be based onpublic void decrement(ResourceVector otherResourceVector)
otherResourceVector
- rhs resource vector of the subtractionpublic void decrement(String resourceName, double value)
resourceName
- name of the resourcevalue
- value to be subtracted from the resource's current valuepublic void increment(String resourceName, double value)
resourceName
- name of the resourcevalue
- value to be added to the resource's current valuepublic double getValue(String resourceName)
public void setValue(String resourceName, double value)
public boolean isEmpty()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.