Commits

Anonymous committed 831d74a Merge

Merge.

Comments (0)

Files changed (8)

                            Welcome to Riak.
                            ================
 
-Date: 2010-03-09 15:01:47 EST
+Date: 2010-03-10 01:18:20 CST
 
 
 
    Assuming you have a working Erlang (R13B03 or later) installation,
    building Riak should be as simple as:
 
+
   $ cd $RIAK
   $ make rel
 
-
 2.2 Starting Riak 
 ==================
 
    Once you have successfully built Riak, you can start the server with the
    following commands:
 
+
   $ cd $RIAK/rel/riak
   $ bin/riak start
 
-
    Now, verify that the server started up cleanly and is working:
 
    $ bin/riak-admin test
    Now that you have a functional server, let's try storing some data in
    it. First, start up a erlang node using our embedded version of erlang:
 
+
   $ erts-<vsn>/bin/erl -name riaktest@127.0.0.1 -setcookie riak
   
   Eshell V5.7.4  (abort with ^G)
   (riaktest@127.0.0.1)1>
 
+   Now construct the node name of Riak server and make sure we can talk to it:
 
-   Now construct the node name of Riak server and make sure we can talk to it:
 
   (riaktest@127.0.0.1)4> RiakNode = 'riak@127.0.0.1'.
   
   (riaktest@127.0.0.1)2> net_adm:ping(RiakNode).
   pong
   (riaktest@127.0.0.1)2>
-
    
    We are now ready to start the Riak client:
 
+
   (riaktest@127.0.0.1)2> {ok, C} = riak:client_connect(RiakNode).
-  {ok,{riak_client,'riak@127.0.0.1',4,136,81,151}}
-
+  {ok,{riak_client,'riak@127.0.0.1',<<4,136,81,151>>}}
 
    Let's create a shopping list for bread at /groceries/mine:
 
-  (riaktest@127.0.0.1)6> O0 = riak_object:new("groceries", "mine", ["bread"]).
-  O0 = riak_object:new("groceries", "mine", ["bread"]).
-  {r_object,"groceries","mine",
+
+  (riaktest@127.0.0.1)6> O0 = riak_object:new(<<"groceries">>, <<"mine">>, ["bread"]).
+  O0 = riak_object:new(<<"groceries">>, <<"mine">>, ["bread"]).
+  {r_object,<<"groceries">>,<<"mine">>,
          [{r_content,{dict,0,16,16,8,80,48,
                            {[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
                            {{[],[],[],[],[],[],[],[],[],[],[],[],...}}},
          undefined}
   
    (riaktest@127.0.0.1)3> C:put(O0, 1).
-
     
     Now, read the list back from the Riak server and extract the value
 
-  (riaktest@127.0.0.1)4> {ok, O1} = C:get("groceries", "mine", 1).
-  {ok,{r_object,"groceries","mine",
+
+  (riaktest@127.0.0.1)4> {ok, O1} = C:get(<<"groceries">>, <<"mine">>, 1).
+  {ok,{r_object,<<"groceries">>,<<"mine">>,
             [{r_content,{dict,2,16,16,8,80,48,
                               {[],[],[],[],[],[],[],[],[],[],[],[],...},
                               {{[],[],[],[],[],[],
    (riaktest@127.0.0.1)5> V = riak_object:get_value(O1).
    ["bread"]
 
+     Add milk to our list of groceries and write the new value to Riak:
 
-     Add milk to our list of groceries and write the new value to Riak:
 
   (riaktest@127.0.0.1)6> %% add milk to the list
   (riaktest@127.0.0.1)6> O2 = riak_object:update_value(O1, ["milk" | V]).
-  {r_object,"groceries","mine",
+  {r_object,<<"groceries">>,<<"mine">>,
        [{r_content,{dict,2,16,16,8,80,48,
                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
                          {{[],[],[],[],[],[],
   (riaktest@127.0.0.1)7> C:put(O2, 1).
   ok
 
-
      Finally, see what other keys are available in groceries bucket:
 
-  (riaktest@127.0.0.1)8> C:list_keys("groceries").
-  {ok,["mine"]}
 
+  (riaktest@127.0.0.1)8> C:list_keys(<<"groceries">>).
+  {ok,[<<"mine">>]}
 
 
 3 Server Management 
 
     To join a new Riak node to an existing cluster:
 
+
   $ bin/riak start # If a local server is not already running
   $ bin/riak-admin join <node in cluster>
 
-
     (Note that you must have a local node already running for this to work)
     
     To verify that the local Riak node is able to read/write data:
   * LICENSE: the license under which Riak is released
   * apps/    the source tree for Riak and all its dependencies
   * doc/
+    - admin.org: Riak Administration Guide
+    - architecture.txt: details about the underlying design of Riak
+    - basic-client.txt: slightly more detail on using Riak
     - basic-setup.txt:  slightly more detail on setting up Riak
-    - basic-client.txt: slightly more detail on using Riak
-    - architecture.txt: details about the underlying design of Riak
-    - index.html:       the root of the edoc output of 'make docs'
+    - basic-mapreduce.txt: introduction to map/reduce on Riak
+    - js-mapreduce.org: using Javascript with Riak map/reduce
+    - man/riak.1.gz: manual page for the riak(1) command
+    - man/riak-admin.1.gz manual page for the riak-admin(1) command
+    - raw-http-howto.txt: using the Riak HTTP interface
+
 
 
 * Quick Start

apps/riak/src/raw_http_resource.erl

 content_types_provided(RD, Ctx=#ctx{key=undefined}) ->
     %% bucket-level: JSON description only
     {[{"application/json", produce_bucket_body}], RD, Ctx};
+content_types_provided(RD, Ctx=#ctx{method=Method}=Ctx) when Method =:= 'PUT';
+                                                             Method =:= 'POST' ->
+    {ContentType, _} = extract_content_type(RD),
+    {[{ContentType, produce_doc_body}], RD, Ctx};
 content_types_provided(RD, Ctx0) ->
     DocCtx = ensure_doc(Ctx0),
     case DocCtx#ctx.doc of

client_lib/jquery/jquery.json-2.2.js

-/*
- * jQuery JSON Plugin
- * version: 2.1 (2009-08-14)
- *
- * This document is licensed as free software under the terms of the
- * MIT License: http://www.opensource.org/licenses/mit-license.php
- *
- * Brantley Harris wrote this plugin. It is based somewhat on the JSON.org
- * website's http://www.json.org/json2.js, which proclaims:
- * "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
- * I uphold.
- *
- * It is also influenced heavily by MochiKit's serializeJSON, which is
- * copyrighted 2005 by Bob Ippolito.
- */
-
-(function($) {
-    /** jQuery.toJSON( json-serializble )
-        Converts the given argument into a JSON respresentation.
-
-        If an object has a "toJSON" function, that will be used to get the representation.
-        Non-integer/string keys are skipped in the object, as are keys that point to a function.
-
-        json-serializble:
-            The *thing* to be converted.
-     **/
-    $.toJSON = function(o)
-    {
-        if (typeof(JSON) == 'object' && JSON.stringify)
-            return JSON.stringify(o);
-
-        var type = typeof(o);
-
-        if (o === null)
-            return "null";
-
-        if (type == "undefined")
-            return undefined;
-
-        if (type == "number" || type == "boolean")
-            return o + "";
-
-        if (type == "string")
-            return $.quoteString(o);
-
-        if (type == 'object')
-        {
-            if (typeof o.toJSON == "function")
-                return $.toJSON( o.toJSON() );
-
-            if (o.constructor === Date)
-            {
-                var month = o.getUTCMonth() + 1;
-                if (month < 10) month = '0' + month;
-
-                var day = o.getUTCDate();
-                if (day < 10) day = '0' + day;
-
-                var year = o.getUTCFullYear();
-
-                var hours = o.getUTCHours();
-                if (hours < 10) hours = '0' + hours;
-
-                var minutes = o.getUTCMinutes();
-                if (minutes < 10) minutes = '0' + minutes;
-
-                var seconds = o.getUTCSeconds();
-                if (seconds < 10) seconds = '0' + seconds;
-
-                var milli = o.getUTCMilliseconds();
-                if (milli < 100) milli = '0' + milli;
-                if (milli < 10) milli = '0' + milli;
-
-                return '"' + year + '-' + month + '-' + day + 'T' +
-                             hours + ':' + minutes + ':' + seconds +
-                             '.' + milli + 'Z"';
-            }
-
-            if (o.constructor === Array)
-            {
-                var ret = [];
-                for (var i = 0; i < o.length; i++)
-                    ret.push( $.toJSON(o[i]) || "null" );
-
-                return "[" + ret.join(",") + "]";
-            }
-
-            var pairs = [];
-            for (var k in o) {
-                var name;
-                var type = typeof k;
-
-                if (type == "number")
-                    name = '"' + k + '"';
-                else if (type == "string")
-                    name = $.quoteString(k);
-                else
-                    continue;  //skip non-string or number keys
-
-                if (typeof o[k] == "function")
-                    continue;  //skip pairs where the value is a function.
-
-                var val = $.toJSON(o[k]);
-
-                pairs.push(name + ":" + val);
-            }
-
-            return "{" + pairs.join(", ") + "}";
-        }
-    };
-
-    /** jQuery.evalJSON(src)
-        Evaluates a given piece of json source.
-     **/
-    $.evalJSON = function(src)
-    {
-        if (typeof(JSON) == 'object' && JSON.parse)
-            return JSON.parse(src);
-        return eval("(" + src + ")");
-    };
-
-    /** jQuery.secureEvalJSON(src)
-        Evals JSON in a way that is *more* secure.
-    **/
-    $.secureEvalJSON = function(src)
-    {
-        if (typeof(JSON) == 'object' && JSON.parse)
-            return JSON.parse(src);
-
-        var filtered = src;
-        filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@');
-        filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
-        filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
-
-        if (/^[\],:{}\s]*$/.test(filtered))
-            return eval("(" + src + ")");
-        else
-            throw new SyntaxError("Error parsing JSON, source is not valid.");
-    };
-
-    /** jQuery.quoteString(string)
-        Returns a string-repr of a string, escaping quotes intelligently.
-        Mostly a support function for toJSON.
-
-        Examples:
-            >>> jQuery.quoteString("apple")
-            "apple"
-
-            >>> jQuery.quoteString('"Where are we going?", she asked.')
-            "\"Where are we going?\", she asked."
-     **/
-    $.quoteString = function(string)
-    {
-        if (string.match(_escapeable))
-        {
-            return '"' + string.replace(_escapeable, function (a)
-            {
-                var c = _meta[a];
-                if (typeof c === 'string') return c;
-                c = a.charCodeAt();
-                return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
-            }) + '"';
-        }
-        return '"' + string + '"';
-    };
-
-    var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;
-
-    var _meta = {
-        '\b': '\\b',
-        '\t': '\\t',
-        '\n': '\\n',
-        '\f': '\\f',
-        '\r': '\\r',
-        '"' : '\\"',
-        '\\': '\\\\'
-    };
-})(jQuery);

client_lib/jquery/jquery.riak.js

-(function($) {
-
-  $.riakGetBucketProps = function(bucket, options) {
-    var settings = $.extend({contentType: "application/json",
-	  success: riakSuccessHandler}),
-    settings["url"] = "/raw/" + bucket;
-    settings["type"] = "GET";
-    $.ajax(settings);
-  }
-
-  $.riakGetResource = function(bucket, key, options) {
-    var settings = $.extend({ifModified: true,
-	  cache: true,
-	  success: riakSuccessHandler}, options || {});
-    settings["url"] = "/raw/" + bucket + "/" + key;
-    settings["type"] = "GET";
-    $.ajax(settings);
-  };
-
-  $.riakPutResource = function(bucket, key, value, options) {
-    var settings = $.extend({contentType: "application/json",
-	  success: riakSuccessHandler}, options || {});
-    settings["url"] = "/raw/" + bucket + "/" + key;
-    settings["data"] = value;
-    settings["type"] = "PUT";
-    $.ajax(settings);
-  };
-
-  $.riakDeleteResource = function(bucket, key, options) {
-    var settings = $.extend({success: riakSuccessHandler}, options || {});
-    settings["url"] = "/raw/" + bucket + "/" + key;
-    settings["type"] = "DELETE";
-    $.ajax(settings);
-
-  };
-
-  $.riakMapReduce = function(targets, phases, options) {
-    query = {inputs: targets,
-	     query: buildQuery(phases)};
-    var settings = $.extend({success: riakSuccessHandler}, options || {});
-    settings["url"] = "/mapred";
-    settings["type"] = "POST";
-    settings["contentType"] = "application/json";
-    settings["dataType"] = "json";
-    settings["data"] = $.toJSON(query);
-    $.ajax(settings);
-  };
-
-  var riakSuccessHandler = function(data, status) { };
-
-  function buildQuery(phases) {
-    return phases.map(function(phase) { return buildPhase(phase); }, phases);
-  }
-
-  function buildPhase(phase) {
-    var handler = null;
-    var keepResults = phase["keep"] === true;
-
-    if (phase["map"] !== undefined) {
-      return {map: {language: "javascript", source: phase["map"].toString(), keep: keepResults}};
-    }
-    else if (phase["reduce"] !== undefined) {
-      return {reduce: {language: "javascript", source: phase["reduce"].toString(), keep: keepResults}};
-    }
-    else if (phase["link"] !== undefined) {
-      return {link: {language: "javascript", source: phase["reduce"].toString(), keep: keepResults}};
-    }
-    else {
-      throw("Illegal phase definition");
-    }
-  }
- })(jQuery);
   platforms supporting [[http://erlang.org/][Erlang]] releases R13B03 and later.
 
 ** Binary Releases
-*** TODO where do binary releases come from?
-*** TODO List of OS packages
+*** Overview
+
+    Riak can be downloaded in a binary form negating the need to 
+    to install the latest Erlang and compile from source. The binary
+    distribution of Riak doesn't include innostore. Innostore must
+    be compiled and installed manually. You can find out more about
+    innostore at http://hg.basho.com/innostore/.
+
+    Currently Riak is offered in binary form for rpm and deb based
+    Linux systems.
+
+*** RPM Based Linux Distributions
+    
+    Riak can be installed in binary form on many RPM based systems,
+    the current target platforms are RHEL and Centos. Riak can be
+    download in both 64bit and 32bit binaries in rpm format here:
+    32bit: http://downloads.basho.com/riak-0.9.0-1.i386.rpm
+    64bit: http://downloads.basho.com/riak-0.9.0-1.x86_64.rpm
+    
+    Note: On 32bit systems you may need to disable SE Linux if 
+    it is enabled.
+
+*** Deb Based Linux Distributions
+
+   Riak can be installed in binary form on many systems that use the
+   Debian packaging system, the current target platforms are
+   Ubuntu and Debian.  Riak can be download in both 64bit and 32bit
+   binaries in deb format here:
+   32bit: http://downloads.basho.com/riak_0.9.0-1_i386.deb
+   64bit: http://downloads.basho.com/riak_0.9.0-1_amd64.deb
 
 ** Source Releases
 *** Prerequisites

doc/man/man1/riak-admin.1.gz

Binary file added.

doc/man/man1/riak.1.gz

Binary file added.