Wednesday, October 12, 2016

Pipe : 101


  1. Transformation is done through Pipe #40
  2. branch : Chain of pipes without merge or split is called as branch #40
  3. Pipe Operations #40
    1. Filter
    2. Function
    3. Aggregator
    4. Count
    5. Buffer
    6. Assertion
  4. Examples
    1. ----- Example 1
    2. Pipe firstPipe = new Pipe("main"); 
    3. Pipe eachPipe = new Each(firstPipe, new MyFunction()); 
    4. eachPipe = new Each(firstPipe, new MyFilter());
  5. 'Each' (given above in example) #41
    1. Flows tuples one at a time through processing chain
    2. Allows 'Function' or 'Filter' operation
    3. ----- Example 1
    4. Pipe payroll =Pipe("payroll"); 
    5. payroll = new Each(payroll, new calc_raise(), new Fields("name","division","salary","raise")); 
  6. Splitting a Pipe #42
    1. ----- Example 1
    2. Pipe hrdata = new Each("hrdata", new Fields("name","address","phone")); 
    3. Pipe developers = new Each(hrdata, new GetDevelopers());  //This is a filter
    4. Pipe managers = new Each(hrdata, new GetManagers());  // This is a filter
  7. 'GroupBy' Pipe (GroupBy & sorting) #44
    1. ----- Example 1
    2. Pipe payroll = new Each("payroll", new Fields("division", "name", "salary", "rise"), new Identity()); 
    3. // Group by division, sort by salary 
      Fields groupFields = new Fields( "division"); 
      Fields sortFields = new Fields( "salary" ); 
      Pipe assembly = new GroupBy( payroll, groupFields, sortFields ); 
  8. 'Every' Pipe #44
    1. Operates on Groups of records (from GroupBy or CoGroup pipes)
  9. 'Merge' Pipe #46
    1. To join multiple stream into a single stream
  10. Join pipes #46
    1. CoGroup Pipe
    2. HashJoin Pipe 

No comments:

Post a Comment