Interface StepProcessorContext
public interface StepProcessorContext
Context for the main processing logic of the custom step.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the cache configuration builder for the custom step.Returns the cache manager for the custom step.getColumnFromChooserValues
(String columnChooserId) Convenience method to returns the columns selected by the user.getIndexRowValues
(String indexName, int rowIndex) Method to return the index row valuesgetInputContext
(String inputId) Returns the input context of the custom step.<T> Optional<T>
getResource
(String resourceId, Class<T> resourceClass) Returns the resource to be used by the custom step.<T> Optional<T>
getStepPropertyValue
(String stepPropertyId) Returns the step property value based on the step property ID specified.getStepSettingFieldValueAsString
(String stepSettingFieldId) Returns the step setting field value as a string based on the step setting field ID specified.boolean
Interactive is a flag that set to `true` when the user views the output of a step on the Data Studio Grid (UI).void
progressChanged
(double progressPercent) Update the step execution's progress bar percentage.void
progressChanged
(String message, double progressPercent) Update the step execution's progress bar percentage with additional message.
-
Method Details
-
getInputContext
Returns the input context of the custom step. Input context returned is based on the input ID specified.- Parameters:
inputId
- ID of input associated with input context- Returns:
ProcessorInputContext
associated with input ID
-
progressChanged
void progressChanged(double progressPercent) Update the step execution's progress bar percentage. This method must not used insideOutputColumnManager.onValue(String, LongFunction)
andOutputColumnManager.onValue(String, BiFunction)
- Parameters:
progressPercent
- progress percentage. Valid value is between 0.0 to 1.0, e.g. 0.1 is 10%, 0.5 is 50%.
-
progressChanged
Update the step execution's progress bar percentage with additional message. This method must not used insideOutputColumnManager.onValue(String, LongFunction)
andOutputColumnManager.onValue(String, BiFunction)
- Parameters:
message
- progress message.progressPercent
- progress percentage. Valid value is between 0.0 to 1.0, e.g. 0.1 is 10%, 0.5 is 50%.
-
getStepPropertyValue
Returns the step property value based on the step property ID specified.- Type Parameters:
T
- Type of the step property value- Parameters:
stepPropertyId
- ID of step property- Returns:
- Step property value
-
getCacheManager
StepCacheManager getCacheManager()Returns the cache manager for the custom step.- Returns:
StepCacheManager
for the custom step
-
getCacheConfigurationBuilder
StepCacheConfigurationBuilder getCacheConfigurationBuilder()Returns the cache configuration builder for the custom step.- Returns:
StepCacheConfigurationBuilder
for the custom step
-
getResource
Returns the resource to be used by the custom step.Resources refer to any shared resources that can be created and used throughout processing. The resource should be closed after processing.
- Type Parameters:
T
- Type of step resource- Parameters:
resourceId
- ID of resource to be returnedresourceClass
- Class of the step resource- Returns:
- Step resource with specified ID
-
getStepSettingFieldValueAsString
Returns the step setting field value as a string based on the step setting field ID specified.- Parameters:
stepSettingFieldId
- ID of the step setting field to be returned- Returns:
- String value of the step setting field
-
isInteractive
boolean isInteractive()Interactive is a flag that set to `true` when the user views the output of a step on the Data Studio Grid (UI). In interactive mode, the evaluator ofOutputColumnManager.onValue(String, LongFunction)
will only be executed when the cell is visible. It is set to `false` when running the whole workflow as a Job.- Returns:
true
if the execution is interactive, otherwisefalse
-
getColumnFromChooserValues
Convenience method to returns the columns selected by the user. It will returns empty list if the column chooser is invalid or the step property is not a column chooser.- Parameters:
columnChooserId
- the column chooser's step property ID- Returns:
- the list of selected
InputColumn
-
getIndexRowValues
Method to return the index row values- Parameters:
indexName
- Index namerowIndex
- The specified row of the index- Returns:
- The list of
CellValue
at the specified row of the index
-