Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.5
-
None
Description
Gora 0.5 MongoDB driver fail to properly serialize Utf8 instance passed to its local filters implementation.
Here is sample code
filter.getOperands().add(new Utf8(batchId));
that will trigger the following exception at runtime
java.lang.IllegalArgumentException: can't serialize class org.apache.avro.util.Utf8 at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:284) at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:185) at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:131) at com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:33) at com.mongodb.OutMessage.putObject(OutMessage.java:289) at com.mongodb.OutMessage.writeQuery(OutMessage.java:211) at com.mongodb.OutMessage.query(OutMessage.java:86) at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:81) at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:66) at com.mongodb.DBCursor._check(DBCursor.java:458) at com.mongodb.DBCursor._hasNext(DBCursor.java:546) at com.mongodb.DBCursor.hasNext(DBCursor.java:571) at org.apache.gora.mongodb.query.MongoDBResult.nextInner(MongoDBResult.java:69) at org.apache.gora.query.impl.ResultBase.next(ResultBase.java:114) at org.apache.gora.mapreduce.GoraRecordReader.nextKeyValue(GoraRecordReader.java:119) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:531) at org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364) at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:223) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)
This pattern is extensively used by Apache Nutch :
Attachments
Issue Links
- blocks
-
NUTCH-1843 Upgrade to Gora 0.5
- Closed