Interface SupervisorSpec
- All Known Implementing Classes:
NoopSupervisorSpec
public interface SupervisorSpec
-
Method Summary
Modifier and TypeMethodDescriptiondefault SupervisorTaskAutoScalercreateAutoscaler(Supervisor supervisor) default SupervisorSpecCreate a newSupervisorinstance.default SupervisorSpecgetId()Return a unique id ofSupervisor.default Set<ResourceAction>Return source (like stream or topic name) for the supervisor This API is currently used for spec validation inorg.apache.druid.indexing.seekablestream.supervisor.SeekableStreamSupervisorSpecand for returning the spec with source inorg.apache.druid.indexing.overlord.supervisor.SupervisorResourcewhen the spec is requested with system flag.getType()This API is only used for informational purposes in org.apache.druid.sql.calcite.schema.SystemSchema.SupervisorsTabledefault booleandefault voidmerge(@NotNull SupervisorSpec existingSpec) Updates this supervisor spec by merging values from the givenexistingSpec.default voidValidates this supervisor spec against current system state at submission time.default voidvalidateSpecUpdateTo(SupervisorSpec proposedSpec) Checks if a spec can be replaced with a proposed spec (proposesSpec).
-
Method Details
-
getId
String getId()Return a unique id ofSupervisor. -
createSupervisor
Supervisor createSupervisor()Create a newSupervisorinstance. -
createAutoscaler
-
getDataSources
-
createSuspendedSpec
-
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
- Returns:
- The types of
InputSourcethat 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 theAuthConfig.enableInputSourceSecurityconfig. - Throws:
UnsupportedOperationException
-
getSource
String getSource()Return source (like stream or topic name) for the supervisor This API is currently used for spec validation inorg.apache.druid.indexing.seekablestream.supervisor.SeekableStreamSupervisorSpecand for returning the spec with source inorg.apache.druid.indexing.overlord.supervisor.SupervisorResourcewhen the spec is requested with system flag.- Returns:
- source
-
validateSpec
Validates this supervisor spec against current system state at submission time. Implementations should throw aDruidExceptionwith categoryDruidException.Category.INVALID_INPUTwhen the spec should be rejected.The default implementation does no validation.
- Throws:
DruidException
-
validateSpecUpdateTo
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
Updates this supervisor spec by merging values from the givenexistingSpec. 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
-