Hey thank you Akhtar,
i did almost the same just after i  mailed the problem in mailing-list.
Thank you for ur reply.  But i did a little different mistake, i.e i didn't
clear the  batch, thats why its always kept on giving error, i just added
batch.clear(); my problem got solved.

On Tue, Dec 20, 2011 at 8:32 PM, Akhtar Muhammad Din
<akhtar.m...@gmail.com>wrote:

> Krishna,
> You should set  auto flush to false to enable batch mode of operation and
> exception is being thrown because batch and results are not of the same
> size. Initialize results like this
> Object[] results = new Object[batch.size()];
> and then pass it to
> table.batch(batch, results);
>
> I hope that helps
>
>
> On Tue, Dec 20, 2011 at 11:26 AM, Vamshi Krishna <vamshi2...@gmail.com
> >wrote:
>
> > Hi all, i am trying to copy rows from multiple tables to one table,
> > selecting rows by some criteria.
> > i am using batch of puts in to table i.e for every period=100 rows(each
> row
> > is of maximum 12 bytes), i am executing
> >                ...
> >                ...
> >
> >                table.setAutoFlush(true);
> >                table.batch(batch, results);
> >                table.flushCommits();
> >                ....
> >
> > and i have declared before only like ,
> >          private long period=100,count=0;
> >         List<Row> batch = new ArrayList<Row>();
> >         Object[] results = new Object[100];
> >          and
> >          Scan s=new Scan();
> >            s.setCacheBlocks(false);
> >            s.setCaching(100);
> >            ....
> >
> > i am getting following exception..
> > 11/12/20 11:32:48 INFO mapred.JobClient: Running job:
> job_201112200929_0001
> > 11/12/20 11:32:49 INFO mapred.JobClient:  map 0% reduce 0%
> > 11/12/20 11:33:01 INFO mapred.JobClient: Task Id :
> > attempt_201112200929_0001_m_000000_0, Status : FAILED
> > java.lang.IllegalArgumentException: argument results must be the same
> size
> > as argument list
> >    at
> >
> >
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1104)
> >    at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:598)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:56)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:1)
> >    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> >    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
> >    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
> >    at org.apache.hadoop.mapred.Child.main(Child.java:170)
> >
> > 11/12/20 11:33:04 INFO mapred.JobClient: Task Id :
> > attempt_201112200929_0001_m_000001_0, Status : FAILED
> > java.lang.IllegalArgumentException: argument results must be the same
> size
> > as argument list
> >    at
> >
> >
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1104)
> >    at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:598)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:56)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:1)
> >    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> >    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
> >    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
> >    at org.apache.hadoop.mapred.Child.main(Child.java:170)
> >
> > 11/12/20 11:33:10 INFO mapred.JobClient: Task Id :
> > attempt_201112200929_0001_m_000000_1, Status : FAILED
> > java.lang.IllegalArgumentException: argument results must be the same
> size
> > as argument list
> >    at
> >
> >
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1104)
> >    at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:598)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:56)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:1)
> >    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> >    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
> >    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
> >    at org.apache.hadoop.mapred.Child.main(Child.java:170)
> >
> > 11/12/20 11:33:13 INFO mapred.JobClient: Task Id :
> > attempt_201112200929_0001_m_000001_1, Status : FAILED
> > java.lang.IllegalArgumentException: argument results must be the same
> size
> > as argument list
> >    at
> >
> >
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1104)
> >    at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:598)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:56)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:1)
> >    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> >    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
> >    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
> >    at org.apache.hadoop.mapred.Child.main(Child.java:170)
> >
> > 11/12/20 11:33:16 INFO mapred.JobClient: Task Id :
> > attempt_201112200929_0001_m_000000_2, Status : FAILED
> > java.lang.IllegalArgumentException: argument results must be the same
> size
> > as argument list
> >    at
> >
> >
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1104)
> >    at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:598)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:56)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:1)
> >    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> >    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
> >    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
> >    at org.apache.hadoop.mapred.Child.main(Child.java:170)
> >
> > 11/12/20 11:33:19 INFO mapred.JobClient: Task Id :
> > attempt_201112200929_0001_m_000001_2, Status : FAILED
> > java.lang.IllegalArgumentException: argument results must be the same
> size
> > as argument list
> >    at
> >
> >
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1104)
> >    at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:598)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:56)
> >    at Setunion.Setunion3$setunionMapper.map(Setunion3.java:1)
> >    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> >    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
> >    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
> >    at org.apache.hadoop.mapred.Child.main(Child.java:170)
> >
> > 11/12/20 11:33:25 INFO mapred.JobClient: Job complete:
> > job_201112200929_0001
> > 11/12/20 11:33:25 INFO mapred.JobClient: Counters: 4
> > 11/12/20 11:33:25 INFO mapred.JobClient:   Job Counters
> > 11/12/20 11:33:25 INFO mapred.JobClient:     Rack-local map tasks=4
> > 11/12/20 11:33:25 INFO mapred.JobClient:     Launched map tasks=8
> > 11/12/20 11:33:25 INFO mapred.JobClient:     Data-local map tasks=4
> > 11/12/20 11:33:25 INFO mapred.JobClient:     Failed map tasks=1
> > hduser@vamshikrishna-desktop:/usr/local/hadoop-0.20.2$
> >
> >
> >  Actually some thousands of rows have to be inserted to the new table,
> but
> > only 200 rows i could see after above  messages thrown on to console.
> > Please help me why it is happening like this..?  please somebody help..
> > --
> > *Regards*
> > *
> > Vamshi Krishna
> > *
> >
>
>
>
> --
> Regards
> Akhtar Muhammad Din
>



-- 
*Regards*
*
Vamshi Krishna
*

Reply via email to