Return-Path: X-Original-To: apmail-incubator-flume-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-flume-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD05095F4 for ; Mon, 23 Apr 2012 10:55:51 +0000 (UTC) Received: (qmail 64932 invoked by uid 500); 23 Apr 2012 10:55:51 -0000 Delivered-To: apmail-incubator-flume-user-archive@incubator.apache.org Received: (qmail 64794 invoked by uid 500); 23 Apr 2012 10:55:47 -0000 Mailing-List: contact flume-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flume-user@incubator.apache.org Delivered-To: mailing list flume-user@incubator.apache.org Received: (qmail 64767 invoked by uid 99); 23 Apr 2012 10:55:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 10:55:46 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kakine@iij.ad.jp designates 202.232.30.71 as permitted sender) Received: from [202.232.30.71] (HELO omgo.iij.ad.jp) (202.232.30.71) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2012 10:55:39 +0000 DKIM-Signature: v=1;a=rsa-sha256;c=relaxed/simple;d=iij.ad.jp;h=Date:From:To: Subject:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding;i= kakine@iij.ad.jp;s=omgo1;t=1335178517;x=1336388117;bh=cEd5AN+Qj+NeHFhHCU2K0/M Jbr3sSYYTaUb9RNv35PI=;b=jCcBJxqRN4zBTJECQAlrkr6olfOvZ8C3yVWZq4Inn9r+CDeM8PEpm Fgv1ku3oNstlPPB0zV7eQygZLv6FP7V6KalnMI1g/81wyV6CrGxFbzob8Tl8ysgqvJw1aBJ5DMsvh 1AzbWC3UjePntanTAku8lh7gQ1l/iHZiINUBqylmE=; Received: by omgo.iij.ad.jp (mo30) id q3NAtH7c003147; Mon, 23 Apr 2012 19:55:17 +0900 Date: Mon, 23 Apr 2012 19:55:18 +0900 From: Hiroyuki Kakine To: flume-user@incubator.apache.org Subject: Channel's start() and stop() Message-Id: <20120423195518.68B6.80EBC90A@iij.ad.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.55 [ja] (Unregistered) Hi there, I'm Kakine from IIJ. I'm a new to here. Nice to meet you. I expected Channel's start() and stop() are performed, because Channel is LifecycleAware. But as far as my investigation of the source code, none seems to call start() and stop() of it. Below patch is to add calling Channel's start() and stop() on the node configuration changes. Do you think this change is ok to go in? Thanks, Index: flume-ng-node/src/main/java/org/apache/flume/node/nodemanager/DefaultLogicalNodeManager.java =================================================================== --- flume-ng-node/src/main/java/org/apache/flume/node/nodemanager/DefaultLogicalNodeManager.java (revision 1325150) +++ flume-ng-node/src/main/java/org/apache/flume/node/nodemanager/DefaultLogicalNodeManager.java (working copy) @@ -21,6 +21,7 @@ import java.util.Map.Entry; +import org.apache.flume.Channel; import org.apache.flume.SinkRunner; import org.apache.flume.SourceRunner; import org.apache.flume.lifecycle.LifecycleAware; @@ -73,6 +74,15 @@ logger.error("Error while stopping {}", entry.getValue(), e); } } + + for (Entry entry : nodeConfiguration + .getChannels().entrySet()) { + try{ + nodeSupervisor.unsupervise(entry.getValue()); + } catch (Exception e) { + logger.error("Error while stopping {}", entry.getValue(), e); + } + } } this.nodeConfiguration = nodeConfiguration; @@ -95,6 +105,16 @@ logger.error("Error while starting {}", entry.getValue(), e); } } + + for (Entry entry : nodeConfiguration + .getChannels().entrySet()) { + try{ + nodeSupervisor.supervise(entry.getValue(), + new SupervisorPolicy.AlwaysRestartPolicy(), LifecycleState.START); + } catch (Exception e) { + logger.error("Error while starting {}", entry.getValue(), e); + } + } } @Override --------------------------- Hiroyuki Kakine Internet Initiative Japan Inc.