flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apali...@apache.org
Subject svn commit: r1693347 - in /flume/site/trunk/content/sphinx: FlumeDeveloperGuide.rst FlumeUserGuide.rst
Date Wed, 29 Jul 2015 21:07:58 GMT
Author: apaliwal
Date: Wed Jul 29 21:07:58 2015
New Revision: 1693347

URL: http://svn.apache.org/r1693347
Log:
Updated docs for FLUME-2660, fixed the headline and commit error

Modified:
    flume/site/trunk/content/sphinx/FlumeDeveloperGuide.rst
    flume/site/trunk/content/sphinx/FlumeUserGuide.rst

Modified: flume/site/trunk/content/sphinx/FlumeDeveloperGuide.rst
URL: http://svn.apache.org/viewvc/flume/site/trunk/content/sphinx/FlumeDeveloperGuide.rst?rev=1693347&r1=1693346&r2=1693347&view=diff
==============================================================================
--- flume/site/trunk/content/sphinx/FlumeDeveloperGuide.rst (original)
+++ flume/site/trunk/content/sphinx/FlumeDeveloperGuide.rst Wed Jul 29 21:07:58 2015
@@ -15,7 +15,7 @@
 
 
 ======================================
-Flume 1.7.0-SNAPSHOT Developer Guide
+Flume 1.6.0 Developer Guide
 ======================================
 
 Introduction

Modified: flume/site/trunk/content/sphinx/FlumeUserGuide.rst
URL: http://svn.apache.org/viewvc/flume/site/trunk/content/sphinx/FlumeUserGuide.rst?rev=1693347&r1=1693346&r2=1693347&view=diff
==============================================================================
--- flume/site/trunk/content/sphinx/FlumeUserGuide.rst (original)
+++ flume/site/trunk/content/sphinx/FlumeUserGuide.rst Wed Jul 29 21:07:58 2015
@@ -15,7 +15,7 @@
 
 
 ======================================
-Flume 1.7.0-SNAPSHOT User Guide
+Flume 1.6.0 User Guide
 ======================================
 
 Introduction
@@ -3748,7 +3748,7 @@ The tools can be run as follows::
 
   $bin/flume-ng tool --conf ./conf FCINTEGRITYTOOL -l ./datadir
 
-where datadir the comma separated list of data directory to ve verified.
+where datadir is the comma separated list of data directory to be verified.
 
 Following are the options available
 
@@ -3759,7 +3759,66 @@ h/help                   Displays help
 **l/dataDirs**           Comma-separated list of data directories which the tool must verify
 =======================  ====================================================================
 
+Event Validator Tool
+--------------------
 
+Event validator tool can be used to validate the File Channel Event's in application specific
way.
+The tool applies the user provider validation login on each event and drop the event which
do not
+confirm to the logic.
+
+The tools can be run as follows::
+
+  $bin/flume-ng tool --conf ./conf FCINTEGRITYTOOL -l ./datadir -e org.apache.flume.MyEventValidator
-DmaxSize 2000
+
+where datadir is the comma separated list of data directory to be verified.
+
+Following are the options available
+
+=======================  ====================================================================
+Option Name              Description
+=======================  ====================================================================
+h/help                   Displays help
+**l/dataDirs**           Comma-separated list of data directories which the tool must verify
+e/eventValidator         Fully Qualified Name of Event Validator Implementation. The jar
must
+                         be on Flume classpath
+=======================  ====================================================================
+
+The Event validator implementation must implement EventValidator interface. It's recommended
+not to throw any exception from the implementation as they are treated as invalid events.
+Additional parameters can be passed to EventValitor implementation via -D options.
+
+Let's see an example of simple size based Event Validator, which shall reject event's larger
+than maximum size specified.
+
+.. code-block:: java
+  public static class MyEventValidator implements EventValidator {
+
+    private int value = 0;
+
+    private MyEventValidator(int val) {
+      value = val;
+    }
+
+    @Override
+    public boolean validateEvent(Event event) {
+      return event.getBody() <= value;
+    }
+
+    public static class Builder implements EventValidator.Builder {
+
+      private int sizeValidator = 0;
+
+      @Override
+      public EventValidator build() {
+        return new DummyEventVerifier(sizeValidator);
+      }
+
+      @Override
+      public void configure(Context context) {
+        binaryValidator = context.getInteger("maxSize");
+      }
+    }
+  }
 
 
 Topology Design Considerations



Mime
View raw message