@InterfaceAudience.LimitedPrivate(value={"YARN","MapReduce"}) @InterfaceStability.Unstable public class Resources extends Object
Constructor and Description |
---|
Resources() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.yarn.api.records.Resource |
add(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
addTo(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
clone(org.apache.hadoop.yarn.api.records.Resource res) |
static org.apache.hadoop.yarn.api.records.Resource |
componentwiseMax(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
componentwiseMin(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
createResource(int memory) |
static org.apache.hadoop.yarn.api.records.Resource |
createResource(int memory,
int cores) |
static org.apache.hadoop.yarn.api.records.Resource |
createResource(long memory) |
static org.apache.hadoop.yarn.api.records.Resource |
createResource(long memory,
int cores) |
static org.apache.hadoop.yarn.api.records.Resource |
createResourceWithSameValue(long value)
Return a new
Resource instance with all resource values
initialized to value . |
static float |
divide(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
divideAndCeil(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
float rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
divideAndCeil(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
int rhs) |
static boolean |
equals(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static boolean |
fitsIn(ResourceCalculator rc,
org.apache.hadoop.yarn.api.records.Resource smaller,
org.apache.hadoop.yarn.api.records.Resource bigger) |
static boolean |
fitsIn(org.apache.hadoop.yarn.api.records.Resource smaller,
org.apache.hadoop.yarn.api.records.Resource bigger) |
static boolean |
greaterThan(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static boolean |
greaterThanOrEqual(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static boolean |
isInvalidDivisor(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource divisor) |
static boolean |
isNone(org.apache.hadoop.yarn.api.records.Resource other)
Check whether a resource object is empty (0 memory and 0 virtual cores).
|
static boolean |
lessThan(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static boolean |
lessThanOrEqual(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
max(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
min(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
multiply(org.apache.hadoop.yarn.api.records.Resource lhs,
double by) |
static org.apache.hadoop.yarn.api.records.Resource |
multiplyAndAddTo(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs,
double by)
Multiply
rhs by by , and add the result to lhs
without creating any new Resource object |
static org.apache.hadoop.yarn.api.records.Resource |
multiplyAndNormalizeDown(ResourceCalculator calculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
double by,
org.apache.hadoop.yarn.api.records.Resource factor) |
static org.apache.hadoop.yarn.api.records.Resource |
multiplyAndNormalizeUp(ResourceCalculator calculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
double[] by,
org.apache.hadoop.yarn.api.records.Resource factor) |
static org.apache.hadoop.yarn.api.records.Resource |
multiplyAndNormalizeUp(ResourceCalculator calculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
double by,
org.apache.hadoop.yarn.api.records.Resource factor) |
static org.apache.hadoop.yarn.api.records.Resource |
multiplyAndRoundDown(org.apache.hadoop.yarn.api.records.Resource lhs,
double by) |
static org.apache.hadoop.yarn.api.records.Resource |
multiplyAndRoundUp(org.apache.hadoop.yarn.api.records.Resource lhs,
double by) |
static org.apache.hadoop.yarn.api.records.Resource |
multiplyTo(org.apache.hadoop.yarn.api.records.Resource lhs,
double by) |
static org.apache.hadoop.yarn.api.records.Resource |
negate(org.apache.hadoop.yarn.api.records.Resource resource) |
static org.apache.hadoop.yarn.api.records.Resource |
none() |
static org.apache.hadoop.yarn.api.records.Resource |
normalize(ResourceCalculator calculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource min,
org.apache.hadoop.yarn.api.records.Resource max,
org.apache.hadoop.yarn.api.records.Resource increment) |
static org.apache.hadoop.yarn.api.records.Resource |
normalizeDown(ResourceCalculator calculator,
org.apache.hadoop.yarn.api.records.Resource resource,
org.apache.hadoop.yarn.api.records.Resource factor) |
static float |
ratio(ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
roundDown(ResourceCalculator calculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource factor) |
static org.apache.hadoop.yarn.api.records.Resource |
roundUp(ResourceCalculator calculator,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource factor) |
static org.apache.hadoop.yarn.api.records.Resource |
subtract(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
subtractFrom(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs) |
static org.apache.hadoop.yarn.api.records.Resource |
subtractFromNonNegative(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs)
Subtract
rhs from lhs and reset any negative values to
zero. |
static org.apache.hadoop.yarn.api.records.Resource |
subtractNonNegative(org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs)
Subtract
rhs from lhs and reset any negative values to
zero. |
static org.apache.hadoop.yarn.api.records.Resource |
unbounded() |
@InterfaceAudience.Private @InterfaceStability.Unstable public static org.apache.hadoop.yarn.api.records.Resource createResourceWithSameValue(long value)
Resource
instance with all resource values
initialized to value
.value
- the value to use for all resourcesResource
instancepublic static org.apache.hadoop.yarn.api.records.Resource createResource(int memory)
public static org.apache.hadoop.yarn.api.records.Resource createResource(int memory, int cores)
public static org.apache.hadoop.yarn.api.records.Resource createResource(long memory)
public static org.apache.hadoop.yarn.api.records.Resource createResource(long memory, int cores)
public static org.apache.hadoop.yarn.api.records.Resource none()
public static boolean isNone(org.apache.hadoop.yarn.api.records.Resource other)
other
- The resource to checktrue
if other
has 0 memory and 0 virtual cores,
false
otherwisepublic static org.apache.hadoop.yarn.api.records.Resource unbounded()
public static org.apache.hadoop.yarn.api.records.Resource clone(org.apache.hadoop.yarn.api.records.Resource res)
public static org.apache.hadoop.yarn.api.records.Resource addTo(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource add(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource subtractFrom(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource subtract(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource subtractFromNonNegative(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
rhs
from lhs
and reset any negative values to
zero. This call will modify lhs
.lhs
- Resource
to subtract fromrhs
- Resource
to subtractpublic static org.apache.hadoop.yarn.api.records.Resource subtractNonNegative(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
rhs
from lhs
and reset any negative values to
zero. This call will operate on a copy of lhs
, leaving lhs
unmodified.lhs
- Resource
to subtract fromrhs
- Resource
to subtractpublic static org.apache.hadoop.yarn.api.records.Resource negate(org.apache.hadoop.yarn.api.records.Resource resource)
public static org.apache.hadoop.yarn.api.records.Resource multiplyTo(org.apache.hadoop.yarn.api.records.Resource lhs, double by)
public static org.apache.hadoop.yarn.api.records.Resource multiply(org.apache.hadoop.yarn.api.records.Resource lhs, double by)
public static org.apache.hadoop.yarn.api.records.Resource multiplyAndAddTo(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs, double by)
rhs
by by
, and add the result to lhs
without creating any new Resource
objectpublic static org.apache.hadoop.yarn.api.records.Resource multiplyAndNormalizeUp(ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource lhs, double[] by, org.apache.hadoop.yarn.api.records.Resource factor)
public static org.apache.hadoop.yarn.api.records.Resource multiplyAndNormalizeUp(ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource lhs, double by, org.apache.hadoop.yarn.api.records.Resource factor)
public static org.apache.hadoop.yarn.api.records.Resource multiplyAndNormalizeDown(ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource lhs, double by, org.apache.hadoop.yarn.api.records.Resource factor)
public static org.apache.hadoop.yarn.api.records.Resource multiplyAndRoundDown(org.apache.hadoop.yarn.api.records.Resource lhs, double by)
public static org.apache.hadoop.yarn.api.records.Resource multiplyAndRoundUp(org.apache.hadoop.yarn.api.records.Resource lhs, double by)
public static org.apache.hadoop.yarn.api.records.Resource normalize(ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource min, org.apache.hadoop.yarn.api.records.Resource max, org.apache.hadoop.yarn.api.records.Resource increment)
public static org.apache.hadoop.yarn.api.records.Resource roundUp(ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource factor)
public static org.apache.hadoop.yarn.api.records.Resource roundDown(ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource factor)
public static boolean isInvalidDivisor(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource divisor)
public static float ratio(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static float divide(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource divideAndCeil(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource lhs, int rhs)
public static org.apache.hadoop.yarn.api.records.Resource divideAndCeil(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource lhs, float rhs)
public static boolean equals(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static boolean lessThan(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static boolean lessThanOrEqual(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static boolean greaterThan(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static boolean greaterThanOrEqual(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource min(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource max(ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static boolean fitsIn(org.apache.hadoop.yarn.api.records.Resource smaller, org.apache.hadoop.yarn.api.records.Resource bigger)
public static boolean fitsIn(ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource smaller, org.apache.hadoop.yarn.api.records.Resource bigger)
public static org.apache.hadoop.yarn.api.records.Resource componentwiseMin(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource componentwiseMax(org.apache.hadoop.yarn.api.records.Resource lhs, org.apache.hadoop.yarn.api.records.Resource rhs)
public static org.apache.hadoop.yarn.api.records.Resource normalizeDown(ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.Resource factor)
Copyright © 2008–2019 Apache Software Foundation. All rights reserved.