public class ResourceProfile extends Object implements Serializable, Comparable<ResourceProfile>
Resource Profiles have a total ordering, defined by comparing these fields in sequence:
| Modifier and Type | Field and Description |
|---|---|
static ResourceProfile |
UNKNOWN |
| Constructor and Description |
|---|
ResourceProfile(double cpuCores,
int heapMemoryInMB)
Creates a new simple ResourceProfile used for testing.
|
ResourceProfile(double cpuCores,
int heapMemoryInMB,
int directMemoryInMB,
int nativeMemoryInMB)
Creates a new ResourceProfile.
|
ResourceProfile(ResourceProfile other)
Creates a copy of the given ResourceProfile.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ResourceProfile other) |
boolean |
equals(Object obj) |
double |
getCpuCores()
Get the cpu cores needed
|
int |
getDirectMemoryInMB()
Get the direct memory needed in MB
|
long |
getHeapMemoryInMB()
Get the heap memory needed in MB
|
int |
getMemoryInMB()
Get the total memory needed in MB
|
int |
getNativeMemoryInMB()
Get the native memory needed in MB
|
int |
hashCode() |
boolean |
isMatching(ResourceProfile required)
Check whether required resource profile can be matched
|
String |
toString() |
public static final ResourceProfile UNKNOWN
public ResourceProfile(double cpuCores,
int heapMemoryInMB,
int directMemoryInMB,
int nativeMemoryInMB)
cpuCores - The number of CPU cores (possibly fractional, i.e., 0.2 cores)heapMemoryInMB - The size of the heap memory, in megabytes.directMemoryInMB - The size of the direct memory, in megabytes.nativeMemoryInMB - The size of the native memory, in megabytes.public ResourceProfile(double cpuCores,
int heapMemoryInMB)
cpuCores - The number of CPU cores (possibly fractional, i.e., 0.2 cores)heapMemoryInMB - The size of the heap memory, in megabytes.public ResourceProfile(ResourceProfile other)
other - The ResourceProfile to copy.public double getCpuCores()
public long getHeapMemoryInMB()
public int getDirectMemoryInMB()
public int getNativeMemoryInMB()
public int getMemoryInMB()
public boolean isMatching(ResourceProfile required)
required - the required resource profilepublic int compareTo(@Nonnull ResourceProfile other)
compareTo in interface Comparable<ResourceProfile>Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.