Picon

Re: Erlang-only CouchDB

Paul,
I am on 0.11.xxx
Detailed one below,
Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0]
[hipe] [kernel-poll:true]
-- 
Regards,
Senthilkumar Peelikkampatti,
http://pmsenthilkumar.blogspot.com/

Eshell V5.7.2  (abort with ^G)
1> Apache CouchDB 0.11.0b830800 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.

On Sat, Oct 31, 2009 at 6:44 PM, Paul Davis <paul.joseph.davis@...>wrote:

> On Sat, Oct 31, 2009 at 7:01 PM, Senthilkumar Peelikkampatti
> <senthilkumar.peelikkampatti@...> wrote:
> > I found almost 7-8 times faster when I use hovercraft compare to http
> > interfaced client like couchbeam or ecouch
>
> That sounds about right.
>
> > Besides, I am also trying to embed couchdb with my other Erlang
> application
> > but when I looked at the startup parameter of the couchdb it is not a
> naive
> > job to eliminate all the hard work of shell script.
>
> What version are you on? Trunk and 0.10.x should both simplify the
(Continue reading)

Paul Davis | 1 Nov 01:28 2009
Picon

Re: Erlang-only CouchDB

Senthilkumar,

The basic application loading should work something like this:

$ ERL_LIBS=/usr/local/lib/couchdb/erlang/lib erl
1> application:start(couch).

Paul Davis

On Sat, Oct 31, 2009 at 8:18 PM, Senthilkumar Peelikkampatti
<senthilkumar.peelikkampatti@...> wrote:
> Paul,
> I am on 0.11.xxx
> Detailed one below,
> Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0]
> [hipe] [kernel-poll:true]
> --
> Regards,
> Senthilkumar Peelikkampatti,
> http://pmsenthilkumar.blogspot.com/
>
> Eshell V5.7.2  (abort with ^G)
> 1> Apache CouchDB 0.11.0b830800 (LogLevel=info) is starting.
> Apache CouchDB has started. Time to relax.
>
> On Sat, Oct 31, 2009 at 6:44 PM, Paul Davis <paul.joseph.davis@...>wrote:
>
>> On Sat, Oct 31, 2009 at 7:01 PM, Senthilkumar Peelikkampatti
>> <senthilkumar.peelikkampatti@...> wrote:
>> > I found almost 7-8 times faster when I use hovercraft compare to http
(Continue reading)

Picon

Re: Erlang-only CouchDB

Paul,
 Thanks for the quick reply,

May be I am doing something wrong,

These are the things I did to run couchdb using shell scripts

   1. pull the source from SVN directly
   2. ./bootstrap and ./configure
   3. make && sudo make install
   4. I usually start in admin mode (sudo  ./couchdb )

Now,
     for emulator start, I tried with your approach and got the following
error

   application: couch
    exited: {bad_return,{{couch_app,start,
                                    [normal,
                                     ["/usr/local/etc/couchdb/default.ini",
                                      "/usr/local/etc/couchdb/local.ini"]]},
                         {'EXIT',{{badmatch,{error,shutdown}},
                                  [{couch_server_sup,start_server,1},
                                   {application_master,start_it_old,4}]}}}}

I verified that the above config default.ini and local.ini is available at
the above location. Is there something wrong?

--

-- 
Regards,
(Continue reading)

Paul Davis | 1 Nov 02:10 2009
Picon

Re: Erlang-only CouchDB

Senthilkumar,

You'll need to make sure that the user running the Erlang shell has
permissions to read/write to all the required directories as usual. A
quick test would be to do

$ ERL_LIBS=/usr/local/lib/couchdb/erlang/lib sudo erl
1> application:start(couch).

Paul Davis

On Sat, Oct 31, 2009 at 8:49 PM, Senthilkumar Peelikkampatti
<senthilkumar.peelikkampatti@...> wrote:
> Paul,
>  Thanks for the quick reply,
>
> May be I am doing something wrong,
>
> These are the things I did to run couchdb using shell scripts
>
>   1. pull the source from SVN directly
>   2. ./bootstrap and ./configure
>   3. make && sudo make install
>   4. I usually start in admin mode (sudo  ./couchdb )
>
> Now,
>     for emulator start, I tried with your approach and got the following
> error
>
>   application: couch
(Continue reading)

Picon

Re: Erlang-only CouchDB

I already tried that option, it even broke something else.
but got
1> application:start(couch).
{error,{"no such file or directory","couch.app"}}

It looks like erl is not inheriting or not obeying sudo

But finally, the below step did help me solve privilege issues,

   1. sudo bash
   2. set ERL_LIBS
   3. export it
   4. erl

Actual steps are

   1. sudo bash
   2. ERL_LIBS=/usr/local/lib/couchdb/erlang/lib
   3. export ERL_LIBS
   4. echo $ERL_LIBS  --- to verify the var is set properly
   5. erl
   6.

 solved  in my macbook OS-X 10.5.8  :)

Thanks paul.

On Sat, Oct 31, 2009 at 8:10 PM, Paul Davis <paul.joseph.davis@...>wrote:

> Senthilkumar,
(Continue reading)

Picon

latest Mochiweb broke couchdb

I wanted to run latest mochiweb but futon stopped working when i upgrade
mochi web,

I have already Mochiweb application running and I wanted to embed the
couchdb as native application. Is there a way to run on latest Mochiweb?

--

-- 
Regards,
Senthilkumar Peelikkampatti,
http://pmsenthilkumar.blogspot.com/
Cunningham, Carl | 1 Nov 09:31 2009
Picon

Accessing individual records returned by a view

Hi folks,

I'm experimenting with using CouchDB as a datastore for various
MS-Office macros, and everything has been just wonderful until I started
to return result sets using views. It appears that the various JSON
implememtations for VBA (and there aren't many out there for pure VBA
code) don't seem to be able to deal with nested structures. Here's an
example:

A view returns the following JSON string:

{"total_rows":36778,"offset":26220,"rows":[
{"id":"6b80c0b76","key":"a <at> bbb.net","value":{"entryid":"81151F241C2500",
"subject":"test subject","senton":"2009-7-09 22:03:43"}},
{"id":"b10ed9bee","key":"b <at> bbb.net","value":{"entryid":A7C3CF74EA95C9F",
"subject":"test subject2","senton":"2009-4-21 10:18:26"}}]}

I then instantiate a jsonlib object, which contains the methods needed
to parse the string:
"Dim lib As New jsonlib"

Then I define a new object, which will eventually contain a
collection/dictionary object populated with the keys/values of the JSON
string:
"Dim json As Object"

Then the JSON string is parsed and shoved into the collection/dictionary
object:
"Set json = lib.parse(mystring)"

(Continue reading)

Brian Candler | 1 Nov 11:06 2009
Picon

Re: What happens with a document, if a conflict is not resolved?

On Fri, Oct 30, 2009 at 08:37:36PM -0400, Adam Kocoloski wrote:
> I like where your head's at on this, Brian.  I should mention that it  
> *is* possible to retrieve all conflict revisions of a document with one 
> request:
>
> GET /db/bob?open_revs=all

Unfortunately, open_revs=all opens more than just the current conflicting
revisions, and the live one is not the first. For example, after branching
to three conflicting revisions and then merging them back into one, I get

  [{"ok": {"_deleted"=>true, ...},
   {"ok": {"_deleted"=>true, ...},
   {"ok": {...current doc...}

This is true after compaction as well. The attached program demonstrates
this.

Do we need a version of get_all_leafs which excludes _deleted members?

> The response format is a slightly awkward Array -- I believe the first  
> revision is the winning one.
>
> [{"ok":{"_id":"bob","_rev":"1-3453545",...}},{"ok": 
> {"_id":"bob","_rev":"1-23042"]

The "ok" tag isn't hard to strip, so this is just a minor annoyance. At
first I couldn't see why it was there at all, but it turns out that
open_revs also lets you list revisions explicitly:

(Continue reading)

Brian Candler | 1 Nov 12:27 2009
Picon

Re: What happens with a document, if a conflict is not resolved?

On Fri, Oct 30, 2009 at 08:37:36PM -0400, Adam Kocoloski wrote:
> The response format is a slightly awkward Array -- I believe the first  
> revision is the winning one.

This is definitely not true. For example, I can get the database into a
state where there are three conflicting versions, and the winning version
is the middle one returned by open_revs=all

$ curl http://127.0.0.1:5984/conflict_test/test?conflicts=true
{"_id":"test","_rev":"10-ca7d1f8bc31d20ad4898e4024547c4c6","hello":"baz","_conflicts":["9-9b4928288c4fc3087833549752bdcdc3","9-2438fa9601119c8fe2c0b2f4a688f65f"]}
$ curl http://127.0.0.1:5984/conflict_test/test?open_revs=all
[{"ok":{"_id":"test","_rev":"9-2438fa9601119c8fe2c0b2f4a688f65f","hello":"bar"}},
{"ok":{"_id":"test","_rev":"10-ca7d1f8bc31d20ad4898e4024547c4c6","hello":"baz"}},
{"ok":{"_id":"test","_rev":"9-9b4928288c4fc3087833549752bdcdc3","hello":"foo"}}]

Code to do this is attached.

Regards,

Brian.
require 'rubygems'
require 'restclient'
require 'json'
DB="http://127.0.0.1:5984/conflict_test"

# Write multiple documents as all_or_nothing, can introduce conflicts
def writem(docs)
  JSON.parse(RestClient.post("#{DB}/_bulk_docs", {
(Continue reading)

Brian Candler | 1 Nov 12:53 2009
Picon

Re: What happens with a document, if a conflict is not resolved?

On Sat, Oct 31, 2009 at 10:40:43AM +0000, Brian Candler wrote:
> > I think I'd be in favor of making the default GET include all conflicts, 
> > but probably in the _conflicts field so as to minimize the changes to the 
> > current API.
> 
> As a first step, that would be unlikely to break anyone, would make it clear
> when a conflict exists, and would simplify the API by removing the need for
> ?conflicts=true. So I'd vote for that.

Also: if you query a view with ?include_docs=true, at the moment you never
get a _conflicts member in the document, even if you say
?include_docs=true&conflicts=true

Perhaps you should?

B.


Gmane