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 A637C11508 for ; Tue, 26 Aug 2014 19:19:25 +0000 (UTC) Received: (qmail 86138 invoked by uid 500); 26 Aug 2014 19:19:23 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 86063 invoked by uid 500); 26 Aug 2014 19:19:23 -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 86051 invoked by uid 99); 26 Aug 2014 19:19:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Aug 2014 19:19:23 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yeshwanth43@gmail.com designates 209.85.218.52 as permitted sender) Received: from [209.85.218.52] (HELO mail-oi0-f52.google.com) (209.85.218.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Aug 2014 19:19:18 +0000 Received: by mail-oi0-f52.google.com with SMTP id g201so2079740oib.25 for ; Tue, 26 Aug 2014 12:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=OrM7EgiZlsv0e+QuQT2tooMj+yTXQbTzLkyymIu/Hr0=; b=gKhXZoAqxGFmmR1ZMXH2n192qSXhzGP9d+0eFWHg67vHqDT8Fd+Fde6MuyhMNc7xKw SAV+1GsHr3r98fod9BxurN55ws9BW/ArFd/b/2Z6Ry23x7kfPm94BlLJc1hcm5bW9+NM F0phSG1G6SVtbOAg3UVjVCcA9ZpFYix3uB9w9iHfsmbsShMtGtfwSO8qRj7yl0ihzLj4 k/caD+efXtsWnkhsUIQfu3dz2VI4e2xI01OvM5d8f0TMmOsL8ICfwnXmopxMgDi9G9Jl 7H4qMVKjFKQPFmkeoY719mRhMIDuvSk6cr+u25nVco4vzu3AUKohWnwisqEZ8iFDPn2o TYxA== MIME-Version: 1.0 X-Received: by 10.60.45.234 with SMTP id q10mr29654088oem.25.1409080738037; Tue, 26 Aug 2014 12:18:58 -0700 (PDT) Received: by 10.182.151.47 with HTTP; Tue, 26 Aug 2014 12:18:57 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 Aug 2014 00:48:57 +0530 Message-ID: Subject: Re: writing to multiple hbase tables in a mapreduce job From: yeshwanth kumar To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=001a11c21b06d9c8cf05018d2c4b X-Virus-Checked: Checked by ClamAV on apache.org --001a11c21b06d9c8cf05018d2c4b Content-Type: text/plain; charset=UTF-8 that mapreduce job reads data from hbase table, it doesn't take any explicit input data/file/ -yeshwanth On Wed, Aug 27, 2014 at 12:44 AM, Shahab Yunus wrote: > Where are you setting the input data/path/format for the job? I don't see > that in the code below that you just pasted... > > > > > > > > > > > > *Job job = new Job(config, > > "GetEntitiesMR");job.setJarByClass(EntitySearcherMR.class);job.setMapperClass(EntitySearcherMapper.class);job.setOutputFormatClass(MultiTableOutputFormat.class);TableMapReduceUtil.addDependencyJars(job);job.setNumReduceTasks(0); > boolean b = job.waitForCompletion(true);if (!b) {throw new > IOException("error with job!");}* > > Regards, > Shahab > > > On Tue, Aug 26, 2014 at 3:11 PM, yeshwanth kumar > wrote: > > > hi shahab, > > > > i tried in that way, by specifying outputformat as > MultiTableOutputFormat, > > it is throwing > > > > java.io.IOException: No input paths specified in job > > at > > > > > org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:193) > > at > > > > > org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252) > > at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:919) > > at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:936) > > at org.apache.hadoop.mapred.JobClient.access$500(JobClient.java:170) > > at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:854) > > at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:807) > > at java.security.AccessController.doPrivileged(Native Method) > > at javax.security.auth.Subject.doAs(Subject.java:415) > > at > > > > > org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059) > > at > org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:807) > > at org.apache.hadoop.mapreduce.Job.submit(Job.java:465) > > at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:495) > > at > > > > > com.serendio.icvs.analysis.text.EntitySearcherMR.main(EntitySearcherMR.java:161) > > > > here's the job config > > > > Job job = new Job(config, "GetEntitiesMR"); > > job.setJarByClass(EntitySearcherMR.class); > > job.setMapperClass(EntitySearcherMapper.class); > > job.setOutputFormatClass(MultiTableOutputFormat.class); > > TableMapReduceUtil.addDependencyJars(job); > > job.setNumReduceTasks(0); > > boolean b = job.waitForCompletion(true); > > if (!b) { > > throw new IOException("error with job!"); > > } > > > > i am unable to figure out, what i am missing here, > > > > -yeshwanth > > > > > > > > > > > > On Wed, Aug 27, 2014 at 12:23 AM, Shahab Yunus > > wrote: > > > > > You don't need to initialize the tables. > > > > > > You just need to specify the output format as MultipleTableOutputFormat > > > class. > > > > > > Something like this: > > > job.setOutputFormatClass(MultipleTableOutputFormat.class); > > > > > > > > > Because if you see the code for MultipleTableOutputFormat, it creates > the > > > table on the fly and stores it in the internal map when you call > > > context.write. > > > When context.write is called: > > > > > > @Override < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/Override.java#Override > > > > > > > > > > 126 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#126 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > public void > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > >write(ImmutableBytesWritable > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java#ImmutableBytesWritable > > > > > > > tableName, Writable action) throws IOException > > > < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/io/IOException.java#IOException > > > > > > > { > > > > > > 127 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#127 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > HTable < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/client/HTable.java#HTable > > > > > > > table = getTable > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.getTable%28org.apache.hadoop.hbase.io.ImmutableBytesWritable%29 > > > >(tableName); > > > > > > > > > > > > Which calls getTable() shown below which cr > > > > > > eates the table on the fly and stores it in the internal map : > > > > > > > > > > > > HTable < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/client/HTable.java#HTable > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > >getTable(ImmutableBytesWritable > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java#ImmutableBytesWritable > > > > > > > tableName) throws IOException > > > < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/io/IOException.java#IOException > > > > > > > { > > > > > > 99 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#99 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > if (!tables > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.0tables > > > >.containsKey > > > < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/util/Map.java#Map.containsKey%28java.lang.Object%29 > > > >(tableName)) > > > { > > > > > > 100 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#100 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > LOG < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.0LOG > > > >.debug > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/org/apache/commons/logging/Log.java#Log.debug%28java.lang.Object%29 > > > >("Opening > > > HTable \"" + Bytes.toString > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/util/Bytes.java#Bytes.toString%28byte%5B%5D%29 > > > >(tableName.get > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java#ImmutableBytesWritable.get%28%29 > > > >())+ > > > "\" for writing"); > > > > > > 101 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#101 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > HTable < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/client/HTable.java#HTable > > > > > > > table = new HTable > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/client/HTable.java#HTable > > > >(conf > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.0conf > > > >, > > > tableName.get < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java#ImmutableBytesWritable.get%28%29 > > > >()); > > > > > > 102 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#102 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > table.setAutoFlush > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/client/HTable.java#HTable.setAutoFlush%28boolean%29 > > > >(false); > > > > > > 103 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#103 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > tables < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.0tables > > > >.put > > > < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/util/Map.java#Map.put%28org.apache.hadoop.hbase.io.ImmutableBytesWritable%2Corg.apache.hadoop.hbase.client.HTable%29 > > > >(tableName, > > > table); > > > > > > 104 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#104 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > } > > > > > > 105 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#105 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > return tables > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.0tables > > > >.get > > > < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/util/Map.java#Map.get%28java.lang.Object%29 > > > >(tableName); > > > > > > 106 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#106 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > } > > > > > > 107 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#107 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > 108 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#108 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > @Override < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/Override.java#Override > > > > > > > > > > 109 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#109 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > public void > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > >close(TaskAttemptContext > > > context) throws IOException > > > < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/io/IOException.java#IOException > > > > > > > { > > > > > > 110 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#110 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > for (HTable > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/client/HTable.java#HTable > > > > > > > table : tables < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.0tables > > > >.values > > > < > > > > > > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/util/Map.java#Map.values%28%29 > > > >()) > > > { > > > > > > 111 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#111 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > table.flushCommits > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/client/HTable.java#HTable.flushCommits%28%29 > > > >(); > > > > > > 112 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#112 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > } > > > > > > 113 < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#113 > > > > > > > > > > < > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java# > > > > > > > > > > } > > > > > > > > > In fact, I would suggest to go through this code here for the whole > > class: > > > > > > > > > > > > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.hbase/hbase/0.92.1/org/apache/hadoop/hbase/mapreduce/MultiTableOutputFormat.java#MultiTableOutputFormat.MultiTableRecordWriter.getTable%28org.apache.hadoop.hbase.io.ImmutableBytesWritable%29 > > > > > > > > > > > > It is different from TableOutputFormat approach where you do need to > > > intialize the table by using the Util class. > > > > > > > > > > > > Regards, > > > > > > Shahab > > > > > > > > > > > > On Tue, Aug 26, 2014 at 2:29 PM, yeshwanth kumar < > yeshwanth43@gmail.com> > > > wrote: > > > > > > > hi ted, > > > > > > > > i need to process the data in table i1, and then i need to write the > > > > results to tables i1 and i2 > > > > so input for the mapper in my mapreduce job is from hbase table, i1 > > > > whereas in WALPlayer input is HLogInputFormat, > > > > > > > > if i remove the statement as you said and specify the inputformat > > > > as TableInputFormat it is throwing "No table was provided " Exception > > > > if i specify the input table as in the statements > > > > > > > > TableMapReduceUtil.initTableMapperJob(otherArgs[0], scan, > > > > EntitySearcherMapper.class, ImmutableBytesWritable.class, Put.class, > > > > job);//otherArgs[0]=i1 > > > > > > > > mapper is not considering other table, > > > > any suggestions to resolve this issue, > > > > > > > > thanks, > > > > yeshwanth > > > > > > > > > > > > > > > > > > > > On Tue, Aug 26, 2014 at 10:39 PM, Ted Yu > wrote: > > > > > > > > > Please take a look at WALPlayer.java in hbase where you can find > > > example > > > > of > > > > > how MultiTableOutputFormat is used. > > > > > > > > > > Cheers > > > > > > > > > > > > > > > On Tue, Aug 26, 2014 at 10:04 AM, yeshwanth kumar < > > > yeshwanth43@gmail.com > > > > > > > > > > wrote: > > > > > > > > > > > hi ted, > > > > > > > > > > > > how can we intialise the mapper if i comment out those lines > > > > > > > > > > > > > > > > > > > > > > > > On Tue, Aug 26, 2014 at 10:08 PM, Ted Yu > > > wrote: > > > > > > > > > > > > > TableMapReduceUtil.initTableMapperJob(otherArgs[0], scan, > > > > > > > EntitySearcherMapper.class, ImmutableBytesWritable.class, > > > Put.class, > > > > > > > job);//otherArgs[0]=i1 > > > > > > > > > > > > > > You're initializing with table 'i1' > > > > > > > Please remove the above call and try again. > > > > > > > > > > > > > > Cheers > > > > > > > > > > > > > > > > > > > > > On Tue, Aug 26, 2014 at 9:18 AM, yeshwanth kumar < > > > > > yeshwanth43@gmail.com> > > > > > > > wrote: > > > > > > > > > > > > > > > hi i am running HBase 0.94.20 on Hadoop 2.2.0 > > > > > > > > > > > > > > > > i am using MultiTableOutputFormat, > > > > > > > > for writing processed output to two different tables in > hbase. > > > > > > > > > > > > > > > > here's the code snippet > > > > > > > > > > > > > > > > private ImmutableBytesWritable tab_cr = new > > > ImmutableBytesWritable( > > > > > > > > Bytes.toBytes("i1")); private ImmutableBytesWritable tab_cvs > = > > > new > > > > > > > > ImmutableBytesWritable( Bytes.toBytes("i2")); > > > > > > > > > > > > > > > > @Override > > > > > > > > public void map(ImmutableBytesWritable row, final Result > value, > > > > > > > > final Context context) throws IOException, > > InterruptedException { > > > > > > > > > > > > > > > > ----------------------------------------- > > > > > > > > Put pcvs = new Put(entry.getKey().getBytes()); > > > > > > > > > pcvs.add("cf".getBytes(),"type".getBytes(),column.getBytes()); > > > > > > > > Put put = new Put(value.getRow()); > > > > > > > > put.add("Entity".getBytes(), "json".getBytes(), > > > > > > > > entry.getValue().getBytes()); > > > > > > > > context.write(tab_cr, put);// table i1 context.write(tab_cvs, > > > > > > > pcvs);//table > > > > > > > > i2 > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > job.setJarByClass(EntitySearcherMR.class); > > > > > > > > job.setMapperClass(EntitySearcherMapper.class); > > > > > > > > job.setOutputFormatClass(MultiTableOutputFormat.class); Scan > > > scan = > > > > > new > > > > > > > > Scan(); scan.setCacheBlocks(false); > > > > > > > > TableMapReduceUtil.initTableMapperJob(otherArgs[0], scan, > > > > > > > > EntitySearcherMapper.class, ImmutableBytesWritable.class, > > > > Put.class, > > > > > > > > job);//otherArgs[0]=i1 > > > > > > > TableMapReduceUtil.initTableReducerJob(otherArgs[0], > > > > > > > > null, job); job.setNumReduceTasks(0); > > > > > > > > > > > > > > > > mapreduce job fails by saying nosuchcolumnfamily "cf" > > exception, > > > in > > > > > > table > > > > > > > > i1 > > > > > > > > i am writing data to two different columnfamilies one in each > > > > table, > > > > > cf > > > > > > > > belongs to table i2. > > > > > > > > does the columnfamilies should present in both tables?? > > > > > > > > is there anything i am missing > > > > > > > > can someone point me in the right direction > > > > > > > > > > > > > > > > thanks, > > > > > > > > yeshwanth. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --001a11c21b06d9c8cf05018d2c4b--