couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hammond <>
Subject Re: Native Erlang view server
Date Mon, 03 Aug 2009 06:56:57 GMT
On 28/07/2009 12:53 PM, Paul Davis wrote:
> Hey,
> I zoned out a bit and finished getting the native Erlang view server
> passing all of the rspec tests. The code can be found online at [1]
> and I'll also attach a patch.
> If anyone wants to play with it, that'd be pretty cool. There's
> probably a bit of weakness in error reporting right now, but I think
> it should work other than that.

Thanks Paul,
   I think this is getting very close to being ready for inclusion in 
the trunk and I'd really love to get it in 0.10.  Paul indicated on 
#couchdb that his only remaining concerns were cosmetic - some error 
messages and comments need updating (and even they have been tweaked 
since then) - so I think the current state is good enough for general 
review and to stimulate some discussion, or even simple agreement it is 
good enough to run with.

I've put a patch of Paul's branch against the trunk in:
but also attached a copy here for your convenience.

The patch consists of 3 main parts:

* Changes to couch_query_servers.erl to allow arbitrary erlang code to 
be used as a query server.  The existing calls to couch_os_process have 
been changed to this more abstract form - IOW, it could be viewed that 
couch_os_process is now a specialized 'native query server'.  Note 
couch_os_process hasn't changed at all, and that Damien previously 
reviewed this portion of the patch via Jira and all those comments have 
been addressed.

* A native (ie, erlang) view server implementation.  This has undergone 
a number of iterations, but the current version exposes an environment 
similar to the Javascript query server - functions 'Emit', 'Log', 
'GetRow' etc are all available to the erlang view functions.  Along with 
normal views, 'list' and 'show' functionality is fully supported and it 
has comprehensive tests.

* Other misc changes: the ruby view server tests exercise this new 
server; futon now reads the new 'native_query_servers' config section; 
makefile changes for the new .erl file.  The ruby test script could do 
with a little more work, but neither Paul or I know Ruby well enough to 
do this without some help.

There are currently no docs for this as of yet, but if accepted, I will 
commit to adding a page to the Wiki with documentation and examples 
using this new server.

So - please let me know what else needs to be done for this to be 
accepted.  If nothing particularly obvious stands out, then please give 
this patch a review.



View raw message