Commits

Anonymous committed 3d743f8

fix rebar.config

Comments (0)

Files changed (5)

apps/riak_core/ebin/riak_core.app

-%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
-%% ex: ts=4 sw=4 et
-{application, riak_core,
- [
-  {description, "Riak Core"},
-  {vsn, "0.12.1"},
-  {modules, [
-             app_helper,
-             bloom,
-             chash,
-             gen_nb_server,
-             gen_server2,
-             json_pp,
-             merkerl,
-             priority_queue,
-             process_proxy,
-             riak_core,
-             riak_core_apl,
-             riak_core_app,
-             riak_core_bucket,
-             riak_core_claim,
-             riak_core_gossip,
-             riak_core_handoff_listener,
-             riak_core_handoff_manager,
-             riak_core_handoff_receiver,
-             riak_core_handoff_sender,
-             riak_core_node_watcher,
-             riak_core_node_watcher_events,
-             riak_core_pb,
-             riak_core_ring,
-             riak_core_ring_events,
-             riak_core_ring_handler,
-             riak_core_ring_manager,
-             riak_core_sup,
-             riak_core_test_util,
-             riak_core_util,
-             riak_core_vnode,
-             riak_core_vnode_master,
-             riak_core_vnode_sup,
-             riak_core_web,
-             slide,
-             spiraltime,
-             vclock
-            ]},
-  {registered, []},
-  {applications, [
-                  kernel,
-                  stdlib,
-                  sasl,
-                  crypto,
-                  webmachine
-                 ]},
-  {mod, { riak_core_app, []}},
-  {env, [
-         %% Cluster name
-         {cluster_name, "default"},
-
-         %% Default location of ringstate
-         {ring_state_dir, "data/ring"},
-
-         %% Default ring creation size.  Make sure it is a power of 2,
-         %% e.g. 16, 32, 64, 128, 256, 512 etc
-         {ring_creation_size, 64},
-
-         %% Default gossip interval (milliseconds)
-         {gossip_interval, 60000},
-
-         %% Target N value
-         {target_n_val, 4},
-
-         %% Default claims functions
-         {wants_claim_fun, {riak_core_claim, default_wants_claim}},
-         {choose_claim_fun, {riak_core_claim, default_choose_claim}},
-
-         %% Default bucket props
-         {default_bucket_props, [{n_val,3},
-                                 {allow_mult,false},
-                                 {last_write_wins,false},
-                                 {precommit, []},
-                                 {postcommit, []},
-                                 {chash_keyfun, {riak_core_util, chash_std_keyfun}}]},
-
-         %% Number of VNodes allowed to do handoff concurrently.
-         {handoff_concurrency, 4},
-
-         %% Handoff IP/port
-         {handoff_port, 8099},
-         {handoff_ip, "0.0.0.0"}
-        ]}
- ]}.

apps/riak_kv/ebin/riak_kv.app

-%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
-%% ex: ts=4 sw=4 et
-{application, riak_kv,
- [
-  {description, "Riak Key/Value Store"},
-  {vsn, "0.12.1"},
-  {modules, [
-             raw_link_walker,
-             riak,
-             riak_client,
-             riak_kv_app,
-             riak_kv_backup,
-             riak_kv_backend,
-             riak_kv_bitcask_backend,
-             riak_kv_cache_backend,
-             riak_kv_console,
-             riak_kv_delete,
-             riak_kv_dets_backend,
-             riak_kv_ets_backend,
-             riak_kv_fs_backend,
-             riak_kv_gb_trees_backend,
-             riak_kv_get_fsm,
-             riak_kv_js_manager,
-             riak_kv_js_sup,
-             riak_kv_js_vm,
-             riak_kv_keys_fsm,
-             riak_kv_legacy_vnode,
-             riak_kv_map_executor,
-             riak_kv_map_localphase,
-             riak_kv_map_phase,
-             riak_kv_mapred_json,
-             riak_kv_mapred_query,
-             riak_kv_mapred_term,
-             riak_kv_mapreduce,
-             riak_kv_multi_backend,
-             riak_kv_pb_listener,
-             riak_kv_pb_socket,
-             riak_kv_pb_socket_sup,
-             riak_kv_phase_proto,
-             riak_kv_put_fsm,
-             riak_kv_reduce_phase,
-             riak_kv_stat,
-             riak_kv_sup,
-             riak_kv_test_util,
-             riak_kv_util,
-             riak_kv_vnode,
-             riak_kv_web,
-             riak_kv_wm_link_walker,
-             riak_kv_wm_mapred,
-             riak_kv_wm_ping,
-             riak_kv_wm_raw,
-             riak_kv_wm_stats,
-             riak_object
-            ]},
-  {applications, [
-                  kernel,
-                  stdlib,
-                  sasl,
-                  crypto,
-                  riak_core,
-                  luke,
-                  erlang_js,
-                  bitcask,
-                  mochiweb,
-                  webmachine,
-                  os_mon
-                 ]},
-  {registered, []},
-  {mod, {riak_kv_app, []}},
-  {env, [
-         %% Endpoint for system stats HTTP provider
-         {stats_urlpath, "stats"},
-
-         %% Secondary code paths
-         {add_paths, []}
-        ]}
- ]}.

apps/riak_kv/src/riak_kv_wm_mapred.erl

-%% -------------------------------------------------------------------
-%%
-%% mapred_resource: webmachine resource for mapreduce requests
-%%
-%% Copyright (c) 2007-2010 Basho Technologies, Inc.  All Rights Reserved.
-%%
-%% This file is provided to you under the Apache License,
-%% Version 2.0 (the "License"); you may not use this file
-%% except in compliance with the License.  You may obtain
-%% a copy of the License at
-%%
-%%   http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing,
-%% software distributed under the License is distributed on an
-%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-%% KIND, either express or implied.  See the License for the
-%% specific language governing permissions and limitations
-%% under the License.
-%%
-%% -------------------------------------------------------------------
-
-%% @doc webmachine resource for mapreduce requests
-
--module(riak_kv_wm_mapred).
-
--export([init/1, service_available/2, allowed_methods/2]).
--export([malformed_request/2, process_post/2, content_types_provided/2]).
--export([nop/2]).
-
--include_lib("webmachine/include/webmachine.hrl").
-
--define(DEFAULT_TIMEOUT, 60000).
-
-
--record(state, {client, inputs, timeout, mrquery, boundary}).
-
-init(_) ->
-    {ok, undefined}.
-
-service_available(RD, State) ->
-    case riak:local_client() of
-        {ok, Client} ->
-            {true, RD, #state{client=Client}};
-        Error ->
-            error_logger:error_report(Error),
-            {false, RD, State}
-    end.
-
-allowed_methods(RD, State) ->
-    {['GET','HEAD','POST'], RD, State}.
-
-malformed_request(RD, State) ->
-    {Verified, Message, NewState} =
-        case {wrq:method(RD), wrq:req_body(RD)} of
-            {'POST', Body} when Body /= undefined ->
-                verify_body(Body, State);
-            _ ->
-                {false, usage(), State}
-        end,
-    {not Verified,
-     if Verified -> RD;
-        true ->
-             wrq:set_resp_header(
-               "Content-Type", "text/plain",
-               wrq:set_resp_body(Message, RD))
-     end,
-     NewState}.
-
-content_types_provided(RD, State) ->
-    {[{"application/json", nop}], RD, State}.
-
-nop(RD, State) ->
-    {usage(), RD, State}.
-
-process_post(RD, #state{inputs=Inputs, mrquery=Query, timeout=Timeout}=State) ->
-    Me = self(),
-    {ok, Client} = riak:local_client(),
-    case wrq:get_qs_value("chunked", RD) of
-        "true" ->
-            {ok, ReqId} =
-                if is_list(Inputs) ->
-                        {ok, {RId, FSM}} = Client:mapred_stream(Query, Me,
-                                                                fun riak_kv_mapred_json:jsonify_not_found/1,
-                                                                Timeout),
-                        luke_flow:add_inputs(FSM, Inputs),
-                        luke_flow:finish_inputs(FSM),
-                        {ok, RId};
-                   is_binary(Inputs) ->
-                        Client:mapred_bucket_stream(Inputs, Query, Me,
-                                                    Timeout)
-                end,
-            Boundary = riak_core_util:unique_id_62(),
-            RD1 = wrq:set_resp_header("Content-Type", "multipart/mixed;boundary=" ++ Boundary, RD),
-            State1 = State#state{boundary=Boundary},
-            {true, wrq:set_resp_body({stream, stream_mapred_results(RD1, ReqId, State1)}, RD1), State1};
-        Param when Param =:= "false";
-                   Param =:= undefined ->
-            Results = if is_list(Inputs) ->
-                              Client:mapred(Inputs, Query,
-                                            fun riak_kv_mapred_json:jsonify_not_found/1,
-                                            Timeout);
-                         is_binary(Inputs) ->
-                              Client:mapred_bucket(Inputs, Query, fun riak_kv_mapred_json:jsonify_not_found/1,
-                                                   Timeout)
-                      end,
-            RD1 = wrq:set_resp_header("Content-Type", "application/json", RD),
-            case Results of
-                "all nodes failed" ->
-                    {{halt, 500}, wrq:set_resp_body("All nodes failed", RD), State};
-                {error, _} ->
-                    {{halt, 500}, send_error(Results, RD1), State};
-                {ok, Result} ->
-                    {true, wrq:set_resp_body(mochijson2:encode(Result), RD1), State}
-            end
-    end.
-
-%% Internal functions
-send_error(Error, RD)  ->
-    wrq:set_resp_body(format_error(Error), RD).
-
-format_error({error, Message}=Error) when is_atom(Message);
-                                          is_binary(Message) ->
-    mochijson2:encode({struct, [Error]});
-format_error({error, Error}) when is_list(Error) ->
-    mochijson2:encode({struct, Error});
-format_error(_Error) ->
-    mochijson2:encode({struct, [{error, map_reduce_error}]}).
-
-stream_mapred_results(RD, ReqId, #state{timeout=Timeout}=State) ->
-    FinalTimeout = erlang:trunc(Timeout * 1.02),
-    receive
-        {flow_results, ReqId, done} -> {iolist_to_binary(["\r\n--", State#state.boundary, "--\r\n"]), done};
-        {flow_results, ReqId, {error, Error}} ->
-            {format_error(Error), done};
-        {flow_error, ReqId, Error} ->
-            {format_error({error, Error}), done};
-        {flow_results, PhaseId, ReqId, Res} ->
-            Data = mochijson2:encode({struct, [{phase, PhaseId}, {data, Res}]}),
-            Body = ["\r\n--", State#state.boundary, "\r\n",
-                    "Content-Type: application/json\r\n\r\n",
-                    Data],
-            {iolist_to_binary(Body), fun() -> stream_mapred_results(RD, ReqId, State) end}
-    after FinalTimeout ->
-            {format_error({error, timeout}), done}
-    end.
-
-verify_body(Body, State) ->
-    case riak_kv_mapred_json:parse_request(Body) of
-        {ok, ParsedInputs, ParsedQuery, Timeout} ->
-            {true, [], State#state{inputs=ParsedInputs,
-                                   mrquery=ParsedQuery,
-                                   timeout=Timeout}};
-        {error, {'query', Message}} ->
-            {false, ["An error occurred parsing the \"query\" field.\n",
-                     Message], State};
-        {error, {inputs, Message}} ->
-            {false, ["An error occurred parsing the \"inputs\" field.\n",
-                     Message], State};
-        {error, missing_field} ->
-            {false, "The post body was missing the "
-             "\"inputs\" or \"query\" field.\n", State};
-        {error, {invalid_json, Message}} ->
-            {false,
-             io_lib:format("The POST body was not valid JSON.~n"
-                           "The error from the parser was:~n~p~n",
-                           [Message]),
-             State};
-        {error, not_json} ->
-            {false, "The POST body was not a JSON object.\n", State}
-    end.
-
-usage() ->
-    "This resource accepts POSTs with bodies containing JSON of the form:\n"
-        "{\n"
-        " \"inputs\":[...list of inputs...],\n"
-        " \"query\":[...list of map/reduce phases...]\n"
-        "}\n".
 {erl_opts, [debug_info, fail_on_warning]}.
 
 {deps, [
-        {erlang_js, "0\.4", {hg, "http://bitbucket.org/basho/erlang_js",
-                             "erlang_js-0.4"}},
-        {mochiweb, "1.7.1", {hg, "http://bitbucket.org/basho/mochiweb",
-                            "mochiweb-1.7.1"}},
-        {webmachine, "1.7.1", {hg, "http://bitbucket.org/basho/webmachine",
-                               "webmachine-1.7.1"}},
-        {riakc, "0.2.0", {hg, "http://bitbucket.org/basho/riak-erlang-client",
-                          "65"}},
-        {bitcask, "1.0.3", {hg, "http://bitbucket.org/basho/bitcask",
-                            "bitcask-1.0.3"}},
-        {ebloom, "1.0.1", {hg, "http://bitbucket.org/basho/ebloom",
-                       "ebloom-1.0.1"}}
+       {riak_kv, "0.12.0", {hg, "http://bitbucket.org/basho/riak_kv", "tip"}}
        ]}.

rel/reltool.config

 %% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
 %% ex: ts=4 sw=4 et
 {sys, [
-       {lib_dirs, ["../deps",
-                   "../apps"]},
+       {lib_dirs, ["../deps"]},
        {rel, "riak", "0.12.1",
         [
          kernel,