Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 61814 invoked from network); 7 May 2008 23:38:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2008 23:38:51 -0000 Received: (qmail 90927 invoked by uid 500); 7 May 2008 23:38:46 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 90891 invoked by uid 500); 7 May 2008 23:38:45 -0000 Mailing-List: contact core-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-user@hadoop.apache.org Delivered-To: mailing list core-user@hadoop.apache.org Received: (qmail 90880 invoked by uid 99); 7 May 2008 23:38:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 May 2008 16:38:45 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [206.190.37.206] (HELO web88105.mail.re2.yahoo.com) (206.190.37.206) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 07 May 2008 23:37:50 +0000 Received: (qmail 48129 invoked by uid 60001); 7 May 2008 23:38:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=Dc6gcmaLnuEEPKpyjYxPJDA/+ZAraz3HkFwSMvmGY1KelSM0TKmPozA0jlYD+kEh0XB6ZSu0bceq1higidLLvHRvlTVNVBtSQJFvkKrWoAjXB9uTGFULU2IeN1oUS3Co4C8+enL7SBsGzYGqOdgHlkfHqoWrFvmtXraL5rHoDXg=; X-YMail-OSG: z3feZJAVM1mnqu8m.w9c72voeWu.o0BI7TqCu_OhBKVMANqZBhscEjd2Ip6e09Umd.4AzQA7u.EyuxAiRsbgfP8SdaTZYskKBWnJ_g-- Received: from [99.238.35.247] by web88105.mail.re2.yahoo.com via HTTP; Wed, 07 May 2008 19:38:10 EDT Date: Wed, 7 May 2008 19:38:10 -0400 (EDT) From: Derek Shaw Subject: Fwd: Collecting output not to file To: core-user@hadoop.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-475996443-1210203490=:47651" Content-Transfer-Encoding: 8bit Message-ID: <362726.47651.qm@web88105.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-475996443-1210203490=:47651 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To clarify: static class TestOutputFormat implements OutputFormat { static class TestRecordWriter implements RecordWriter { TestOutputFormat output; public TestRecordWriter (TestOutputFormat output, org.apache.hadoop.fs.FileSystem ignored, JobConf job, String name, Progressable progress) { this.output = output; } public void close (Reporter reporter) {} public void write (Text key, Text value) { output.addResults (value.toString ()); } } protected String results = ""; public void checkOutputSpecs (org.apache.hadoop.fs.FileSystem ignored, JobConf job) throws IOException {} public RecordWriter getRecordWriter (org.apache.hadoop.fs.FileSystem ignored, JobConf job, String name, Progressable progress) { return new TestRecordWriter (this, ignored, job, name, progress); } public void addResults (String r) { results += r + ","; } public String getResults () { return results; } } And then running the task: public int run(String[] args) throws Exception { .... JobClient.runJob(job); // getOutputFormatcreates a new instance of the outputformat. I want to get the instance of the output format that the reduce function wrote to // The recordWriter that reduce wrote to would be just as good TestOutputFormat results = (TestOutputFormat) job.getOutputFormat (); // Always prints the empty string, not the populated results System.out.println ("results: " + results.getResults ()); return 0; } Derek Shaw wrote: Date: Tue, 6 May 2008 23:26:30 -0400 (EDT) From: Derek Shaw Subject: Collecting output not to file To: core-user@hadoop.apache.org Hey, >From the examples that I have seen thus far, all of the results from the reduce function are being written to a file. Instead of writing results to a file, I want to store them and inspect them after the job is completed. (I think that I need to implement my own OutputCollector, but I don't know how to tell hadoop to use it.) How can I do this? -Derek --0-475996443-1210203490=:47651--