Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-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 3134EF752 for ; Sun, 24 Mar 2013 14:35:54 +0000 (UTC) Received: (qmail 21232 invoked by uid 500); 24 Mar 2013 14:35:52 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 21101 invoked by uid 500); 24 Mar 2013 14:35:52 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 21092 invoked by uid 99); 24 Mar 2013 14:35:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Mar 2013 14:35:52 +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 yuzhihong@gmail.com designates 209.85.215.52 as permitted sender) Received: from [209.85.215.52] (HELO mail-la0-f52.google.com) (209.85.215.52) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Mar 2013 14:35:47 +0000 Received: by mail-la0-f52.google.com with SMTP id fs12so9932642lab.11 for ; Sun, 24 Mar 2013 07:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=I7kFq0DyCznXAOEdwaC2jctMas1Q3jMp2Qd9KCJope0=; b=rEY7sVkw4hSYkjq5ZMJ+5SqFLn8v+HyQLMfrbeTHpZuZmTjceoYjbCf7zpRlPmlhRB vwRqmqD5yH1bI5+v16wu5KYJH94NZ1kwDy4hbhpY1fp/XRvCa8zdu1nXtWw4sEWUgsrF i7QLNas4evSynjtVQR7NL9kjqVHXLe5zoYf6KQf+tdI8djQiuV0eLjM7TNfyOWwQqzM8 XTsAT8Y9/HFN5HMDUq3IGbZLEWbG88wgN4AmlL6+6bvOSqvC0IXS9b4ExAeyXyghAzqs u0cGn8tB2bjSpGf5MVFNfVmo7IgL9JaA8N2Rus+ApR3+iuzTme3YuIr/jwglBcda3MFz WSsw== MIME-Version: 1.0 X-Received: by 10.112.83.67 with SMTP id o3mr4356627lby.7.1364135726249; Sun, 24 Mar 2013 07:35:26 -0700 (PDT) Received: by 10.112.84.133 with HTTP; Sun, 24 Mar 2013 07:35:26 -0700 (PDT) In-Reply-To: References: Date: Sun, 24 Mar 2013 07:35:26 -0700 Message-ID: Subject: Re: hbase.mapred.output.quorum ignored in Mapper job with HDFS source and HBase sink From: Ted Yu To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=14dae9d2f2b663820504d8ac99af X-Virus-Checked: Checked by ClamAV on apache.org --14dae9d2f2b663820504d8ac99af Content-Type: text/plain; charset=ISO-8859-1 Looks like MultiTableOutputFormat doesn't support this use case - MultiTableOutputFormat doesn't extend TableOutputFormat: public class MultiTableOutputFormat extendsOutputFormat { Relevant configuration is setup in TableOutputFormat#setConf(): public void setConf(Configuration otherConf) { this.conf = HBaseConfiguration.create(otherConf); String tableName = this.conf.get(OUTPUT_TABLE); if(tableName == null || tableName.length() <= 0) { throw new IllegalArgumentException("Must specify table name"); } String address = this.conf.get(QUORUM_ADDRESS); int zkClientPort = conf.getInt(QUORUM_PORT, 0); String serverClass = this.conf.get(REGION_SERVER_CLASS); String serverImpl = this.conf.get(REGION_SERVER_IMPL); try { if (address != null) { ZKUtil.applyClusterKeyToConf(this.conf, address); } Mind filing a JIRA for enhancement ? On Sun, Mar 24, 2013 at 5:46 AM, David Koch wrote: > Hello, > > I want to import a file on HDFS from one cluster A (source) into HBase > tables on a different cluster B (destination) using a Mapper job with an > HBase sink. Both clusters run HBase. > > This setup works fine: > - Run Mapper job on cluster B (destination) > - "mapred.input.dir" --> hdfs:/// (file on source > cluster) > - "hbase.zookeeper.quorum" --> > - "hbase.zookeeper.property.clientPort" --> > > I thought it should be possible to run the job on cluster A (source) and > using "hbase.mapred.output.quorum" to insert into the tables on cluster B. > This is what the CopyTable utility does. However, the following does not > work. HBase looks for the destination table(s) on cluster A and NOT cluster > B: > - Run Mapper job on cluster A (source) > - "mapred.input.dir" --> hdfs:/// (file is local) > - "hbase.zookeeper.quorum" --> > - "hbase.zookeeper.property.clientPort" --> > - "hbase.mapred.output.quorum" -> :2181:/hbase (same as > --peer.adr argument for CopyTable) > > Job setup inside the class MyJob is as follows, note I am using > MultiTableOutputFormat. > > Configuration conf = HBaseConfiguration.addHbaseResources(getConf()); > Job job = new Job(conf); > job.setJarByClass(MyJob.class); > job.setMapperClass(JsonImporterMapper.class); > // Note, several output tables! > job.setOutputFormatClass(MultiTableOutputFormat.class); > job.setNumReduceTasks(0); > TableMapReduceUtil.addDependencyJars(job); > TableMapReduceUtil.addDependencyJars(job.getConfiguration()); > > Where The Mapper class has the following frame: > > public static class JsonImporterMapper extends > Mapper { } > > Is this expected behaviour? How can I get the second scenario using > hbase.mapred.output.quorum" to work? Could the fact I am using > MultiTableOutputFormat instead of TableOutputFormat play a part? I am using > HBase 0.92.1. > > Thank you, > > /David > --14dae9d2f2b663820504d8ac99af--