You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by Lewis John Mcgibbney <le...@gmail.com> on 2014/10/09 20:44:21 UTC
Should MongoDB know about Utf8?
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*
Re: Should MongoDB know about Utf8?
Posted by Renato Marroquín Mogrovejo <re...@gmail.com>.
They are deserialized out of Mongo but as a set of MongoResult objects and
not as WebPages.
2014-10-10 15:17 GMT+02:00 Tyler Palsulich <tp...@gmail.com>:
> > MongoDb doesn’t support Serializable interface.
>
> You're right. My mistake. Even if it was, Utf8 implementing Serializable
> isn't an option.
>
> > I end up with a bunch of MongoResults instead of WebPages
>
> Are the WebPages "serialized" into Mongo, but not out of Mongo?
>
> Tyler
>
> On Fri, Oct 10, 2014 at 5:37 AM, Renato Marroquín Mogrovejo <
> renatoj.marroquin@gmail.com> wrote:
>
> > Hi guys,
> >
> > So I have just tried putting and getting elements (Nutch's WebPage)
> > entries specifically and everything works fine. So this is confusing, I
> > guess Nutch is doing something in the middle there that may have to do
> with
> > the mapping file or something like it. Because I tried changing the key
> > type (from String to Utf8) and gave an unrelated error saying that the
> > collection hadn't been defined (which is not true), I would have expected
> > to get a classCastException. And the other weird thing is that when
> > performing a get using a query object I end up with a bunch of
> MongoResults
> > instead of WebPages. I think that is bug (or . . . a feature) that we are
> > not aware of. Maybe Damian can help us out here.
> > I will keep on pocking around, but gora-mongodb is getting the data in,
> > and it is able to take it out.
> >
> >
> > Renato M.
> >
> > 2014-10-10 9:17 GMT+02:00 Kiril Menshikov <po...@kiril.me>:
> >
> >> 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
> >>
> >>
> >
>
Re: Should MongoDB know about Utf8?
Posted by Tyler Palsulich <tp...@gmail.com>.
> MongoDb doesn’t support Serializable interface.
You're right. My mistake. Even if it was, Utf8 implementing Serializable
isn't an option.
> I end up with a bunch of MongoResults instead of WebPages
Are the WebPages "serialized" into Mongo, but not out of Mongo?
Tyler
On Fri, Oct 10, 2014 at 5:37 AM, Renato Marroquín Mogrovejo <
renatoj.marroquin@gmail.com> wrote:
> Hi guys,
>
> So I have just tried putting and getting elements (Nutch's WebPage)
> entries specifically and everything works fine. So this is confusing, I
> guess Nutch is doing something in the middle there that may have to do with
> the mapping file or something like it. Because I tried changing the key
> type (from String to Utf8) and gave an unrelated error saying that the
> collection hadn't been defined (which is not true), I would have expected
> to get a classCastException. And the other weird thing is that when
> performing a get using a query object I end up with a bunch of MongoResults
> instead of WebPages. I think that is bug (or . . . a feature) that we are
> not aware of. Maybe Damian can help us out here.
> I will keep on pocking around, but gora-mongodb is getting the data in,
> and it is able to take it out.
>
>
> Renato M.
>
> 2014-10-10 9:17 GMT+02:00 Kiril Menshikov <po...@kiril.me>:
>
>> 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 <le...@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
>>
>>
>
Re: Should MongoDB know about Utf8?
Posted by Damien Raude-Morvan <dr...@drazzib.com>.
Hi Renato,
2014-10-10 11:37 GMT+02:00 Renato Marroquín Mogrovejo
<re...@gmail.com>:
> Hi guys,
[...]
> And the other weird thing is that when performing a get
> using a query object I end up with a bunch of MongoResults instead of
> WebPages. I think that is bug (or . . . a feature) that we are not aware
> of. Maybe Damian can help us out here.
Thanks for your feedback !
I've not observed that behavior myself... Could you please provide
some test case ?
Regards,
--
Damien
Re: Should MongoDB know about Utf8?
Posted by Renato Marroquín Mogrovejo <re...@gmail.com>.
Hi guys,
So I have just tried putting and getting elements (Nutch's WebPage) entries
specifically and everything works fine. So this is confusing, I guess Nutch
is doing something in the middle there that may have to do with the mapping
file or something like it. Because I tried changing the key type (from
String to Utf8) and gave an unrelated error saying that the collection
hadn't been defined (which is not true), I would have expected to get a
classCastException. And the other weird thing is that when performing a get
using a query object I end up with a bunch of MongoResults instead of
WebPages. I think that is bug (or . . . a feature) that we are not aware
of. Maybe Damian can help us out here.
I will keep on pocking around, but gora-mongodb is getting the data in, and
it is able to take it out.
Renato M.
2014-10-10 9:17 GMT+02:00 Kiril Menshikov <po...@kiril.me>:
> 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 <le...@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
>
>
Re: Should MongoDB know about Utf8?
Posted by Kiril Menshikov <po...@kiril.me>.
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 <le...@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
Re: Should MongoDB know about Utf8?
Posted by Tyler Palsulich <tp...@gmail.com>.
> should we remove the Utf8 from Nutch, or should
> gora-mongodb handle this silently?
My vote would be to handle Utf8 silently. Mongo's limitation should not be
a limitation for Gora, consequently for Nutch. But, I think Mongo *does*
have builtin support for Utf8. I think the problem is that the
org.apache.avro.util.Utf8
class isn't serializable. See AVRO-200 [1] and the corresponding AVRO-80.
So, can we just call toString() on the Utf8 object before putting it into
Mongo?
Not an exact solution, but more information.
[1] - https://issues.apache.org/jira/browse/AVRO-200
Tyler
Re: Should MongoDB know about Utf8?
Posted by Damien Raude-Morvan <dr...@drazzib.com>.
Hi all!
2014-10-09 20:44 GMT+02:00 Lewis John Mcgibbney <le...@gmail.com>:
> Hi Folks,
[..]
> 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?
I've just added a comment on https://issues.apache.org/jira/browse/NUTCH-1843
As stated there, issue arises in gora-mongo filters handling and not
really from object-to-datastore mapping already handle Utf8 nicely
I was able to complete a full generate-fetch-parse Nutch cycle using
the following patch.
I'm not complety satisfied with this patch because :
* since method signature is List<Object> rawOperands, caller can send
any datatype which might lead to other types of crash
* we have to implement this transformation in each driver (which seems
error prone)
* I'm not sure of use-case of Utf8 as Operand (ie. I'm only using
String type here)
Regards,
--
Damien