parallel
Class PartitionedParallelRegexGrep
- java.lang.Object
-
- parallel.PartitionedParallelRegexGrep
-
public class PartitionedParallelRegexGrep extends java.lang.Object
PartitionedParallelRegexGrep is like ParallelRegexGrep, except that the Java object in the tuple being passed into the parallel region implements the Keyable interface, and provides a getKey() function which is used to map tuples to their corresponding channel in the parallel region. Each channel of the parallel region only receives tuples that have the same hashCode() value of the Key returned by the tuple value's getKey() method. In other words, for each tuple, the value returned by tupleValue.getKey().hashCode() will go to the same channel, for each tuple which returns that result. To show this, instead of passing a java.lang.String into the parallel region, a stringWrapper class is created that implements the Keyable interface. For this sample, if you read from a file that contains the following: Apple Orange Banana Banana Apple Apple you notice that the lines containing Apple will always be sent to the same channel of the parallel region; the same for the lines containing Orange and Banana.
-
-
Constructor Summary
Constructors Constructor and Description PartitionedParallelRegexGrep()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidmain(java.lang.String[] args)
-
-
-
Constructor Detail
-
PartitionedParallelRegexGrep
public PartitionedParallelRegexGrep()
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-