Interface IScheduler

  • All Superinterfaces:
    AutoCloseable

    @LimitedPrivate
    @Evolving
    public interface IScheduler
    extends AutoCloseable
    Scheduler object responsible for bringing up topology. Will be instantiated using no-arg constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      This is to for disposing or cleaning up any internal state accumulated by the scheduler
      List<String> getJobLinks()
      This method will be called after onScheduler It is responsible to return links to topology's customized ui pages.
      void initialize​(Config config, Config runtime)
      This will initialize scheduler using config file.
      boolean onKill​(org.apache.heron.proto.scheduler.Scheduler.KillTopologyRequest request)
      Called by SchedulerServer when it receives a http request to kill topology, while the http request body would be the protobuf Scheduler.KillTopologyRequest.
      boolean onRestart​(org.apache.heron.proto.scheduler.Scheduler.RestartTopologyRequest request)
      Called by SchedulerServer when it receives a http request to restart topology, while the http request body would be the protobuf Scheduler.RestartTopologyRequest.
      boolean onSchedule​(PackingPlan packing)
      This method will be called after initialize.
      boolean onUpdate​(org.apache.heron.proto.scheduler.Scheduler.UpdateTopologyRequest request)
      Called by SchedulerServer when it receives a http request to update topology, while the http request body would be the protobuf Scheduler.UpdateTopologyRequest.
    • Method Detail

      • initialize

        void initialize​(Config config,
                        Config runtime)
        This will initialize scheduler using config file. Will be called during start.
      • close

        void close()
        This is to for disposing or cleaning up any internal state accumulated by the scheduler

        Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

        Specified by:
        close in interface AutoCloseable
      • onSchedule

        boolean onSchedule​(PackingPlan packing)
        This method will be called after initialize. It is responsible for grabbing resource to launch executor and make sure they get launched.

        Parameters:
        packing - Initial mapping suggested by running packing algorithm.
      • getJobLinks

        List<String> getJobLinks()
        This method will be called after onScheduler It is responsible to return links to topology's customized ui pages. Example: link to the Mesos Slave UI page displaying all scheduled containers
        Returns:
        the links if any customized page. It returns an empty list if no any links
      • onKill

        boolean onKill​(org.apache.heron.proto.scheduler.Scheduler.KillTopologyRequest request)
        Called by SchedulerServer when it receives a http request to kill topology, while the http request body would be the protobuf Scheduler.KillTopologyRequest. The SchedulerServer would parse the request body and feed with this method. It would be invoked in the executors of SchedulerServer.
        Parameters:
        request - The KillTopologyRequest sent from local heron-cli
        Returns:
        true if the IScheduler kills the topology successfully. SchedulerServer would send KillTopologyResponse correspondingly according to this method's return value.
      • onRestart

        boolean onRestart​(org.apache.heron.proto.scheduler.Scheduler.RestartTopologyRequest request)
        Called by SchedulerServer when it receives a http request to restart topology, while the http request body would be the protobuf Scheduler.RestartTopologyRequest. The SchedulerServer would parse the request body and feed with this method. It would be invoked in the executors of SchedulerServer.
        Parameters:
        request - The RestartTopologyRequest sent from local heron-cli
        Returns:
        true if the IScheduler restarts the topology successfully. SchedulerServer would send RestartTopologyResponse correspondingly according to this method's return value.
      • onUpdate

        boolean onUpdate​(org.apache.heron.proto.scheduler.Scheduler.UpdateTopologyRequest request)
        Called by SchedulerServer when it receives a http request to update topology, while the http request body would be the protobuf Scheduler.UpdateTopologyRequest. The SchedulerServer would parse the request body and feed with this method. It would be invoked in the executors of SchedulerServer.
        Parameters:
        request - The UpdateTopologyRequest sent from local heron-cli
        Returns:
        true if the IScheduler updates the topology successfully. SchedulerServer would send UpdateTopologyResponse correspondingly according to this method's return value.