Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Simple example Mongo C Driver - fetch/insert docs parallel
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Waitman Gobble  
View profile  
 More options Apr 30 2012, 10:52 pm
From: Waitman Gobble <gobble...@gmail.com>
Date: Mon, 30 Apr 2012 19:52:15 -0700
Local: Mon, Apr 30 2012 10:52 pm
Subject: Re: [mongodb-user] Re: Simple example Mongo C Driver - fetch/insert docs parallel

On Mon, Apr 30, 2012 at 1:36 PM, Waitman Gobble <gobble...@gmail.com> wrote:

> On Apr 30, 2012 10:35 AM, "Kyle Banker" <k...@10gen.com> wrote:

> > This is very cool.

> > Quick question: why do you free the bson object in line 71?

> https://github.com/creamy/parallel-proc-url-mongodb/blob/master/tmo.c...

> > This doesn't appear necessary (or correct).

> > On Wednesday, April 25, 2012 4:08:29 AM UTC-4, Waitman Gobble wrote:

> >> Hi,

> >> Here is a simple example using the MongoDB C Client, pthreads and
> libcurl to fetch documents by URL and insert into MongoDB.
> >> If you wish to load and process multiple docs using the C programming
> language then this example may be interesting to you.

> >> When I find another moment I'll expand the example to do stuff with the
> data.

> >> https://github.com/creamy/parallel-proc-url-mongodb

> >> Thank you,

> >> Waitman Gobble
> >> San Jose California USA

> > --
> > You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> > To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/bd9NDEmxljQJ.
> > To post to this group, send email to mongodb-user@googlegroups.com.
> > To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com

> Hi,

> indeed. oops, looks like it needs an update.

> Thanks,

> Waitman Gobble
> San Jose, California USA

I made some updates.

Update 2012-04-30

remove free w/o malloc
add status check block to avoid compiler warnings
add build.sh to avoid compiler warnings about comments
add script to insert test data
remove abuff / memcopy and use buffer from curl callback

https://github.com/creamy/parallel-proc-url-mongodb

I tried with latest mongo c client from github. Since I'm running on
$ uname -a
FreeBSD hunny.waitman.net 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Fri Apr 20
20:56:16 PDT 2012     root@:/usr/obj/usr/src/sys/KEYSHIA  amd64
(it's also tested on CentOS 5.8/SMP if that makes any difference to anyone!)

on my machine i deleted env_win32.c and env_standard.c so gcc src/*.c would
work.. :-) that's actually in the build.sh so definitely check that out
before running. maybe there's a nicer way(?)

Thank you,

Waitman Gobble
San Jose California USA


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.