Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-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 6889D104DE for ; Tue, 27 Aug 2013 22:21:20 +0000 (UTC) Received: (qmail 32660 invoked by uid 500); 27 Aug 2013 22:21:15 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 32536 invoked by uid 500); 27 Aug 2013 22:21:15 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 32529 invoked by uid 99); 27 Aug 2013 22:21:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Aug 2013 22:21:15 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jamalshasha@gmail.com designates 209.85.192.180 as permitted sender) Received: from [209.85.192.180] (HELO mail-pd0-f180.google.com) (209.85.192.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Aug 2013 22:21:10 +0000 Received: by mail-pd0-f180.google.com with SMTP id y10so5439034pdj.11 for ; Tue, 27 Aug 2013 15:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=YaCLIkkFF77aOf+3qAYN3F3GLtYaU+X6QUkDxCxgZ84=; b=oT/fze/uqrkvL6tCM928Ss7Q6Wjb+3ay9Ln1nBukYepOMwvKAJArCogiOFGvWtmbgG fi5lSnViFVrUnBlEoNkIUgz1jkbJy70hv1vyxjjgQBirfAS8CZFwtxX4zR6ln9dU9Y5i hrhiUtCb15l+NyQBP9MuAmUH31lP99scRFenv/eshXOHyxj9Pdp/ScybB5syGMIuQFut B504kaTF546g481cmJ98wRSYfZX8lji0IGlGX7Z2BEF+x/qyPR6AiP36U4eTO7PW90Q+ AJ67fTk2ukrI7IV/8FQQluQy3TrkIN1h84kLmConMTyOuehMwVD0jaDZ+14IuJ+Yitcr refg== MIME-Version: 1.0 X-Received: by 10.68.114.132 with SMTP id jg4mr23767839pbb.109.1377642049806; Tue, 27 Aug 2013 15:20:49 -0700 (PDT) Received: by 10.70.11.194 with HTTP; Tue, 27 Aug 2013 15:20:49 -0700 (PDT) Date: Tue, 27 Aug 2013 15:20:49 -0700 Message-ID: Subject: Writing multiple tables from reducer From: jamal sasha To: user@hbase.apache.org, "user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=047d7b6dc7a001a70504e4f5498c X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6dc7a001a70504e4f5498c Content-Type: text/plain; charset=ISO-8859-1 Hi, I am new to hbase and am trying to achieve the following. I am reading data from hdfs in mapper and parsing it.. So, in reducer I want my output to write to hbase instead of hdfs But here is the thing. public static class MyTableReducer extends TableReducer { public void reduce(Text key, Iterable values, Context context) throws IOException, InterruptedException { int type = getType(values.toString()); if (type == 1) // put data to table 1 if (type==2) // put data to table 2 } } How do I do this? Thanks --047d7b6dc7a001a70504e4f5498c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,=A0
=A0 I am new to hbase and am trying to achieve = the following.

I am reading data from hdfs in mapp= er and parsing it..

So, in reducer I want my outpu= t to write to hbase instead of hdfs
But here is the thing.

public static cla= ss MyTableReducer extends TableReducer<Text, Text, ImmutableBytesWritabl= e> =A0{

public voi= d reduce(Text key, Iterable<Text> values, Context context) throws IOE= xception, InterruptedException {
= int type =3D getType(values.toString());
if (type =3D=3D 1) /= / put data to table 1
= if (type=3D=3D2) // put data to table 2 =A0 =A0=


=A0 }
}

How do I do this?
Thanks
--047d7b6dc7a001a70504e4f5498c--