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 5EA6611BE5 for ; Mon, 25 Aug 2014 05:21:02 +0000 (UTC) Received: (qmail 58554 invoked by uid 500); 25 Aug 2014 05:21:02 -0000 Delivered-To: apmail-flume-user-archive@flume.apache.org Received: (qmail 58515 invoked by uid 500); 25 Aug 2014 05:21:01 -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 58505 invoked by uid 99); 25 Aug 2014 05:21:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2014 05:21:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hshreedharan@cloudera.com designates 209.85.213.169 as permitted sender) Received: from [209.85.213.169] (HELO mail-ig0-f169.google.com) (209.85.213.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2014 05:20:57 +0000 Received: by mail-ig0-f169.google.com with SMTP id r2so3663562igi.2 for ; Sun, 24 Aug 2014 22:20:37 -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=uP1w+MTe5ZmUbAI3XtNrpc547XBMaKC4KgN5z8JfCSY=; b=RYhzoE3i2AspoNPE58J7vEDCKM0B+lh28yDpcqGBKYe6I2SJFEUeigNM0xmFbB7QOM VbZGrlHzDpiPa3J2ZIMAzaQrSsyJviPzICwGbzt1Aw5AEWq0PSluZmVyQfuCZvidz0Aj 3HtDIJCxJDejhJXfr1oxvxX+RQijkfqL4e7gdQcbtLhrLneqlGj0xrHQr1INAW3kv538 BE2X3r46AUzV2gNYD3i+dEKdWc6rsH7MeEign22K8GcuJ+7mSRXDQyTdaVlXgSjUSwhA vrBW3UaA43qoojvwb9Xyp7u+MP4s/e9CiZia5NvfyB4q0MXFc3qWLEX2YmA2OSzrlGon e5Lg== X-Gm-Message-State: ALoCoQla61srhNSW8UFvIaPyrSsGmCekOo3hDnt5c1JoDOqAJTZzR9T9MkJvM3pw4hNgoZLeVUBU X-Received: by 10.50.43.193 with SMTP id y1mr13196977igl.32.1408944037139; Sun, 24 Aug 2014 22:20:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.19.136 with HTTP; Sun, 24 Aug 2014 22:20:16 -0700 (PDT) In-Reply-To: <7618E46C-5659-4394-99B8-DC97F86DDE19@gmail.com> References: <5A16A7F7-9F49-413F-B1E0-F438B1B495A5@gmail.com> <7618E46C-5659-4394-99B8-DC97F86DDE19@gmail.com> From: Hari Shreedharan Date: Sun, 24 Aug 2014 22:20:16 -0700 Message-ID: Subject: Re: starting a thread in the customized sink ? To: "user@flume.apache.org" Content-Type: multipart/alternative; boundary=089e0111d1bed7b3e305016d588a X-Virus-Checked: Checked by ClamAV on apache.org --089e0111d1bed7b3e305016d588a Content-Type: text/plain; charset=UTF-8 You are probably ok. There are a bunch of sinks that already do this (Asynchbase sink/Morphline Solr sink etc). On Sun, Aug 24, 2014 at 10:17 PM, terreyshih wrote: > Thanks for answering my question. > > No, the transaction will not be shared by different threads. The > transaction is committed after I convert the events to some data structure. > > I would only have a Timer/Executor thread that fires off at specific > intervals to send these converted data structures (from events) to > customized storage/consumer for processing. > > Do you see an issue with this approach ? > > thanks, > Terrey. > > > > On Aug 24, 2014, at 9:59 PM, Hari Shreedharan > wrote: > > If you create a large number of threads in a sink - that could affect the > performance of the agent - simply because there are too many threads. Also, > transactions are thread-local - so make sure each transaction is completely > owned and run by the same thread. > > > On Sun, Aug 24, 2014 at 7:28 PM, terreyshih wrote: > >> Hi, >> >> If in my customized sink, I create some threads and schedule it to do >> some queueing. For example, I would like to drop the events off every 10 >> seconds. If I start the thread or an executor in the process method of the >> customized sink class, would have have some negative impact to the >> threading model in Flume ? >> >> thanks, >> -Terrey > > > > --089e0111d1bed7b3e305016d588a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You are probably ok. There are a bunch of sinks that alrea= dy do this (Asynchbase sink/Morphline Solr sink etc).


On Sun, Aug 24, 2014 at 10:17= PM, terreyshih <terreyshih@gmail.com> wrote:
Thanks f= or answering my question.

No, the transaction will not b= e shared by different threads. =C2=A0The transaction is committed after I c= onvert the events to some data structure.

I would only have a Timer/Executor thread that fires of= f at specific intervals to send these converted data structures (from event= s) to customized storage/consumer for processing.

Do you see an issue with this approach ?

thanks,
Terrey.


=

On Aug 24, 2014, at 9:59 PM, Hari Shreedharan <hshreedharan@cloud= era.com> wrote:

If you create a large number= of threads in a sink - that could affect the performance of the agent - si= mply because there are too many threads. Also, transactions are thread-loca= l - so make sure each transaction is completely owned and run by the same t= hread.


On Sun, Aug 2= 4, 2014 at 7:28 PM, terreyshih <terreyshih@gmail.com> wro= te:
Hi,

If in my customized sink, I create some threads and schedule it to do some = queueing.=C2=A0 For example, I would like to drop the events off every 10 s= econds.=C2=A0 If I start the thread or an executor in the process method of= the customized sink class, would have have some negative impact to the thr= eading model in Flume ?

thanks,
-Terrey



--089e0111d1bed7b3e305016d588a--