public class

TaskConfig

extends Object
java.lang.Object
   ↳ org.apache.helix.task.TaskConfig

Class Overview

Configuration for an individual task to be run as part of a job.

Summary

Public Constructors
TaskConfig(String command, Map<StringString> configMap, boolean successOptional, String id, String target)
Instantiate the task config
TaskConfig(String command, Map<StringString> configMap, boolean successOptional)
Instantiate the task config
Public Methods
static TaskConfig from(TaskBean bean)
Instantiate a typed configuration from a bean
static TaskConfig from(Map<StringString> rawConfigMap)
Instantiate a typed configuration from a raw string map
static TaskConfig from(String target)
Instantiate a typed configuration from just a target
String getCommand()
Get the command to invoke for this task
Map<StringString> getConfigMap()
Get the configuration map for this task's command
String getId()
Unique identifier for this task
String getTargetPartition()
Get the target partition of this task, if any
boolean isSuccessOptional()
Check if this task must succeed for a job to succeed
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TaskConfig (String command, Map<StringString> configMap, boolean successOptional, String id, String target)

Instantiate the task config

Parameters
command the command to invoke for the task
configMap configuration to be passed as part of the invocation
successOptional true if this task need not pass for the job to succeed, false otherwise
id existing task ID
target target partition for a task

public TaskConfig (String command, Map<StringString> configMap, boolean successOptional)

Instantiate the task config

Parameters
command the command to invoke for the task
configMap configuration to be passed as part of the invocation
successOptional true if this task need not pass for the job to succeed, false otherwise

Public Methods

public static TaskConfig from (TaskBean bean)

Instantiate a typed configuration from a bean

Parameters
bean plain bean describing the task
Returns
  • instantiated TaskConfig

public static TaskConfig from (Map<StringString> rawConfigMap)

Instantiate a typed configuration from a raw string map

Parameters
rawConfigMap mixed map of configuration and task metadata
Returns
  • instantiated TaskConfig

public static TaskConfig from (String target)

Instantiate a typed configuration from just a target

Parameters
target the target partition
Returns
  • instantiated TaskConfig

public String getCommand ()

Get the command to invoke for this task

Returns
  • string command, or null if not overridden

public Map<StringString> getConfigMap ()

Get the configuration map for this task's command

Returns
  • map of configuration key to value

public String getId ()

Unique identifier for this task

Returns
  • UUID as a string

public String getTargetPartition ()

Get the target partition of this task, if any

Returns
  • the target partition, or null

public boolean isSuccessOptional ()

Check if this task must succeed for a job to succeed

Returns
  • true if success is optional, false otherwise

public String toString ()