Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 45498 invoked from network); 13 Jan 2009 23:57:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jan 2009 23:57:27 -0000 Received: (qmail 65659 invoked by uid 500); 13 Jan 2009 23:57:24 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 65627 invoked by uid 500); 13 Jan 2009 23:57:24 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 65616 invoked by uid 99); 13 Jan 2009 23:57:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 15:57:24 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 23:57:21 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D221D234C4BA for ; Tue, 13 Jan 2009 15:56:59 -0800 (PST) Message-ID: <816238670.1231891019859.JavaMail.jira@brutus> Date: Tue, 13 Jan 2009 15:56:59 -0800 (PST) From: "Jerome Boulon (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Issue Comment Edited: (HADOOP-5018) Chukwa should support pipelined writers In-Reply-To: <2124989561.1231812659831.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-5018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663552#action_12663552 ] jboulon edited comment on HADOOP-5018 at 1/13/09 3:56 PM: ---------------------------------------------------------------- My point is hat the pipelineWriter should be an implementation of the ChukwaWriter interface and that's really the only thing that the collector should be aware of. So to be able to do what you want: 1) The collector should instantiate one writer implementation based on his configuration 2) The writer should be able to get the collector configuration from somewhere (current design) or should have an init method with a Configuration parameter 3) The contract from the collector point of view is the same call one method on the writer class and the result is success if there's no exception the delta with your implementation is: - Remove code from if (conf.get("chukwaCollector.pipeline") != null) .. - Replace by something like: writerClassName = conf.get("chukwaCollector.writer","org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter"). Class myWriter = conf.getClassByName(writerClassName); Writer st = myWriter.newInstance() st.init(); - Remove all writer initialization from CollectorStub.java - and move all the code to create the pipeline to the init method inside a PipelineWriter class, instead of ServletCollector.java That way the writer interface is still simple, the collector class stay very simple and this does not prevent anybody from having a specific writer implementation. So at the end you have: public class PipelineWriter implements ChukwaWriter { public void init() throws WriterException { + if (conf.get("chukwaCollector.pipeline") != null) { + String pipeline = conf.get("chukwaCollector.pipeline"); + try { + String[] classes = pipeline.split(","); + ArrayList stages = new ArrayList(); [...] } public void add(List chunks) throws WriterException { // call all PipelineStageWriter in sequence } } was (Author: jboulon): My point is hat the pipelineWriter should be an implementation of the ChukwaWriter interface and that's really the only thing that the collector should be aware of. So to be able to do what you want: 1) The collector should instantiate one writer implementation based on his configuration 2) The writer should be able to get the collector configuration from somewhere (current design) or should have an init method with a Configuration parameter 3) The contract from the collector point of view is the same call one method on the writer class and the result is success if there's no exception the delta with your implementation is: - Remove code from if (conf.get("chukwaCollector.pipeline") != null) .. - Replace by something like: writerClassName = conf.get("chukwaCollector.writer","org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter"). Class myWriter = conf.getClassByName(writerClassName); Writer st = myWriter.newInstance() st.init(); - Remove all writer initialization from CollectorStub.java - and move all the code to create the pipeline to the init method inside a PipelineWriter class, instead of ServletCollector.java That way the writer interface is still simple, the collector class stay very simple and this does not prevent anybody from having a specific writer implementation. So at the end you have: public class PipelineWriter implements ChukwaWriter { public void init() throws WriterException { + if (conf.get("chukwaCollector.pipeline") != null) { + String pipeline = conf.get("chukwaCollector.pipeline"); + try { + String[] classes = pipeline.split(","); + ArrayList stages = new ArrayList(); [...] } public void add(List chunks) throws WriterException { // call all PipelineStageWriter in sequence } > Chukwa should support pipelined writers > --------------------------------------- > > Key: HADOOP-5018 > URL: https://issues.apache.org/jira/browse/HADOOP-5018 > Project: Hadoop Core > Issue Type: New Feature > Components: contrib/chukwa > Reporter: Ari Rabkin > Assignee: Ari Rabkin > Attachments: pipeline.patch > > > We ought to support chaining together writers; this will radically increase flexibility and make it practical to add new features without major surgery by putting them in pass-through or filter classes. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.