Review Board 1.7.22


Flume-1001 Support custom processors

Review Request #4152 - Created March 2, 2012 and submitted

Juhani Connolly
Flume-728
FLUME-1001
Reviewers
Flume
flume-git
Made custom processors possible in the same way as sink and source: the type can represent a classname or a shorthand name from the typedef.
Existing tests pass, except I'm having an issue with TestNetcatSource which seems to be totally unrelated... It turns up on flume-728 head too, probably something in my environment

Added a new test to verify that processors created by shorthand name and by full class create the same class, verifying that creation by classname also works
flume-ng-core/src/main/java/org/apache/flume/SinkProcessorType.java
Revision be1891b New Change
[20] 31 lines
[+20]
32
  /**
32
  /**
33
   * Standard processor
33
   * Standard processor
34
   * 
34
   * 
35
   * @see DefaultSinkProcessor
35
   * @see DefaultSinkProcessor
36
   */
36
   */
37
  DEFAULT(DefaultSinkProcessor.class.getName());
37
  DEFAULT(DefaultSinkProcessor.class.getName()),

    
   
38

   

    
   
39
  /**

    
   
40
   * Custom processor

    
   
41
   */

    
   
42
  OTHER(null);
38
  private final String processorClassName;
43
  private final String processorClassName;
39

    
   
44

   
40
  private SinkProcessorType(String processorClassName) {
45
  private SinkProcessorType(String processorClassName) {
41
    this.processorClassName = processorClassName;
46
    this.processorClassName = processorClassName;
42
  }
47
  }
43

    
   
48

   
44
  public String getSinkProcessorClassName() {
49
  public String getSinkProcessorClassName() {
45
    return processorClassName;
50
    return processorClassName;
46
  }
51
  }
47
}
52
}
flume-ng-core/src/main/java/org/apache/flume/sink/SinkProcessorFactory.java
Revision 10f9f4e New Change
 
flume-ng-core/src/test/java/org/apache/flume/sink/TestSinkProcessorFactory.java
New File
 
  1. flume-ng-core/src/main/java/org/apache/flume/SinkProcessorType.java: Loading...
  2. flume-ng-core/src/main/java/org/apache/flume/sink/SinkProcessorFactory.java: Loading...
  3. flume-ng-core/src/test/java/org/apache/flume/sink/TestSinkProcessorFactory.java: Loading...