public class ForkOperatorUtils extends Object
ForkOperator class.| Constructor and Description |
|---|
ForkOperatorUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getForkId(String taskId,
int index)
Get the fork branch ID of a branch of a given task.
|
static String |
getPathForBranch(State state,
String path,
int numBranches,
int branchId)
Get a new path with the given branch name as a sub directory.
|
static String |
getPropertyNameForBranch(String key,
int branch)
Get a new property key from an original one with branch index (if applicable).
|
static String |
getPropertyNameForBranch(String key,
int numBranches,
int branchId)
Get a new property key from an original one with branch index (if applicable).
|
static String |
getPropertyNameForBranch(WorkUnitState workUnitState,
String key)
Get a new property key from an original one based on the branch id.
|
public static String getPropertyNameForBranch(String key, int numBranches, int branchId)
key - property keynumBranches - number of branches (non-negative)branchId - branch id (non-negative)public static String getPropertyNameForBranch(String key, int branch)
key - property keybranch - branch indexpublic static String getPropertyNameForBranch(WorkUnitState workUnitState, String key)
ConfigurationKeys.FORK_BRANCH_ID_KEY parameter in the given WorkUnitState. The fork id key specifies
which fork this parameter belongs to. Note this method will only provide the aforementioned functionality for
Converters. To get the same functionality in DataWriters use
the DataWriterBuilder.forBranch(int) to construct a writer with a specific branch id.workUnitState - contains the fork id keykey - property keypublic static String getPathForBranch(State state, String path, int numBranches, int branchId)
numBranches - number of branches (non-negative)branchId - branch id (non-negative)