gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiril Menshikov <p...@kiril.me>
Subject Re: Should MongoDB know about Utf8?
Date Fri, 10 Oct 2014 07:17:05 GMT
Tyler,

MongoDb doesn’t support Serializable interface. BasicBSONEncoder has direct class checks.
Unfortunately it's not enough to make Utf8 serializable.

-Kiril

On Oct 9, 2014, at 21:44, Lewis John Mcgibbney <lewis.mcgibbney@gmail.com> wrote:

> Hi Folks,
> Whilst in the muddle of upgrading Nutch 2.3-SNAPSHOT to use Gora 0.5 we've run into a
problem when implementing the gora-mongodb stuff.
> The issue is described within the Jira issue [0]. This being said, Kiril (CC'd) has stated
quite clearly why this is happening. This is a consequence of the following lines of the Nutch
code base 
> 
> https://github.com/apache/nutch/blob/2.x/src/java/org/apache/nutch/fetcher/FetcherJob.java#L218
> 
> https://github.com/apache/nutch/blob/2.x/src/java/org/apache/nutch/parse/ParserJob.java#L274
> 
> https://github.com/apache/nutch/blob/2.x/src/java/org/apache/nutch/crawl/DbUpdaterJob.java#L128
> 
> and results in the following stack trace
> 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)
> 
> The cause is the following line (example from FetcherJob):
> filter.getOperands().add(new Utf8(batchId));
> 
> During serialization MongoDB doesn't know about Utf8 type.
> 
> My question is now... should we remove the Utf8 from Nutch, or should gora-mongodb handle
this silently?
> 
> Thanks for reading.
> Lewis
> 
> [0] https://issues.apache.org/jira/browse/NUTCH-1843
> 
> -- 
> Lewis 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message