public class LocalScheduler extends java.lang.Object implements IScheduler
Constructor and Description |
---|
LocalScheduler() |
Modifier and Type | Method and Description |
---|---|
void |
close()
This is to for disposing or cleaning up any internal state accumulated by
the scheduler
|
protected java.lang.String[] |
getExecutorCommand(int container) |
java.util.List<java.lang.String> |
getJobLinks()
This method will be called after onScheduler
It is responsible to return links to topology's customized ui pages.
|
protected java.util.concurrent.ExecutorService |
getMonitorService() |
protected java.util.Map<java.lang.Process,java.lang.Integer> |
getProcessToContainer() |
void |
initialize(Config mConfig,
Config mRuntime)
This will initialize scheduler using config file.
|
boolean |
isTopologyKilled() |
boolean |
onKill(Scheduler.KillTopologyRequest request)
Handler to kill topology
|
boolean |
onRestart(Scheduler.RestartTopologyRequest request)
Handler to restart topology
|
boolean |
onSchedule(PackingPlan packing)
Schedule the provided packed plan
|
protected void |
startExecutor(int container)
Start the executor for the given container
|
protected void |
startExecutorMonitor(int container,
java.lang.Process containerExecutor)
Start the monitor of a given executor
|
protected java.lang.Process |
startExecutorProcess(int container)
Start executor process via running an async shell process
|
public void initialize(Config mConfig, Config mRuntime)
IScheduler
initialize
in interface IScheduler
public void close()
IScheduler
Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.
close
in interface IScheduler
close
in interface java.lang.AutoCloseable
protected java.lang.Process startExecutorProcess(int container)
protected void startExecutor(int container)
protected void startExecutorMonitor(int container, java.lang.Process containerExecutor)
protected java.lang.String[] getExecutorCommand(int container)
public boolean onSchedule(PackingPlan packing)
onSchedule
in interface IScheduler
packing
- Initial mapping suggested by running packing algorithm.public java.util.List<java.lang.String> getJobLinks()
IScheduler
getJobLinks
in interface IScheduler
public boolean onKill(Scheduler.KillTopologyRequest request)
onKill
in interface IScheduler
request
- The KillTopologyRequest sent from local heron-clipublic boolean onRestart(Scheduler.RestartTopologyRequest request)
onRestart
in interface IScheduler
request
- The RestartTopologyRequest sent from local heron-clipublic boolean isTopologyKilled()
protected java.util.concurrent.ExecutorService getMonitorService()
protected java.util.Map<java.lang.Process,java.lang.Integer> getProcessToContainer()