Interface SupervisorSpec

All Known Implementing Classes:
NoopSupervisorSpec

public interface SupervisorSpec
  • Method Details

    • getId

      String getId()
      Return a unique id of Supervisor.
    • createSupervisor

      Supervisor createSupervisor()
      Create a new Supervisor instance.
    • createAutoscaler

      default SupervisorTaskAutoScaler createAutoscaler(Supervisor supervisor)
    • getDataSources

      List<String> getDataSources()
    • createSuspendedSpec

      default SupervisorSpec createSuspendedSpec()
    • createRunningSpec

      default SupervisorSpec createRunningSpec()
    • isSuspended

      default boolean isSuspended()
    • getType

      String getType()
      This API is only used for informational purposes in org.apache.druid.sql.calcite.schema.SystemSchema.SupervisorsTable
      Returns:
      supervisor type
    • getInputSourceResources

      @Nonnull default Set<ResourceAction> getInputSourceResources() throws UnsupportedOperationException
      Returns:
      The types of InputSource that the task uses. Empty set is returned if the task does not use any. Users can be given permission to access particular types of input sources but not others, using the AuthConfig.enableInputSourceSecurity config.
      Throws:
      UnsupportedOperationException
    • getSource

      String getSource()
      Return source (like stream or topic name) for the supervisor This API is currently used for spec validation in org.apache.druid.indexing.seekablestream.supervisor.SeekableStreamSupervisorSpec and for returning the spec with source in org.apache.druid.indexing.overlord.supervisor.SupervisorResource when the spec is requested with system flag.
      Returns:
      source
    • validateSpec

      default void validateSpec() throws DruidException
      Validates this supervisor spec against current system state at submission time. Implementations should throw a DruidException with category DruidException.Category.INVALID_INPUT when the spec should be rejected.

      The default implementation does no validation.

      Throws:
      DruidException
    • validateSpecUpdateTo

      default void validateSpecUpdateTo(SupervisorSpec proposedSpec) throws DruidException
      Checks if a spec can be replaced with a proposed spec (proposesSpec).

      By default, this method does no validation checks. Implementations of this method can choose to define rules for spec updates and throw an exception if the update is not allowed.

      Parameters:
      proposedSpec - the proposed supervisor spec
      Throws:
      DruidException - if the spec update is not allowed
    • merge

      default void merge(@NotNull @NotNull SupervisorSpec existingSpec)
      Updates this supervisor spec by merging values from the given existingSpec. This method may be used to carry forward existing spec values when a supervisor is being resubmitted.
      Parameters:
      existingSpec - used spec to merge values from