|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.yarn.util.resource.ResourceCalculator
@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class ResourceCalculator
A set of Resource comparison and manipulation interfaces.
| Constructor Summary | |
|---|---|
ResourceCalculator()
|
|
| Method Summary | |
|---|---|
abstract int |
compare(org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource lhs,
org.apache.hadoop.yarn.api.records.Resource rhs)
|
abstract int |
computeAvailableContainers(org.apache.hadoop.yarn.api.records.Resource available,
org.apache.hadoop.yarn.api.records.Resource required)
Compute the number of containers which can be allocated given available and required resources. |
abstract float |
divide(org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource numerator,
org.apache.hadoop.yarn.api.records.Resource denominator)
Divide resource numerator by resource denominator
using specified policy (domination, average, fairness etc.); hence overall
clusterResource is provided for context. |
static int |
divideAndCeil(int a,
int b)
|
abstract org.apache.hadoop.yarn.api.records.Resource |
divideAndCeil(org.apache.hadoop.yarn.api.records.Resource numerator,
int denominator)
Divide-and-ceil numerator by denominator. |
abstract org.apache.hadoop.yarn.api.records.Resource |
multiplyAndNormalizeDown(org.apache.hadoop.yarn.api.records.Resource r,
double by,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
Multiply resource r by factor by
and normalize down using step-factor stepFactor. |
abstract org.apache.hadoop.yarn.api.records.Resource |
multiplyAndNormalizeUp(org.apache.hadoop.yarn.api.records.Resource r,
double by,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
Multiply resource r by factor by
and normalize up using step-factor stepFactor. |
org.apache.hadoop.yarn.api.records.Resource |
normalize(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource minimumResource,
org.apache.hadoop.yarn.api.records.Resource maximumResource)
Normalize resource r given the base
minimumResource and verify against max allowed
maximumResource |
abstract org.apache.hadoop.yarn.api.records.Resource |
normalize(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource minimumResource,
org.apache.hadoop.yarn.api.records.Resource maximumResource,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
Normalize resource r given the base
minimumResource and verify against max allowed
maximumResource using a step factor for hte normalization. |
abstract float |
ratio(org.apache.hadoop.yarn.api.records.Resource a,
org.apache.hadoop.yarn.api.records.Resource b)
Ratio of resource a to resource b. |
static int |
roundDown(int a,
int b)
|
abstract org.apache.hadoop.yarn.api.records.Resource |
roundDown(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
Round-down resource r given factor stepFactor. |
static int |
roundUp(int a,
int b)
|
abstract org.apache.hadoop.yarn.api.records.Resource |
roundUp(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
Round-up resource r given factor stepFactor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceCalculator()
| Method Detail |
|---|
public abstract int compare(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 int divideAndCeil(int a,
int b)
public static int roundUp(int a,
int b)
public static int roundDown(int a,
int b)
public abstract int computeAvailableContainers(org.apache.hadoop.yarn.api.records.Resource available,
org.apache.hadoop.yarn.api.records.Resource required)
available and required resources.
available - available resourcesrequired - required resources
public abstract org.apache.hadoop.yarn.api.records.Resource multiplyAndNormalizeUp(org.apache.hadoop.yarn.api.records.Resource r,
double by,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
r by factor by
and normalize up using step-factor stepFactor.
r - resource to be multipliedby - multiplierstepFactor - factor by which to normalize up
public abstract org.apache.hadoop.yarn.api.records.Resource multiplyAndNormalizeDown(org.apache.hadoop.yarn.api.records.Resource r,
double by,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
r by factor by
and normalize down using step-factor stepFactor.
r - resource to be multipliedby - multiplierstepFactor - factor by which to normalize down
public org.apache.hadoop.yarn.api.records.Resource normalize(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource minimumResource,
org.apache.hadoop.yarn.api.records.Resource maximumResource)
r given the base
minimumResource and verify against max allowed
maximumResource
r - resourceminimumResource - step-factormaximumResource - the upper bound of the resource to be allocated
public abstract org.apache.hadoop.yarn.api.records.Resource normalize(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource minimumResource,
org.apache.hadoop.yarn.api.records.Resource maximumResource,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
r given the base
minimumResource and verify against max allowed
maximumResource using a step factor for hte normalization.
r - resourceminimumResource - minimum valuemaximumResource - the upper bound of the resource to be allocatedstepFactor - the increment for resources to be allocated
public abstract org.apache.hadoop.yarn.api.records.Resource roundUp(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
r given factor stepFactor.
r - resourcestepFactor - step-factor
public abstract org.apache.hadoop.yarn.api.records.Resource roundDown(org.apache.hadoop.yarn.api.records.Resource r,
org.apache.hadoop.yarn.api.records.Resource stepFactor)
r given factor stepFactor.
r - resourcestepFactor - step-factor
public abstract float divide(org.apache.hadoop.yarn.api.records.Resource clusterResource,
org.apache.hadoop.yarn.api.records.Resource numerator,
org.apache.hadoop.yarn.api.records.Resource denominator)
numerator by resource denominator
using specified policy (domination, average, fairness etc.); hence overall
clusterResource is provided for context.
clusterResource - cluster resourcesnumerator - numeratordenominator - denominator
numerator/denominator
using specific policy
public abstract float ratio(org.apache.hadoop.yarn.api.records.Resource a,
org.apache.hadoop.yarn.api.records.Resource b)
a to resource b.
a - resourceb - resource
a to resource b
public abstract org.apache.hadoop.yarn.api.records.Resource divideAndCeil(org.apache.hadoop.yarn.api.records.Resource numerator,
int denominator)
numerator by denominator.
numerator - numerator resourcedenominator - denominator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||