Advertisement
Guest User

UDAF_v1

a guest
Aug 7th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. public class SomeUDAF extends UDAF {
  2.     static final Log LOG = LogFactory.getLog(UDAFFoldIn.class.getName());
  3.    
  4.     public static class SomeUDAFEvaluator implements UDAFEvaluator{
  5.        
  6.         public static class FinalResult{
  7.             //class to stores partial results
  8.         }
  9.            
  10.         public static class PartialResult{
  11.             //class to store final result
  12.         }
  13.        
  14.         public void init() {
  15.             //initialize
  16.         }
  17.        
  18.         public boolean aggregate(DoubleWritable wm, DoubleWritable lambda,
  19.             //aggregate values
  20.             return true;
  21.         }
  22.        
  23.         public PartialResult evaluatePartial(){
  24.             //return partial result
  25.             return new PartialResult();
  26.         }
  27.        
  28.         public boolean aggregatePartial(PartialResult other) throws Exception{
  29.             //aggregate partial
  30.             return true;
  31.         }
  32.        
  33.         public FinalResult evaluate(){
  34.             //return final result
  35.             return new FinalResult();
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement