Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-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 9A66E75AD for ; Tue, 15 Nov 2011 02:29:44 +0000 (UTC) Received: (qmail 46641 invoked by uid 500); 15 Nov 2011 02:29:42 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 46613 invoked by uid 500); 15 Nov 2011 02:29:42 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 46604 invoked by uid 99); 15 Nov 2011 02:29:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2011 02:29:42 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dean.hiller@gmail.com designates 209.85.213.172 as permitted sender) Received: from [209.85.213.172] (HELO mail-yx0-f172.google.com) (209.85.213.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2011 02:29:35 +0000 Received: by yenq4 with SMTP id q4so4199096yen.31 for ; Mon, 14 Nov 2011 18:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=fge1S8dLIUhGRA924B8T94J8ClA/A94q1cFLa89w0gA=; b=ckiMawyiMP5Bmwz+LhDLI3NDWW6ff65vcYN6CYL76qaN+2tmekBylrmaD276/zUQrI eyw6TST/OHp4f1opdEw+/oq7rHkuwWlid/U4CMukJ4hBswTNYzXc4VUgz5b0YTaUJ7J6 k2i375W8JqP/KUjrokQGMYldxDGwgG9xt+2kg= Received: by 10.68.16.5 with SMTP id b5mr20321544pbd.95.1321324154061; Mon, 14 Nov 2011 18:29:14 -0800 (PST) MIME-Version: 1.0 Sender: dean.hiller@gmail.com Received: by 10.68.63.9 with HTTP; Mon, 14 Nov 2011 18:28:53 -0800 (PST) From: Dean Hiller Date: Mon, 14 Nov 2011 19:28:53 -0700 X-Google-Sender-Auth: 0A1qXuqPWGTMhSy5FfDFeuvPbX4 Message-ID: Subject: This seems to fix it.....wordcount example exception that I think should not occur To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec5215f77d6035f04b1bcc097 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec5215f77d6035f04b1bcc097 Content-Type: text/plain; charset=ISO-8859-1 Well, by edting src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java in version 1.0.2 cassandra src just before the totalRead++; KeySlice ks = rows.get(i++); SortedMap map = new TreeMap(comparator); I added the code if(i >= rows.size()) return endOfData(); That seems to fix it AND this is only needed by the jobtracker so you don't need to redeploy cassandra for the fix which is nice....it seems to work now with rows that don't contain that column. If anyone thinks this will have bad side affects, please let me know. later, Dean http://blog.alvazan.com On Mon, Nov 14, 2011 at 7:01 PM, Dean Hiller wrote: > There are 4 jobs submitted by the wordcount cassandra example and the > first one fails and the other 3 all pass and work with results. > > The first job I noticed is looking for column name text0 due to i being 0 > in the loop. The exception is not going through the wordcount code at all > though, but this text0 column does not exist in the cassandra database(is > this an InputFormat bug in the cassandra code to wire in the map/reduce > stuff or is there a way to fix this???) > > The exception... > > 2011-11-14 18:16:26,540 INFO org.apache.hadoop.mapred.TaskInProgress: > Error from attempt_201111141812_0002_m_000000_1: > java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 > at java.util.ArrayList.RangeCheck(ArrayList.java:547) > at java.util.ArrayList.get(ArrayList.java:322) > at > org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.computeNext(ColumnFamilyRecordReader.java:300) > at > org.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.computeNext(ColumnFamilyRecordReader.java:183) > at > com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:140) > at > com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:135) > at > org.apache.cassandra.hadoop.ColumnFamilyRecordReader.nextKeyValue(ColumnFamilyRecordReader.java:139) > at > org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:423) > at > org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67) > at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143) > 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) > > thanks, > Dean > --bcaec5215f77d6035f04b1bcc097 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Well, by edting src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordRead= er.java

in version 1.0.2 cassandra src just before the

=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 totalRead++;
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 KeySlice ks =3D rows.get(i++);
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = SortedMap<ByteBuffer, IColumn> map =3D new TreeMap<ByteBuffer, ICo= lumn>(comparator);

I added the code

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if(i >=3D = rows.size())
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return endOfD= ata();

That seems to fix it AND this is only needed by the jobtracke= r so you don't need to redeploy cassandra for the fix which is nice....= it seems to work now with rows that don't contain that column.=A0 If an= yone thinks this will have bad side affects, please let me know.

later,
Dean=A0 http://blog.alvazan.com
=


On Mon, Nov 14, 2011 at 7:01 PM, Dea= n Hiller <dean@alv= azan.com> wrote:
There are 4 jobs submitted by the wordcount= cassandra example and the first one fails and the other 3 all pass and wor= k with results.

The first job I noticed is looking for column name text0 due to i being= 0 in the loop.=A0 The exception is not going through the wordcount code at= all though, but this text0 column does not exist in the cassandra database= (is this an InputFormat bug in the cassandra code to wire in the map/reduce= stuff or is there a way to fix this???)

The exception...

2011-11-14 18:16:26,540 INFO org.apache.hadoop.= mapred.TaskInProgress: Error from attempt_201111141812_0002_m_000000_1: jav= a.lang.IndexOutOfBoundsException: Index: 0, Size: 0
=A0=A0=A0 at java.ut= il.ArrayList.RangeCheck(ArrayList.java:547)
=A0=A0=A0 at java.util.ArrayList.get(ArrayList.java:322)
=A0=A0=A0 at or= g.apache.cassandra.hadoop.ColumnFamilyRecordReader$RowIterator.computeNext(= ColumnFamilyRecordReader.java:300)
=A0=A0=A0 at org.apache.cassandra.had= oop.ColumnFamilyRecordReader$RowIterator.computeNext(ColumnFamilyRecordRead= er.java:183)
=A0=A0=A0 at com.google.common.collect.AbstractIterator.tryToComputeNext(Ab= stractIterator.java:140)
=A0=A0=A0 at com.google.common.collect.Abstract= Iterator.hasNext(AbstractIterator.java:135)
=A0=A0=A0 at org.apache.cass= andra.hadoop.ColumnFamilyRecordReader.nextKeyValue(ColumnFamilyRecordReader= .java:139)
=A0=A0=A0 at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextK= eyValue(MapTask.java:423)
=A0=A0=A0 at org.apache.hadoop.mapreduce.MapCo= ntext.nextKeyValue(MapContext.java:67)
=A0=A0=A0 at org.apache.hadoop.ma= preduce.Mapper.run(Mapper.java:143)
=A0=A0=A0 at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621= )
=A0=A0=A0 at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)=A0=A0=A0 at org.apache.hadoop.mapred.Child.main(Child.java:170)

th= anks,
Dean

--bcaec5215f77d6035f04b1bcc097--