Re: [Help]Riak concurrency problem

2012-09-20 Thread Eric Moritz
You may want to put a timestamp secondary index on the objects and then you can do a range query of between 0 and now() - 5 minutes. Here's the docs on 2i, http://wiki.basho.com/Secondary-Indexes---Configuration-and-Examples.html On Thu, Sep 20, 2012 at 9:26 AM, Douglas Muth wrote: > On Thu, Sep

Re: multi-get (yet again)

2012-08-09 Thread Eric Moritz
I toyed with a pmap in Python a while back to attempt to speed up multiple HTTP request to our web services layer at work. You may want to attempt that with gevent. Here's the code I wrote which is probably not production ready. https://github.com/ericmoritz/pmap On Aug 9, 2012 4:46 AM, "Parnell

Re: Pagination with Ripple

2012-07-19 Thread Eric Moritz
I've fooled around with paginating large lists of keys in Riak. A technique that I have found is to emulate a set using 2i with Lexicographically sorted keys. You can then emulate a db cursor using a ranged 2i query to get chunks of values. You'll do repeated queries to get chunks of data to bui

Re: Riak behind a Load Balancer

2012-06-25 Thread Eric Moritz
This was mentioned in the book, "Scalable Internet Architectures" I haven't used it but it may be worth a look: http://www.backhand.org/wackamole/ On Jun 25, 2012 3:01 PM, "Michael Clemmons" wrote: ___ riak-users mailing list riak-users@lists.basho.com

Re: Link walking with Erlang riak client

2012-06-19 Thread Eric Moritz
Links may not be the most appropriate way to model a set of associated users. They have a limited length and both the user data and the links have to be saved at the same time. What you can do is emulate a set using a separate bucket and secondary indexes. So basically the bucket would look like

Re: Disabling javascript in riak

2012-06-09 Thread Eric Moritz
I just looked into the code and it appears that the JS VMs will only start if map_js_vm_count, reduce_js_vm_count, or hook_js_vm_count are non-zero. On Sat, Jun 9, 2012 at 11:42 AM, wrote: > > Hi, > > I use riak a lot (0.14.2), but I dont need the javascript api ever. > > Is there any way to dis

Re: Riak newbie, need to know if I can switch from Cassandra for a messageQueue For Erlang

2012-05-11 Thread Eric Moritz
I am guessing that in Cassandra that each user's mailbox has a single row key and each message has a lexicographic or timestamp for a column key to preserve order. This can be emulated by using a bucket name as the row key, something like "mailbox-{user-key}" for the bucket and the lexicographic k

Re: Riak Recap for November 28 - 30

2011-11-30 Thread Eric Moritz
I keep seeing CRDT inspired frameworks. Here's one I built in Python that someone may find helpful. It's a bit of a toy but it has good test coverage for the datatypes I've implemented. Framework: https://github.com/ericmoritz/crdt Riak Adapter: https://github.com/ericmoritz/riak_crdt On Wed,

Re: Social network data / Graph properties of Riak

2011-11-18 Thread Eric Moritz
If you're storing the graph in a graph database where you're simply connecting keys to other keys and then you store the actual properties in Riak identified by those keys, then yes Riak will be a fine solution for you. For instance, you traverse the graph using a graph db, collecting a list of ke

Re: Time a link was created?

2011-10-21 Thread Eric Moritz
I don't think there is a way to retrieve that information. What you could do is use a X-Riak-Meta-* header with your link that looks like: Link: <...> riaktag="foo" X-Riak-Meta-foo-created: 2010-10-21T08:11:00Z Eric Moritz. On Oct 21, 2011 1:15 AM, &

Re: empty sibling after a DELETE then PUT

2011-10-06 Thread Eric Moritz
> > The tombstone is nearly treated as an existing object. > > > /Roland > > > > - Original Message - > From: "Eric Moritz" > To: "Jon Meredith" > Cc: riak-users@lists.basho.com > Sent: Thursday, October 6, 2011 12:28:19 AM > Subjec

Has the result failure scenarios documented in wiki changed in 1.0

2011-10-05 Thread Eric Moritz
responses in the face of failure? Thanks, Eric Moritz. ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Re: empty sibling after a DELETE then PUT

2011-10-05 Thread Eric Moritz
eature wasn't well publicized so has not made it into the clients yet. >  There should be more info to follow on deletes soon.  If you really want > the old behavior, add {delete_mode, immediate} to the riak_kv section of > your app.config > Jon Meredith > Basho Technologies. >

empty sibling after a DELETE then PUT

2011-10-05 Thread Eric Moritz
sibling like that and therefore we should treat empty body's as deleted? Thanks, Eric Moritz. ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Re: Riak Search in python: how to extend into complex objects?

2011-09-13 Thread Eric Moritz
I maybe wrong but I believe nested values use underscores. So the field would be address_state:NY On Sep 13, 2011 12:10 PM, "Denis Papathanasiou" < denis.papathanas...@gmail.com> wrote: > I'm using the latest version of riak (0.14.2-1) with the > riak-python-client (v. 1.3.0). > > I want to run the

Re: Secondary indexing

2011-08-04 Thread Eric Moritz
I've been told that there is going to be a map reduce input function,much like how Riak search can serve as the input for a mapreduce query. On Aug 4, 2011 11:26 AM, "Craig Muth" wrote: > Switching to the riak_kv_index_backend backend worked like a charm. > Interestingly the objects that were ther

Re: In-Memory Performance

2011-08-02 Thread Eric Moritz
into the office tomorrow hopefully it speeds things up a bit. > > I'll post some revised numbers once I run my test again. > > - Matt > > On Tue, Aug 2, 2011 at 8:32 PM, Eric Moritz wrote: >> Unless you changed R for the bucket, the default that ships with Riak >>

Re: In-Memory Performance

2011-08-02 Thread Eric Moritz
ona wrote: > Hi Eric, > > I this test, R=1 (the default). > > Thanks! > > - Matt > > On Tue, Aug 2, 2011 at 4:35 PM, Eric Moritz wrote: >> When you were doing the reads, did you set the r-value to 1?  This >> will speed up reads in a read heavy app beca

Re: In-Memory Performance

2011-08-02 Thread Eric Moritz
When you were doing the reads, did you set the r-value to 1? This will speed up reads in a read heavy app because only one node has to be in agreement about the object. Eric. On Tue, Aug 2, 2011 at 11:22 AM, Matt Savona wrote: > Hi all, > > My colleagues and I are evaluating Riak as a persisten

Re: Response: 204 "No Content"

2011-07-05 Thread Eric Moritz
In the HTTP standard a 204 No Content is returned when the request was successful but there is nothing to return other than HTTP headers. If you add returnbody=true in the PUT request, you will receive a 200 OK and the content you just stored, otherwise you will receive a 204 No Content. Eric

RFC: riak-python-client: Added a class for constructing key filters

2011-06-08 Thread Eric Moritz
Hi I added a class to the Python Riak client to hopefully help build key filters easier. I wanted to solicit the opinion of other Python Riak develops to ensure that it smells right. If you have a moment, add your 2 cents to the pull request's comment thread here: https://github.com/basho/riak-p

Re: deleting keys

2011-06-01 Thread Eric Moritz
Depending on what you need the date for, you may be able to skip the parsing step. If you're using it for sorting or comparison, ISO8601 can be compared lexicographically and usually no parsing is needed, "earlier_isodate < later_isodate" will be true in Javascript even though they're strings. I

Re: zip mapreduce results

2011-05-29 Thread Eric Moritz
Sounds like a great contrib.basho.com contribution :) On Sun, May 29, 2011 at 10:40 AM, Ben Tilly wrote: > Google uses http://code.google.com/p/snappy/ internally for exactly this > sort of thing. There is an Erlang binding available. > > On Sun, May 29, 2011 at 12:13 AM, Malka Feldman wrote: >

Re: hidding buckets and keys

2011-05-27 Thread Eric Moritz
Don't trust any client that you put in the hands of someone else. i.e. mobile client, client-side web app, etc. It would take anyone with a packet sniffer 5 seconds to figure out you're using Riak and then they have the Riak docs to step them through how to read/write arbitrary values from your c

Re: riaksearch: using index docs in place of real objects

2011-05-26 Thread Eric Moritz
Out of curiosity what is the key in this URL? http://riak.host:8098/riak/_rsid_/key On Thu, May 26, 2011 at 9:42 AM, Mathias Meyer wrote: > Greg, > > Riak Search stores indexed documents in Riak KV too, as serialized Erlang > terms. You can easily verify that by requesting a document from > htt

Re: Capacity planning page clarification

2011-05-13 Thread Eric Moritz
I kept overlooking that you were not using a list and you were using ordsets. I was puzzled at why the merged result on the statebox README wasn't [b, a, b]. It may be helpful to reiterate that this only works for operations that are idempotent. Eric. On May 12, 2011 7:29 PM, "Mike Oxford" wrote

Re: alphanumeric sort

2011-05-12 Thread Eric Moritz
That's what I get for coding in gmail, that function signature obviously should be: Riak.reduceSortByField(values, key) { ... } On Thu, May 12, 2011 at 2:46 AM, Eric Moritz wrote: > The reason why a custom function is needed is because he wants to sort > on a key in the javascript

Re: alphanumeric sort

2011-05-11 Thread Eric Moritz
The reason why a custom function is needed is because he wants to sort on a key in the javascript object. If it was a list of strings, calling .sort() would be fine. We need a Riak.reduceSortByField(values, name) { return values.sort(function(x,y) { if(a[key] == b[key]) return 0;

Re: alphanumeric sort

2011-05-11 Thread Eric Moritz
Your compare function will need to return a -1, 0 or 1 for less than, the same or greater than. Luckily javascript allows you to strings lexicographically so the function is a nice two liner: function(a, b) { if(a == b) return 0; return a > b ? 1 : -1; } Application: var reduceSort = func

Re: crash after single insert

2011-05-07 Thread Eric Moritz
Dang, that was my guess but I wasn't sure if it was a red herring or not. On Sat, May 7, 2011 at 11:25 AM, Gary William Flake wrote: > That was it, Nico.  Thanks. > > I know we did a forced shutdown this week, which was probably the cause.  But > I would have thought that riak would have taken c

Re: Very, very slow data insert on two node cluster

2011-05-06 Thread Eric Moritz
The fact that the other node is idle clues makes me think that the node you're talking to is not reaching the other node. Both nodes should be participating in the storage of the data. On Fri, May 6, 2011 at 5:38 AM, Vlatko Basic wrote: > Hi, > > I've build a cluster with two physical Ubuntu 10.

Re: Erlang crashes on bulk insert

2011-05-06 Thread Eric Moritz
There's a log file in the node's root called log/sasl-error.log which may give you more insight into what's failing. If nothing sticks out for you feel free to send it over to me and I'll try to assist you. On Fri, May 6, 2011 at 12:39 PM, Vlatko Basic wrote: > Hi, > > I have two machines (box A

Re: How many links does it take til you get to the center of the ... ?

2011-05-04 Thread Eric Moritz
Out of curiosity, does the protobuf interface have this limitation? On May 4, 2011 5:59 PM, "Sean Cribbs" wrote: > Note that this is an HTTP limitation, not the datastore in general. That said, don't go crazy with them. > > Sean Cribbs > Developer Advocate > Basho Technologies, Inc. > http://bas

Re: Secondary Indices and Storing Binary Data

2011-05-03 Thread Eric Moritz
JSON on a single line is easy because new lines in string values are automatically escaped. The worse (or best) part about this is you would have to write the commit hook in Erlang if the current search hook is any indicator of what the secondary indexes hook will look like. Eric Moritz. On Tue,

How to install an erlang module for use with map reduce

2011-04-22 Thread Eric Moritz
I am sure this is written down somewhere but I can seem to find it with Google. Where do I install an erlang module so that I can use it with a mapred query? Thanks, Eric Moritz ___ riak-users mailing list riak-users@lists.basho.com http

Re: This sure looks like a bug...?

2011-04-18 Thread Eric Moritz
Ben, There's a little demo app that was written by someone at Basho that demostrates a way to accomplish what you're talking about. http://forms.basho.com/riak-in-action-wriaki-p/ Eric. On Mon, Apr 18, 2011 at 11:05 PM, Sean Cribbs wrote: > Sorry for being dismissive, I do understand what you'

Re: Python feature suggestion - load (binary) content from file

2011-04-12 Thread Eric Moritz
If you don't have this integrated into the Riak Python client, I'll be happy to do that for you. Thanks, Eric Moritz. On Sun, Apr 10, 2011 at 10:49 AM, Ana Nelson wrote: > I've just implemented this in a project: > > binary_data = open(sel

Re: Python client and allow_mult

2011-04-01 Thread Eric Moritz
21 PM, Mark Phillips wrote: > Hey Eric, > > Can I ask what you're using/trying to use the Riak Python lib for? Is > this a paid gig or are you just tinkering? > > Mark > > On Fri, Apr 1, 2011 at 10:08 AM, Eric Moritz wrote: >> Does anyone have a standard pattern

Python client and allow_mult

2011-04-01 Thread Eric Moritz
Does anyone have a standard pattern for working with allow_mult with the Python library? I feels a bit awkward to me. I assume I need to do the following: data = {"foo": "bar"} obj = bucket.get("mykey") if not obj.exists(): obj = bucket.new("mykey", data=data) else: if obj.has_siblings

Re: EC2 and RIAK

2011-04-01 Thread Eric Moritz
I concur with Mark, Rackspace has some poor performance with Riak. On Fri, Apr 1, 2011 at 1:00 PM, Mark Steele wrote: > I've done some rather disappointing tests with Riak using Rackspace cloud > servers. Much better off on dedicated hardware if you can find it. > Mark Steele > Bering Media Inc.

Re: Riak and Locks part 2

2011-04-01 Thread Eric Moritz
I suppose you could pair Riak with redis and use redis to create a shared mutex style lock. That'll work as long as all the clients writing to Riak use the mutex. That's not how Riak handles concurrency conflicts though. Riak is made to be available for writes so conflicts are merged when values

Re: using python client for search

2011-04-01 Thread Eric Moritz
to be based? I > guess I am trying to find out if riaksearch indexes could be used in the > same way couchdb views are used. If there is already an index can I just > access the tip of it? > Thomas > > > -- > Thomas Bikeev > Sent with Sparrow > > On Thursday 31 Ma

Solr Sorting Bug in Riak Search?

2011-04-01 Thread Eric Moritz
Hi, I was just digging through the riak search code and I think there may be a bug, but I may be mistaken (my Erlang isn't that great). It appears that the search is performed, sorted by score, sliced using the start and rows values. After that happens, if there is a sort param, the results are t

Re: using python client for search

2011-03-31 Thread Eric Moritz
The client.search method is basically a shortcut to using the mapred_search erlang function as an input to a map/reduce query. You can sort, seek and limit in the reduce phase of that mapred query. An alternative is to use pysolr to talk to riak search. Eric. On Thu, Mar 31, 2011 at 11:15 AM, T

Re: is there auto-increment functionality in riak??

2011-03-22 Thread Eric Moritz
I have been meaning to get familiar with Riak's allow_mult setting so I used this thread as an excuse to mess with it. I created a class in python call RiakCounter that stores a value into a key that makes conflict resolution easier when reading the value. Here's the code. I'm sure there's proba

Re: Riak n00b questions

2011-03-14 Thread Eric Moritz
Here's a quick example of the map-highs-by-month query in the Riak Fast Track: http://pastebin.com/FGieAFVy Check out this link to get the goog.csv file that is used in that query: http://wiki.basho.com/Loading-Data-and-Running-MapReduce-Queries.html Take a glance over the README for the Riak p

Re: Riak Recap for Feb. 2 - 4

2011-02-04 Thread Eric Moritz
That pull request wasn't mine. It was someone else. On Feb 4, 2011 5:14 PM, "Mark Phillips" wrote: ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Loading documents in the map phase

2011-02-03 Thread Eric Moritz
For some reason I was under the impression that I could return a list of bucket/key pairs in a map phase and Riak would automagically load the documents for the next query phase. For instance I have the document: /riak/entry_list/eric [ ["entries", "story-1"], ["entries", "story-2"], ] then

Re: indexing tags with Riak Search

2011-01-29 Thread Eric Moritz
ucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters > > > > --gordon > > On Jan 28, 2011, at 19:14, Eric Moritz wrote: > > Is there a way to index tags in Riak Search? For example, say I have the following data structure: > > hello.json >

indexing tags with Riak Search

2011-01-28 Thread Eric Moritz
Is there a way to index tags in Riak Search? For example, say I have the following data structure: hello.json { "title": "Hello, World!" "tags": ["greetings", "first program"] } I noticed the result from Solr returns fielded data that resembles this: GET /solr/tagtest/selec

Re: running erlang map phases via REST API

2011-01-24 Thread Eric Moritz
I would find this useful. It's easier to run an anonymous function than to deploy an erlang module to a cluster. On Jan 24, 2011 3:34 PM, "Dan Reverri" wrote: > Hi Brendan, > > Anonymous Erlang functions are not currently supported in map reduce phases. > Is this a feature the community would find

Re: Getting all the Keys

2011-01-23 Thread Eric Moritz
I wouldn't do a linked list using Riak links unless it was a small list. With a bytes you can transverse to the node the has a key closest to the left side of your range and then do a in order tranversal of the tree until you reach the right side of your range. It's a lot like a binary search tre

Re: Getting all the Keys

2011-01-23 Thread Eric Moritz
After thinking about it. A b-tree in a bucket wouldn't provide any functionality that I couldn't get from riak search... so that's probably a bad idea. On Jan 22, 2011 3:28 PM, "Eric Moritz" wrote: > I have a pipe dream of doing a distibuted b-tree with a bucket wh

Re: Getting all the Keys

2011-01-23 Thread Eric Moritz
I always see problems with getting lists of data. I hardly every see solutions. What are some of solutions people have come up with to do lists of data? One solution is Riak Search for sorted lists and filtering. Another solution is a mega-doc of presorted keys that can be sliced in a map phas

Re: Getting all the Keys

2011-01-23 Thread Eric Moritz
I have a pipe dream of doing a distibuted b-tree with a bucket who's value is a node in the tree containing a list of keys to another bucket and left and right links to children nodes. It feels right in my head, though it is probably horribly flawed in some way. I'm certain more clever data nerds

Re: Getting all the Keys

2011-01-23 Thread Eric Moritz
This is the best way for me to understand how to model data in Riak. Think about the web. You always have a starting point. The starting point is an URL. An URL is analogous to a key in Riak. A URL gets you a document on the web, a key gets you a document in Riak. Now on the web page addressed by

Fwd: Re: Search Indexing only specific content-types?

2011-01-23 Thread Eric Moritz
I'm sure the basho folks would love to have that in the function contrib :) http://contrib.basho.com/ -- Forwarded message -- From: "Gordon Tillman" Date: Jan 21, 2011 7:55 PM Subject: Re: Search Indexing only specific content-types? To: "Eric Moritz"

Fwd: Re: Re: too_many_results error

2011-01-16 Thread Eric Moritz
11 8:42 AM Subject: Re: Re: too_many_results error To: "Eric Moritz" Cc: "riak-users@lists.basho.com" Hi Eric, This is a failsafe that is applied prior to the 'rows' parameter. It is applied separately to provide a hard system limit, intended to allow the cluster adminis

Fwd: Re: too_many_results error

2011-01-16 Thread Eric Moritz
Would using the rows URL parameter fix this or is the error occurring prior to the result being limited? -- Forwarded message -- From: "Rusty Klophaus" Date: Jan 16, 2011 8:34 AM Subject: Re: too_many_results error To: "Malka Feldman" Cc: Hi Malka, The error you see is caused b

Re: newbie questions: sorted keys, ADT primitives, and link manipulation

2011-01-16 Thread Eric Moritz
I have also been toying with the idea of a linked list using a "next" links on entries. Theoretically I could use link walking to get the next 19 entries given a "HEAD" entry. It feels like a maintenance nightmare though. On Sat, Jan 15, 2011 at 7:23 PM, Gary William Flake wrote: > I am buildin

Re: newbie questions: sorted keys, ADT primitives, and link manipulation

2011-01-16 Thread Eric Moritz
First, check out Riak Search. It can sort your records by dates and your can use it for filtering on secondary indexes. If your criteria for listing the records is pretty simple and can be expressed with a search query, that may be your best bet. For instance, listing a user's blog entries is as

Is this idiotic?

2011-01-11 Thread Eric Moritz
I'm still getting a feel for schema design in Riak. I need to fetch blog entries using a compound index of (author, tag). This is what I've come up with. I have two buckets: /riak/entry/{id} /riak/entries_by_author_and_tag/{author_id}.{tag} Assume the keys are url safe. Stored in entries_by_a

EXPLAIN for map reduce?

2011-01-11 Thread Eric Moritz
Is there currently an automatic way of debugging a map reduce query? Basically the equivalent to an EXPLAIN that says how long each phase took? I suppose I could drop ejsLog() calls in each phase but it would be nice to have a built-in way to analyze a m/r query. Thanks, Eric. __

Riak Search: deleting a value without indexing causes a 500 error

2011-01-09 Thread Eric Moritz
It appears that if I try to delete a key before it has been indexed, an error occurs. If I do the following, a 500 occurs: (x)e...@eric-1000he:~/Projects/x/src/search_test$ . resty http://localhost:8098* (x)e...@eric-1000he:~/Projects/x/src/search_test$ PUT /riak/uhoh/foo '{"test": "testing"}' (x

Riak Search tarball is missing the merge_index_data_root value for devrel

2011-01-08 Thread Eric Moritz
When I run "make devrel" using the Riak Search 0.13.0 tarball I have to set the merge_index data_root to get the dev cluster to index. I guess it's not a big deal because most people are building the dev cluster using a git clone. I just wanted to let Basho know about the issue. Eric. _

allow_multi VS HTTP Conditional PUT

2011-01-02 Thread Eric Moritz
Hi I just read "Why Vector Clocks are Easy". I am having trouble seeing the advantage of letting a stale PUT into production and merge afterwards vs HTTP's Conditional PUT, which never let's a stale PUT into production. I feel like the way that HTTP handles optimistic concurrency control works a l