Package com.rpl.rama
Class Helpers
java.lang.Object
com.rpl.rama.Helpers
Collection of static utility methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenHashingIndexKeys(int numTasks) Generates a key that hashes to each task in a range of tasks.genHashingIndexKeys(String prefix, int numTasks) Generates a key starting with the given prefix that hashes to each task in a range of tasks.static StringGenerates a unique PState varstatic StringgenPStateVar(String prefix) Generates a unique PState var with the given prefixstatic StringgenVar()Generates a unique varstatic StringGenerates a unique var with the given prefixstatic StringGets prefix string used to generate a varstatic booleanTests if a string has the format of a regular var or PState var
-
Constructor Details
-
Helpers
public Helpers()
-
-
Method Details
-
genVar
Generates a unique var with the given prefix- Parameters:
prefix- Prefix string- Returns:
- Generated var
- See Also:
-
genVar
Generates a unique var- Returns:
- Generated var
- See Also:
-
genPStateVar
Generates a unique PState var with the given prefix- Parameters:
prefix- Prefix string- Returns:
- Generated var
- See Also:
-
genPStateVar
Generates a unique PState var- Returns:
- Generated var
- See Also:
-
isGeneratedVar
Tests if a string has the format of a regular var or PState var- Parameters:
s- String to test- See Also:
-
getGeneratedVarPrefix
Gets prefix string used to generate a var- Parameters:
var- Var- See Also:
-
genHashingIndexKeys
Generates a key that hashes to each task in a range of tasks. The nth element in the returned list partitions to the nth task. This function is deterministic and will always produce the same keys.- Parameters:
numTasks- Number of tasks
-
genHashingIndexKeys
Generates a key starting with the given prefix that hashes to each task in a range of tasks. The nth element in the returned list partitions to the nth task. This function is deterministic and will always produce the same keys. Calling this function with different prefixes will produce unique keys.- Parameters:
prefix- Prefix for each generated keynumTasks- Number of tasks
-