couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [6/6] chttpd commit: updated refs/heads/COUCHDB-3287-pluggable-storage-engines to e70ca89
Date Tue, 04 Apr 2017 21:04:35 GMT
Support engine selection from the HTTP API

COUCHDB-3287


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

Branch: refs/heads/COUCHDB-3287-pluggable-storage-engines
Commit: e70ca89921f73522770f769b2a1e606fcae51eb0
Parents: 04d26cc
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Wed Apr 6 10:48:01 2016 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Tue Apr 4 16:04:16 2017 -0500

----------------------------------------------------------------------
 src/chttpd_db.erl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/e70ca899/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index aed649d..2fae58a 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -284,8 +284,15 @@ create_db_req(#httpd{}=Req, DbName) ->
     N = chttpd:qs_value(Req, "n", config:get("cluster", "n", "3")),
     Q = chttpd:qs_value(Req, "q", config:get("cluster", "q", "8")),
     P = chttpd:qs_value(Req, "placement", config:get("cluster", "placement")),
+    E = iolist_to_binary(chttpd:qs_value(Req, "engine", "couch")),
+    Options = [
+        {n, N},
+        {q, Q},
+        {placement, P},
+        {engine, E}
+    ],
     DocUrl = absolute_uri(Req, "/" ++ couch_util:url_encode(DbName)),
-    case fabric:create_db(DbName, [{n,N}, {q,Q}, {placement,P}]) of
+    case fabric:create_db(DbName, Options) of
     ok ->
         send_json(Req, 201, [{"Location", DocUrl}], {[{ok, true}]});
     accepted ->


Mime
View raw message