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.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void main(java.lang.String[] args) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
streamsx.topology @ IBMStreams GitHub