This project has retired. For details please refer to its Attic page.
SchedulerDriver
JavaScript is disabled on your browser.
Skip navigation links
  • Summary:
  • Nested |
  • Field |
  • Constr |
  • Method
  • Detail:
  • Field |
  • Constr |
  • Method
org.apache.mesos

Interface SchedulerDriver

  • All Known Implementing Classes:
    MesosSchedulerDriver


    public interface SchedulerDriver
    Abstract interface for connecting a scheduler to Mesos. This interface is used both to manage the scheduler's lifecycle (start it, stop it, or wait for it to finish) and to interact with Mesos (e.g., launch tasks, kill tasks, etc.).
    • Method Detail

      • start

        Protos.Status start()
        Starts the scheduler driver. This needs to be called before any other driver calls are made.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.Status
      • stop

        Protos.Status stop(boolean failover)
        Stops the scheduler driver. If the 'failover' flag is set to false then it is expected that this framework will never reconnect to Mesos. So Mesos will unregister the framework and shutdown all its tasks and executors. If 'failover' is true, all executors and tasks will remain running (for some framework specific failover timeout) allowing the scheduler to reconnect (possibly in the same process, or from a different process, for example, on a different machine).
        Parameters:
        failover - Whether framework failover is expected.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.Status
      • stop

        Protos.Status stop()
        Stops the scheduler driver assuming no failover. This will cause Mesos to unregister the framework and shutdown all its tasks and executors. Please see stop(boolean) for more details.
        Returns:
        The state of the driver after the call.
      • abort

        Protos.Status abort()
        Aborts the driver so that no more callbacks can be made to the scheduler. The semantics of abort and stop have deliberately been separated so that code can detect an aborted driver (i.e., via the return status of join(), see below), and instantiate and start another driver if desired (from within the same process).
        Returns:
        The state of the driver after the call.
      • join

        Protos.Status join()
        Waits for the driver to be stopped or aborted, possibly blocking the current thread indefinitely. The return status of this function can be used to determine if the driver was aborted (see mesos.proto for a description of Status).
        Returns:
        The state of the driver after the call.
      • run

        Protos.Status run()
        Starts and immediately joins (i.e., blocks on) the driver.
        Returns:
        The state of the driver after the call.
      • launchTasks

        Protos.Status launchTasks(java.util.Collection<Protos.OfferID> offerIds,
         java.util.Collection<Protos.TaskInfo> tasks,
         Protos.Filters filters)
        Launches the given set of tasks. Any remaining resources (i.e., those that are not used by the launched tasks or their executors) will be considered declined. Note that this includes resources used by tasks that the framework attempted to launch but failed (with TASK_ERROR) due to a malformed task description. The specified filters are applied on all unused resources (see mesos.proto for a description of Filters). Available resources are aggregated when multiple offers are provided. Note that all offers must belong to the same slave. Invoking this function with an empty collection of tasks declines offers in their entirety (see declineOffer(org.apache.mesos.Protos.OfferID, org.apache.mesos.Protos.Filters)).
        Parameters:
        offerIds - The collection of offer IDs.
        tasks - The collection of tasks to be launched.
        filters - The filters to set for any remaining resources.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.OfferID, Protos.TaskInfo, Protos.Filters, Protos.Status
      • launchTasks

        Protos.Status launchTasks(java.util.Collection<Protos.OfferID> offerIds,
         java.util.Collection<Protos.TaskInfo> tasks)
        Launches the given set of tasks. See above for details. Note that this may add a default filter (see mesos.proto) for the remaining resources. Notably the MesosSchedulerDriver does so.
        Parameters:
        offerIds - The collection of offer IDs.
        tasks - The collection of tasks to be launched.
        Returns:
        The state of the driver after the call.
      • launchTasks

        Protos.Status launchTasks(Protos.OfferID offerId,
         java.util.Collection<Protos.TaskInfo> tasks,
         Protos.Filters filters)
        Deprecated. Use #launchTasks(Collection, Collection, Filters) instead.
        Parameters:
        offerId - The offer ID.
        tasks - The collection of tasks to be launched.
        filters - The filters to set for any remaining resources.
        Returns:
        The state of the driver after the call.
      • launchTasks

        Protos.Status launchTasks(Protos.OfferID offerId,
         java.util.Collection<Protos.TaskInfo> tasks)
        Deprecated. Use launchTasks(Collection, Collection) instead. Note that this may add a default filter (see mesos.proto) for the remaining resources. Notably the MesosSchedulerDriver does so.
        Parameters:
        offerId - The offer ID.
        tasks - The collection of tasks to be launched.
        Returns:
        The state of the driver after the call.
      • killTask

        Protos.Status killTask(Protos.TaskID taskId)
        Kills the specified task. Note that attempting to kill a task is currently not reliable. If, for example, a scheduler fails over while it was attempting to kill a task it will need to retry in the future Likewise, if unregistered / disconnected, the request will be dropped (these semantics may be changed in the future).
        Parameters:
        taskId - The ID of the task to be killed.
        Returns:
        The state of the driver after the call.
      • acceptOffers

        Protos.Status acceptOffers(java.util.Collection<Protos.OfferID> offerIds,
         java.util.Collection<Protos.Offer.Operation> operations,
         Protos.Filters filters)
        Accepts the given offers and performs a sequence of operations on those accepted offers. See Offer.Operation in mesos.proto for the set of available operations. Any remaining resources (i.e., those that are not used by the launched tasks or their executors) will be considered declined. Note that this includes resources used by tasks that the framework attempted to launch but failed (with TASK_ERROR) due to a malformed task description. The specified filters are applied on all unused resources (see mesos.proto for a description of Filters). Available resources are aggregated when multiple offers are provided. Note that all offers must belong to the same slave.
        Parameters:
        offerIds - The collection of offer IDs.
        operations - The collection of offer operations to perform.
        filters - The filters to set for any remaining resources.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.OfferID, Offer.Operation, Protos.Filters, Protos.Status
      • declineOffer

        Protos.Status declineOffer(Protos.OfferID offerId)
        Declines an offer in its entirety. See above for details.
        Parameters:
        offerId - The ID of the offer to be declined.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.OfferID, Protos.Status
      • reviveOffers

        Protos.Status reviveOffers()
        Removes all filters previously set by the framework (via launchTasks() or declineOffer()) and clears the set of suppressed roles. NOTE: If the framework is not connected to the master, the set of suppressed roles stored by the driver will be cleared, and an up-to-date set of suppressed roles will be sent to the master during re-registration.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.Status
      • reviveOffers

        Protos.Status reviveOffers(java.util.Collection<java.lang.String> roles)
        Removes filters for the specified roles and removes these roles from the suppressed set. If the framework is not connected to the master, an up-to-date set of suppressed roles will be sent to the master during re-registration.
        Parameters:
        roles - The collection of the framework roles to be revivied. If empty, this method does nothing.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.Status
      • suppressOffers

        Protos.Status suppressOffers()
        Informs Mesos master to stop sending offers to the framework (i.e. to suppress all roles of the framework). To resume getting offers, the scheduler can call reviveOffers() or set the suppressed roles explicitly via updateFramework(). NOTE: If the framework is not connected to the master, all the roles will be added to the set of suppressed roles in the driver, and an up-to-date suppressed roles set will be sent to the master during re-registration.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.Status
      • suppressOffers

        Protos.Status suppressOffers(java.util.Collection<java.lang.String> roles)
        Adds the roles to the suppressed set. If the framework is not connected to the master, an up-to-date set of suppressed roles will be sent to the master during re-registration.
        Parameters:
        roles - The collection of framework roles to be suppressed. If empty, the method does nothing.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.Status
      • acknowledgeStatusUpdate

        Protos.Status acknowledgeStatusUpdate(Protos.TaskStatus status)
        Acknowledges the status update. This should only be called once the status update is processed durably by the scheduler. Not that explicit acknowledgements must be requested via the constructor argument, otherwise a call to this method will cause the driver to crash.
        Parameters:
        status - The status to acknowledge.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.TaskStatus
      • sendFrameworkMessage

        Protos.Status sendFrameworkMessage(Protos.ExecutorID executorId,
         Protos.SlaveID slaveId,
         byte[] data)
        Sends a message from the framework to one of its executors. These messages are best effort; do not expect a framework message to be retransmitted in any reliable fashion.
        Parameters:
        executorId - The ID of the executor to send the message to.
        slaveId - The ID of the slave that is running the executor.
        data - The message.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.ExecutorID, Protos.SlaveID
      • reconcileTasks

        Protos.Status reconcileTasks(java.util.Collection<Protos.TaskStatus> statuses)
        Allows the framework to query the status for non-terminal tasks. This causes the master to send back the latest task status for each task in 'statuses', if possible. Tasks that are no longer known will result in a TASK_LOST update. If statuses is empty, then the master will send the latest status for each task currently known.
        Parameters:
        statuses - The collection of non-terminal TaskStatuses to reconcile.
        Returns:
        The state of the driver after the call.
        See Also:
        Protos.TaskStatus, Protos.SlaveID
      • updateFramework

        Protos.Status updateFramework(Protos.FrameworkInfo frameworkInfo,
         java.util.Collection<java.lang.String> suppressedRoles,
         org.apache.mesos.scheduler.Protos.OfferConstraints offerConstraints)
      • updateFramework

        @Deprecated
        Protos.Status updateFramework(Protos.FrameworkInfo frameworkInfo,
         java.util.Collection<java.lang.String> suppressedRoles)
        Deprecated. To call UPDATE_FRAMEWORK without setting offer constraints, use the new `updateFramework()` signature and pass empty constraints (for example, the ones returned by `OfferConstraints.getDefaultInstance()`).
Skip navigation links
  • Summary:
  • Nested |
  • Field |
  • Constr |
  • Method
  • Detail:
  • Field |
  • Constr |
  • Method

AltStyle によって変換されたページ (->オリジナル) /