Package org.apache.storm.scheduler
Class TopologyDetails
- java.lang.Object
-
- org.apache.storm.scheduler.TopologyDetails
-
public class TopologyDetails extends Object
-
-
Constructor Summary
Constructors Constructor Description TopologyDetails(String topologyId, Map<String,Object> topologyConf, StormTopology topology, int numWorkers, String owner)TopologyDetails(String topologyId, Map<String,Object> topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails,String> executorToComponents, int launchTime, String owner)TopologyDetails(String topologyId, Map<String,Object> topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails,String> executorToComponents, String owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResourcesForExec(ExecutorDetails exec, NormalizedResourceRequest resourceList)add resource requirements for a executor.booleanequals(Object o)NormalizedResourceRequestgetApproximateResources(Set<ExecutorDetails> execs)Get approximate resources for given topology executors.NormalizedResourceRequestgetApproximateTotalResources()Get an approximate total resources needed for this topology.StringgetComponentFromExecutor(ExecutorDetails exec)Map<String,Set<ExecutorDetails>>getComponentToExecutors()Map<String,Object>getConf()Set<ExecutorDetails>getExecutors()Map<ExecutorDetails,String>getExecutorToComponent()StringgetId()intgetLaunchTime()Get the timestamp of when this topology was launched.StringgetName()intgetNumWorkers()DoublegetOffHeapMemoryRequirement(ExecutorDetails exec)Gets the off heap memory requirement for a certain task within a topology.DoublegetOnHeapMemoryRequirement(ExecutorDetails exec)Gets the on heap memory requirement for a certain task within a topology.doublegetRequestedNonSharedOffHeap()doublegetRequestedNonSharedOnHeap()doublegetRequestedSharedOffHeap()doublegetRequestedSharedOnHeap()Set<SharedMemory>getSharedMemoryRequests(Collection<ExecutorDetails> executors)Gets the total memory resource list for a set of tasks that is part of a topology.NormalizedResourceRequestgetTaskResourceReqList(ExecutorDetails exec)get the resources requirements for a executor.StormTopologygetTopology()intgetTopologyPriority()get the priority of this topology.StringgetTopologySubmitter()Get the user that submitted this topology.DoublegetTopologyWorkerMaxHeapSize()Get the max heap size for a worker used by this topology.DoublegetTotalCpuReqTask(ExecutorDetails exec)Get the total CPU requirement for executor.DoublegetTotalMemReqTask(ExecutorDetails exec)Gets the total memory requirement for a task.doublegetTotalRequestedCpu()Note: The public API relevant to resource aware scheduling is unstable as of May 2015.Map<String,Double>getTotalRequestedGenericResources()doublegetTotalRequestedMemOffHeap()Note: The public API relevant to resource aware scheduling is unstable as of May 2015.doublegetTotalRequestedMemOnHeap()Note: The public API relevant to resource aware scheduling is unstable as of May 2015.NormalizedResourceRequestgetTotalResources(ExecutorDetails exec)Get the total resource requirement for an executor.intgetUpTime()Get how long this topology has been executing.Map<String,Component>getUserTopolgyComponents()Returns a representation of the non-system components of the topology graph.booleanhasExecInTopo(ExecutorDetails exec)Checks if a executor is part of this topology.inthashCode()booleanhasSpouts()Determine if there are non-system spouts.Map<ExecutorDetails,String>selectExecutorToComponent(Collection<ExecutorDetails> executors)StringtoString()
-
-
-
Constructor Detail
-
TopologyDetails
public TopologyDetails(String topologyId, Map<String,Object> topologyConf, StormTopology topology, int numWorkers, String owner)
-
TopologyDetails
public TopologyDetails(String topologyId, Map<String,Object> topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails,String> executorToComponents, String owner)
-
TopologyDetails
public TopologyDetails(String topologyId, Map<String,Object> topologyConf, StormTopology topology, int numWorkers, Map<ExecutorDetails,String> executorToComponents, int launchTime, String owner)
-
-
Method Detail
-
getId
public String getId()
-
getName
public String getName()
-
getNumWorkers
public int getNumWorkers()
-
getTopology
public StormTopology getTopology()
-
getExecutorToComponent
public Map<ExecutorDetails,String> getExecutorToComponent()
-
selectExecutorToComponent
public Map<ExecutorDetails,String> selectExecutorToComponent(Collection<ExecutorDetails> executors)
-
getComponentToExecutors
public Map<String,Set<ExecutorDetails>> getComponentToExecutors()
-
getExecutors
public Set<ExecutorDetails> getExecutors()
-
getUserTopolgyComponents
public Map<String,Component> getUserTopolgyComponents()
Returns a representation of the non-system components of the topology graph. Each Component object in the returning map is populated with the list of its parents, children and execs assigned to that component.- Returns:
- a map of components
-
hasSpouts
public boolean hasSpouts()
Determine if there are non-system spouts.- Returns:
- true if there is at least one non-system spout, false otherwise
-
getComponentFromExecutor
public String getComponentFromExecutor(ExecutorDetails exec)
-
getOnHeapMemoryRequirement
public Double getOnHeapMemoryRequirement(ExecutorDetails exec)
Gets the on heap memory requirement for a certain task within a topology.- Parameters:
exec- the executor the inquiry is concerning.- Returns:
- Double the amount of on heap memory requirement for this exec in topology topoId.
-
getOffHeapMemoryRequirement
public Double getOffHeapMemoryRequirement(ExecutorDetails exec)
Gets the off heap memory requirement for a certain task within a topology.- Parameters:
exec- the executor the inquiry is concerning.- Returns:
- Double the amount of off heap memory requirement for this exec in topology topoId.
-
getTotalMemReqTask
public Double getTotalMemReqTask(ExecutorDetails exec)
Gets the total memory requirement for a task.- Parameters:
exec- the executor the inquiry is concerning.- Returns:
- Double the total memory requirement for this exec in topology topoId.
-
getSharedMemoryRequests
public Set<SharedMemory> getSharedMemoryRequests(Collection<ExecutorDetails> executors)
Gets the total memory resource list for a set of tasks that is part of a topology.- Parameters:
executors- all executors for a topology- Returns:
- the set of shared memory requests.
-
getTotalResources
public NormalizedResourceRequest getTotalResources(ExecutorDetails exec)
Get the total resource requirement for an executor.- Parameters:
exec- the executor to get the resources for.- Returns:
- Double the total about of cpu requirement for executor
-
getApproximateTotalResources
public NormalizedResourceRequest getApproximateTotalResources()
Get an approximate total resources needed for this topology. ignores shared memory.- Returns:
- the approximate total resources needed for this topology.
-
getApproximateResources
public NormalizedResourceRequest getApproximateResources(Set<ExecutorDetails> execs)
Get approximate resources for given topology executors. ignores shared memory.- Parameters:
execs- the executors the inquiry is concerning.- Returns:
- the approximate resources for the executors.
-
getTotalCpuReqTask
public Double getTotalCpuReqTask(ExecutorDetails exec)
Get the total CPU requirement for executor.- Returns:
- generic resource mapping requirement for the executor
-
getTotalRequestedMemOnHeap
public double getTotalRequestedMemOnHeap()
Note: The public API relevant to resource aware scheduling is unstable as of May 2015. We reserve the right to change them.- Returns:
- the total on-heap memory requested for this topology
-
getRequestedSharedOnHeap
public double getRequestedSharedOnHeap()
-
getRequestedNonSharedOnHeap
public double getRequestedNonSharedOnHeap()
-
getTotalRequestedMemOffHeap
public double getTotalRequestedMemOffHeap()
Note: The public API relevant to resource aware scheduling is unstable as of May 2015. We reserve the right to change them.- Returns:
- the total off-heap memory requested for this topology
-
getRequestedNonSharedOffHeap
public double getRequestedNonSharedOffHeap()
-
getRequestedSharedOffHeap
public double getRequestedSharedOffHeap()
-
getTotalRequestedCpu
public double getTotalRequestedCpu()
Note: The public API relevant to resource aware scheduling is unstable as of May 2015. We reserve the right to change them.- Returns:
- the total cpu requested for this topology
-
getTaskResourceReqList
public NormalizedResourceRequest getTaskResourceReqList(ExecutorDetails exec)
get the resources requirements for a executor.- Parameters:
exec- executor details- Returns:
- a map containing the resource requirements for this exec
-
hasExecInTopo
public boolean hasExecInTopo(ExecutorDetails exec)
Checks if a executor is part of this topology.- Returns:
- Boolean whether or not a certain ExecutorDetail is included in the resourceList.
-
addResourcesForExec
public void addResourcesForExec(ExecutorDetails exec, NormalizedResourceRequest resourceList)
add resource requirements for a executor.
-
getTopologyWorkerMaxHeapSize
public Double getTopologyWorkerMaxHeapSize()
Get the max heap size for a worker used by this topology.- Returns:
- the worker max heap size
-
getTopologySubmitter
public String getTopologySubmitter()
Get the user that submitted this topology.
-
getTopologyPriority
public int getTopologyPriority()
get the priority of this topology.
-
getLaunchTime
public int getLaunchTime()
Get the timestamp of when this topology was launched.
-
getUpTime
public int getUpTime()
Get how long this topology has been executing.
-
-