Return-Path: X-Original-To: apmail-flume-user-archive@www.apache.org Delivered-To: apmail-flume-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 164D411D51 for ; Wed, 30 Jul 2014 15:47:43 +0000 (UTC) Received: (qmail 92026 invoked by uid 500); 30 Jul 2014 15:47:42 -0000 Delivered-To: apmail-flume-user-archive@flume.apache.org Received: (qmail 91962 invoked by uid 500); 30 Jul 2014 15:47:42 -0000 Mailing-List: contact user-help@flume.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flume.apache.org Delivered-To: mailing list user@flume.apache.org Received: (qmail 91949 invoked by uid 99); 30 Jul 2014 15:47:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2014 15:47:42 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 209.85.220.175 is neither permitted nor denied by domain of matt.tenenbaum@rockyou.com) Received: from [209.85.220.175] (HELO mail-vc0-f175.google.com) (209.85.220.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2014 15:47:40 +0000 Received: by mail-vc0-f175.google.com with SMTP id ik5so2085510vcb.6 for ; Wed, 30 Jul 2014 08:47:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=roLam62DsAoFpQI4JOBIKUsmhSbsJieMEiAN7SAFa8w=; b=kn0sF0//XbaKeDX33YwcjRvGQsJLNaA1Xdi+GaIOWRm5MNYkPRQqTYd+pRtjs9aRv7 EUFK5H5z9xRZnbflqyj8/3iEcMtfrCoyC6TU+YruZEzfWpFfhCJWy28HxOheIDgJ7SDD wkBxHsMXqHhE2QUvOXnXh1G8uS22F4U/k2MkFbjGz5YLVcHZCio/JFHAh8kFlNU7Faln 4hEGx0tnqjcW4ouardQxzUfeaMVF3hb9PsVm9ffhGq6WANWZbZPetrCIUKFhjmnxjRU2 q1Jmn+enUq3SG69nEHVEavpTGHDMS5oEeCehfJsfV8pMcR7Ft9K4P43x0h4fUAkN6ucU hO3Q== X-Gm-Message-State: ALoCoQkpL8coCuMjEz5EkPMvKbYRJ/c6WDIVa1GAy7UK0u8UZr4jWBGh7eTgLkrigvNohdEajqmv X-Received: by 10.52.12.229 with SMTP id b5mr8835924vdc.52.1406735235591; Wed, 30 Jul 2014 08:47:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.65.144 with HTTP; Wed, 30 Jul 2014 08:46:55 -0700 (PDT) In-Reply-To: References: From: Matt Tenenbaum Date: Wed, 30 Jul 2014 08:46:55 -0700 Message-ID: Subject: Re: Interceptor, multiplexing Events to two differents path in HDFS dynamically, To: user Content-Type: multipart/alternative; boundary=20cf302efbb202e49504ff6b1205 X-Virus-Checked: Checked by ClamAV on apache.org --20cf302efbb202e49504ff6b1205 Content-Type: text/plain; charset=UTF-8 Hi Guillermo -- If I understand correctly, you want to create two paths. Events that pass the validating interceptor get directed to one path in HDFS and events that fail get directed to another. If so, you could define your interceptor to set a 'valid' header to 'yes' or 'no' depending on its internal logic. Then you would be able to use the ordinary 'selector.mapping' configuration behavior to route to separate channels and attach your separate destinations as sinks to each of those channels. I'm omitting all but the relevant configurations: multi.sources = s1 multi.sinks = valid invalid multi.channels = cpos cneg multi.sources.s1.selector.type = multiplexing # Route based on the value of the 'valid' header set by the interceptor multi.sources.s1.selector.header = valid # Send events with valid == yes to 'cpos' channel multi.sources.s1.selector.mapping.yes = cpos # Send events with valid == no to 'cneg' channel multi.sources.s1.selector.mapping.no = cneg multi.sinks.valid.type = hdfs multi.sinks.valid.channel = cpos multi.sinks.valid.hdfs.path = hdfs://nn/path/for/valid/data # Other configurations for valid data... multi.sinks.invalid.type = hdfs multi.sinks.invalid.channel = cneg multi.sinks.invalid.hdfs.path = hdfs://nn/path/for/invalid/data # Other configuration for data that fails validation... Would that do what you want? Cheers -mt On Wed, Jul 30, 2014 at 6:02 AM, Guillermo Ortiz wrote: > Hello, > > > I want to create an interceptor to validate and multiplexing the Events, > if they don't get validated to send them a different path in HDFS. > > Is it possible to do it? > I thought.. to have others interceptor and the HDFS path is built on base > of these static interceptors, so I could modify them on my validator > interceptor. Is it fine? > --20cf302efbb202e49504ff6b1205 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Guillermo --

If I understand correct= ly, you want to create two paths. Events that pass the validating intercept= or get directed to one path in HDFS and events that fail get directed to an= other. If so, you could define your interceptor to set a 'valid' he= ader to 'yes' or 'no' depending on its internal logic. Then= you would be able to use the ordinary 'selector.mapping' configura= tion behavior to route to separate channels and attach your separate destin= ations as sinks to each of those channels. I'm omitting all but the rel= evant configurations:


multi.sources =3D s1
multi.sin= ks =3D valid invalid
multi.channels =3D cpos cneg

<= /div>
multi.sources.s1.selector.type =3D multiplexing
# Route= based on the value of the 'valid' header set by the interceptor
multi.sources.s1.selector.header =3D valid
# Send events wit= h valid =3D=3D yes to 'cpos' channel
multi.sources.s1.sel= ector.mapping.yes =3D cpos
# Send events with valid =3D=3D no to = 'cneg' channel

multi.sinks.va= lid.type =3D hdfs
multi.sinks.valid.channel =3D cpos
mu= lti.sinks.valid.hdfs.path =3D hdfs://nn/path/for/valid/data
# Other configurations for valid data...

mult= i.sinks.invalid.type =3D hdfs
multi.sinks.invalid.channel =3D cne= g
multi.sinks.invalid.hdfs.path =3D hdfs://nn/path/for/invalid/da= ta
# Other configuration for data that fails validation...

=
Would that do what you want?

Cheers
-mt
--20cf302efbb202e49504ff6b1205--