You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/07/21 15:17:03 UTC

mem3 commit: updated refs/heads/master to a8cf4df

Repository: couchdb-mem3
Updated Branches:
  refs/heads/master fb5f56c21 -> a8cf4dff1


Use dynamic http handlers

We use dynamic http handlers for:

  - `_membership`
  - `_shards`


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/a8cf4dff
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/a8cf4dff
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/a8cf4dff

Branch: refs/heads/master
Commit: a8cf4dff133ecf4421eb585141f6fe347dbf9be2
Parents: fb5f56c
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Wed Jul 15 08:37:47 2015 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Fri Jul 17 10:23:34 2015 -0700

----------------------------------------------------------------------
 src/mem3.app.src            |  1 +
 src/mem3_httpd_handlers.erl | 23 +++++++++++++++++++++++
 src/mem3_sup.erl            |  3 ++-
 3 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/a8cf4dff/src/mem3.app.src
----------------------------------------------------------------------
diff --git a/src/mem3.app.src b/src/mem3.app.src
index 87eda0d..99a9eed 100644
--- a/src/mem3.app.src
+++ b/src/mem3.app.src
@@ -43,6 +43,7 @@
         sasl,
         crypto,
         mochiweb,
+        couch_epi,
         couch,
         rexi,
         couch_log,

http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/a8cf4dff/src/mem3_httpd_handlers.erl
----------------------------------------------------------------------
diff --git a/src/mem3_httpd_handlers.erl b/src/mem3_httpd_handlers.erl
new file mode 100644
index 0000000..d8e138c
--- /dev/null
+++ b/src/mem3_httpd_handlers.erl
@@ -0,0 +1,23 @@
+% Licensed 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.
+
+-module(mem3_httpd_handlers).
+
+-export([url_handler/1, db_handler/1, design_handler/1]).
+
+url_handler(<<"_membership">>) -> fun mem3_httpd:handle_membership_req/1;
+url_handler(_) -> no_match.
+
+db_handler(<<"_shards">>) -> fun mem3_httpd:handle_shards_req/2;
+db_handler(_) -> no_match.
+
+design_handler(_) -> no_match.

http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/a8cf4dff/src/mem3_sup.erl
----------------------------------------------------------------------
diff --git a/src/mem3_sup.erl b/src/mem3_sup.erl
index 6ff688b..915bee4 100644
--- a/src/mem3_sup.erl
+++ b/src/mem3_sup.erl
@@ -23,7 +23,8 @@ init(_Args) ->
         child(mem3_nodes),
         child(mem3_sync_nodes), % Order important?
         child(mem3_sync),
-        child(mem3_shards)
+        child(mem3_shards),
+        chttpd_handlers:provider(mem3, mem3_httpd_handlers)
     ],
     {ok, {{one_for_one,10,1}, Children}}.