org.apache.hadoop.yarn.api.records
Class Resource

java.lang.Object
  extended by org.apache.hadoop.yarn.api.records.Resource
All Implemented Interfaces:
Comparable<Resource>

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class Resource
extends Object
implements Comparable<Resource>

Resource models a set of computer resources in the cluster.

Currrently it only models memory.

Typically, applications request Resource of suitable capability to run their component tasks.

See Also:
ResourceRequest, AMRMProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest)

Constructor Summary
Resource()
           
 
Method Summary
 boolean equals(Object obj)
           
abstract  int getMemory()
          Get memory of the resource.
 int hashCode()
           
abstract  void setMemory(int memory)
          Set memory of the resource.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Resource

public Resource()
Method Detail

getMemory

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract int getMemory()
Get memory of the resource.

Returns:
memory of the resource

setMemory

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract void setMemory(int memory)
Set memory of the resource.

Parameters:
memory - memory of the resource

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Apache Software Foundation. All Rights Reserved.