Class TaskProperties.Builder
- java.lang.Object
-
- com.snowflake.connectors.common.task.TaskProperties.Builder
-
- Enclosing class:
- TaskProperties
public static class TaskProperties.Builder extends Object
Builder for theTaskProperties
.
-
-
Constructor Summary
Constructors Constructor Description Builder(ObjectName objectName, String definition, String schedule)
Creates a newTaskProperties.Builder
.Builder(TaskProperties properties)
Creates a newTaskProperties.Builder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskProperties
build()
Build new task properties.TaskProperties.Builder
withAllowOverlappingExecution(boolean allowOverlappingExecution)
Sets the task overlapping execution allowance used to build task properties.TaskProperties.Builder
withCondition(String condition)
Sets the task condition used to build task properties.TaskProperties.Builder
withSchedule(String schedule)
Sets the task schedule used to build task properties.TaskProperties.Builder
withState(String state)
Sets the task state used to build task properties.TaskProperties.Builder
withSuspendTaskAfterNumFailures(int failuresNumberToSuspension)
Sets the number of task failures before suspension used to build task properties.TaskProperties.Builder
withWarehouse(Identifier warehouseIdentifier)
Sets the warehouse identifier used to build task properties.TaskProperties.Builder
withWarehouse(Reference warehouseReference)
Sets the warehouse reference used to build task properties.TaskProperties.Builder
withWarehouse(String warehouse)
Sets the warehouse used to build task properties.TaskProperties.Builder
withWarehouse(String warehouse, Identifier.AutoQuoting autoQuoting)
Sets the warehouse used to build task properties.
-
-
-
Constructor Detail
-
Builder
public Builder(ObjectName objectName, String definition, String schedule)
Creates a newTaskProperties.Builder
.- Parameters:
objectName
- task object namedefinition
- task definitionschedule
- task schedule
-
Builder
public Builder(TaskProperties properties)
Creates a newTaskProperties.Builder
.- Parameters:
properties
- task properties
-
-
Method Detail
-
withState
public TaskProperties.Builder withState(String state)
Sets the task state used to build task properties.- Parameters:
state
- task state- Returns:
- this builder
-
withWarehouse
public TaskProperties.Builder withWarehouse(Reference warehouseReference)
Sets the warehouse reference used to build task properties.- Parameters:
warehouseReference
- warehouse reference- Returns:
- this builder
-
withWarehouse
public TaskProperties.Builder withWarehouse(Identifier warehouseIdentifier)
Sets the warehouse identifier used to build task properties.- Parameters:
warehouseIdentifier
- warehouse identifier- Returns:
- this builder
-
withWarehouse
public TaskProperties.Builder withWarehouse(String warehouse)
Sets the warehouse used to build task properties.The provided String can be a warehouse identifier or a reference. If a warehouse identifier is provided - a new identifier instance is created without any auto quoting.
- Parameters:
warehouse
- warehouse identifier or reference- Returns:
- this builder
-
withWarehouse
public TaskProperties.Builder withWarehouse(String warehouse, Identifier.AutoQuoting autoQuoting)
Sets the warehouse used to build task properties.- Parameters:
warehouse
- warehouse identifier or reference- Returns:
- this builder
-
withCondition
public TaskProperties.Builder withCondition(String condition)
Sets the task condition used to build task properties.- Parameters:
condition
- task condition- Returns:
- this builder
-
withAllowOverlappingExecution
public TaskProperties.Builder withAllowOverlappingExecution(boolean allowOverlappingExecution)
Sets the task overlapping execution allowance used to build task properties.- Parameters:
allowOverlappingExecution
- overlapping execution allowance- Returns:
- this builder
-
withSuspendTaskAfterNumFailures
public TaskProperties.Builder withSuspendTaskAfterNumFailures(int failuresNumberToSuspension)
Sets the number of task failures before suspension used to build task properties.- Parameters:
failuresNumberToSuspension
- number of task failures before suspension- Returns:
- this builder
-
withSchedule
public TaskProperties.Builder withSchedule(String schedule)
Sets the task schedule used to build task properties.- Parameters:
schedule
- task schedule- Returns:
- this builder
-
build
public TaskProperties build()
Build new task properties.- Returns:
- new task properties
-
-