You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Dean Hiller <de...@alvazan.com> on 2011/11/15 03:28:53 UTC

This seems to fix it.....wordcount example exception that I think should not occur

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<ByteBuffer, IColumn> map = new TreeMap<ByteBuffer,
IColumn>(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 <de...@alvazan.com> 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
>