public final class DefaultResourceReport extends Object implements ResourceReport
ResourceReport
with some
additional methods for maintaining the report.Constructor and Description |
---|
DefaultResourceReport(String applicationId,
TwillRunResources masterResources) |
DefaultResourceReport(String applicationId,
TwillRunResources masterResources,
Map<String,Collection<TwillRunResources>> resources,
List<String> services) |
Modifier and Type | Method and Description |
---|---|
void |
addRunResources(String runnableName,
TwillRunResources resources)
Add resources used by an instance of the runnable.
|
String |
getApplicationId()
Get the id of the application master.
|
TwillRunResources |
getAppMasterResources()
Get the resources application master is using.
|
Map<String,Collection<TwillRunResources>> |
getResources()
Get all the run resources being used across all runnables.
|
Collection<TwillRunResources> |
getRunnableResources(String runnableName)
Get all the run resources being used by all instances of the specified runnable.
|
List<String> |
getServices()
Get the list of services of the application master.
|
void |
removeRunnableResources(String runnableName,
String containerId)
Remove the resource corresponding to the given runnable and container.
|
void |
setServices(List<String> services)
Set the list of services of the application master.
|
String |
toString() |
public DefaultResourceReport(String applicationId, TwillRunResources masterResources)
public DefaultResourceReport(String applicationId, TwillRunResources masterResources, Map<String,Collection<TwillRunResources>> resources, List<String> services)
public void addRunResources(String runnableName, TwillRunResources resources)
runnableName
- name of runnable.resources
- resources to add.public void removeRunnableResources(String runnableName, String containerId)
runnableName
- name of runnable.containerId
- container id of the runnable.public Collection<TwillRunResources> getRunnableResources(String runnableName)
getRunnableResources
in interface ResourceReport
runnableName
- the runnable name.public Map<String,Collection<TwillRunResources>> getResources()
getResources
in interface ResourceReport
public TwillRunResources getAppMasterResources()
getAppMasterResources
in interface ResourceReport
public String getApplicationId()
getApplicationId
in interface ResourceReport
public void setServices(List<String> services)
services
- list of services to set.public List<String> getServices()
getServices
in interface ResourceReport
Copyright © 2013-2020 The Apache Software Foundation. All rights reserved.