Removed unneccessary creation of new context.

A new context is allocated for callback dispatching,
however it is never actually used.

Change-Id: Ie1ad4308150acf315edcefcb9b1f9ab105e9d166
Reviewed-on: http://review.couchbase.org/26497
Tested-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
JSCBC-24 Added v8 error catching

Update test case to be able to pass even though an exception is
purposely being throw. Added try-catch code to properly handle an error
within v8 and propagate it to the default node exception handler.

Change-Id: Ic3b868388bd509d8442081d10b1c6326d8bd8995
Reviewed-on: http://review.couchbase.org/26498
Tested-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Fixed test runner to display slash codes.

Change-Id: Ia032387eb120ad2004cd6d8deae111bdf4c111de
Reviewed-on: http://review.couchbase.org/26500
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Release the memory allocated for command entries

Change-Id: I334df841ddddbbee5c3311d5fc51650e3293b4b3
Reviewed-on: http://review.couchbase.org/27342
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Add a couchnode benchmark sample

A work in progress for benchmarking the node client library. This commit
features measuring throughput and min, max, avg, 95 percentile response
times. The number of connections and requests are configurable through
command line as  well as on code(bench_config object). Additionally an
optional ramp up time is also configurable in the code. Currently
supports GET and SET ops.

Change-Id: Ic639b4673c59a7c85cdafe639bccd54fd1506aed
Reviewed-on: http://review.couchbase.org/26521
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Use new I/O plugin

Change-Id: I9188d6d5aad6716acbcfe0316c15e92239992432
Reviewed-on: http://review.couchbase.org/27740
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Added required defines per Mark's recommendation
Fixes an issue experienced during npm install

Change-Id: I86c988083e11c9b8fb7501852546e2dcf0410fae
Reviewed-on: http://review.couchbase.org/28401
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Rewrite the underlying C++ implementation

This provides a more maintainable and performant layer for Couchnode to
interface with V8. It also provides well structured classes to allow for
better handling and/or rescheduling of commands.

Much of the work here was previously done in javascript itself, with our
own arguments being positional, but such code was difficult to maintain
and extend.

TBD are docs for the new internal API

Change-Id: If60c6ee86bae5ca05be8370336ef45935ce2b00b
Reviewed-on: http://review.couchbase.org/28593
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Allow specifying --couchbase-root

Change-Id: If0b120f1c4047419afd092988a517195503dd7df
Reviewed-on: http://review.couchbase.org/27742
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Implement OBSERVE

Change-Id: I63e3d5edeed3874697b5d4a230e5542ae515a1d7
Reviewed-on: http://review.couchbase.org/28614
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Define constants with NODE_DEFINE_CONSTANT

Change-Id: I9f3a5220de19c05836be578a7a146bb5b3379df7
Reviewed-on: http://review.couchbase.org/28616
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Schedule less operations for jscbc-14 tests

LCB is somewhat broken and 6k ops is plenty

Change-Id: I892de7aa95716b8954d2d4ffe986d0c7dd2ea980
Reviewed-on: http://review.couchbase.org/28617
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Add extended value formatting options

Change-Id: I7bb0e2cf408ff4fa9d23aee148b6f17fcdae9789
Reviewed-on: http://review.couchbase.org/28618
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
runtests from tests directory

Change-Id: I97d8f1290e8f0ee100554f6a0370040919c407e7
Reviewed-on: http://review.couchbase.org/28619
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
API Documentation Fixups

Document all public methods. Reflect newer changes in API

Change-Id: Iecadf4360a73150643a13962098f4f436b5d044c
Reviewed-on: http://review.couchbase.org/28620
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
View-query and pagination interface.

lib/couchbase.js:
  - Importing query.js module.
  - _init() callback to query module.
  - view() API does not take a callback and returns a Query() instance. We
    expect users to do,
        var q = cb.view("designdoc", "myview", queryparams)
        q.query(callback);

lib/http.js:
  - moved parameter validation under view() API to query.js, since we need to
    validate query parameters at several places.
  - view() API just returns the Query() instance.

lib/query.js:
  - implements the following query API.
      q.query(queryparams, callback)
      q.clone(queryparams)
      q.firspage(queryparams, callback)

  - implements the following paginator API.
      q.isNext()
      q.next(callback)
      q.prev(callback)

Added test cases for query in 08-query.js
Added test cases for pagination in 08-page.js
Updated test cases for 08-view.js

Change-Id: Ic0cc58d16beebd3454fa35856463a8879e53e126
Reviewed-on: http://review.couchbase.org/28615
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Support 0.8

This goes in conjunction with a different patch to LCB to support the
same

Change-Id: Ic23e878da5826a9d723339128d204b27e50e5a96
Reviewed-on: http://review.couchbase.org/28621
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Call error callback on connection failure

Change-Id: I9eb82a6075c202a5d1100648a5e0cecd974d43aa
Reviewed-on: http://review.couchbase.org/28634
Reviewed-by: Brett Lawson <brett19@gmail.com>
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>