Review Board 1.7.22


Brock Noland got review request #8558!

FLUME-1777: AbstractSource does not provide enough implementation for sub-classes

Review Request #8558 - Created Dec. 12, 2012 and submitted

Brock Noland
trunk
FLUME-1777
Reviewers
Flume
flume-git
Adds BasicSourceSemantics (named similar to the Channel abstract classes) which sets the life cycle state appropriate, doesn't require the use of super, and allows subclasses to set the lifecycle state. Additionall adds AbstractPollableSource and AbstractEventDrivenSource.
Unit tests added, pass.
flume-ng-core/src/main/java/org/apache/flume/source/AbstractEventDrivenSource.java
New File

    
   
1
/*

    
   
2
 * Licensed to the Apache Software Foundation (ASF) under one

    
   
3
 * or more contributor license agreements.  See the NOTICE file

    
   
4
 * distributed with this work for additional information

    
   
5
 * regarding copyright ownership.  The ASF licenses this file

    
   
6
 * to you under the Apache License, Version 2.0 (the

    
   
7
 * "License"); you may not use this file except in compliance

    
   
8
 * with the License.  You may obtain a copy of the License at

    
   
9
 *

    
   
10
 * http://www.apache.org/licenses/LICENSE-2.0

    
   
11
 *

    
   
12
 * Unless required by applicable law or agreed to in writing,

    
   
13
 * software distributed under the License is distributed on an

    
   
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

    
   
15
 * KIND, either express or implied.  See the License for the

    
   
16
 * specific language governing permissions and limitations

    
   
17
 * under the License.

    
   
18
 */

    
   
19
package org.apache.flume.source;

    
   
20

   

    
   
21
import org.apache.flume.EventDrivenSource;

    
   
22
import org.apache.flume.annotations.InterfaceAudience;

    
   
23
import org.apache.flume.annotations.InterfaceStability;

    
   
24

   

    
   
25
/**

    
   
26
 * Base class which ensures sub-classes will inherit all the properties

    
   
27
 * of BasicSourceSemantics. Adds no additional functionality and is provided

    
   
28
 * for completeness sake.

    
   
29
 */

    
   
30
@InterfaceAudience.Public

    
   
31
@InterfaceStability.Evolving

    
   
32
public abstract class AbstractEventDrivenSource extends BasicSourceSemantics

    
   
33
  implements EventDrivenSource {

    
   
34

   

    
   
35
  public AbstractEventDrivenSource() {

    
   
36
    super();

    
   
37
  }

    
   
38
}
flume-ng-core/src/main/java/org/apache/flume/source/AbstractPollableSource.java
New File
 
flume-ng-core/src/main/java/org/apache/flume/source/BasicSourceSemantics.java
New File
 
flume-ng-core/src/main/java/org/apache/flume/source/http/HTTPSource.java
Revision d4d818a New Change
 
flume-ng-core/src/test/java/org/apache/flume/source/TestAbstractPollableSource.java
New File
 
flume-ng-core/src/test/java/org/apache/flume/source/TestBasicSourceSemantics.java
New File
 
  1. flume-ng-core/src/main/java/org/apache/flume/source/AbstractEventDrivenSource.java: Loading...
  2. flume-ng-core/src/main/java/org/apache/flume/source/AbstractPollableSource.java: Loading...
  3. flume-ng-core/src/main/java/org/apache/flume/source/BasicSourceSemantics.java: Loading...
  4. flume-ng-core/src/main/java/org/apache/flume/source/http/HTTPSource.java: Loading...
  5. flume-ng-core/src/test/java/org/apache/flume/source/TestAbstractPollableSource.java: Loading...
  6. flume-ng-core/src/test/java/org/apache/flume/source/TestBasicSourceSemantics.java: Loading...