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 d672352
Date Wed, 22 Feb 2017 16:06:32 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/d6723527
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/d6723527
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/d6723527

Branch: refs/heads/COUCHDB-3287-pluggable-storage-engines
Commit: d67235278cd7abb451501ae32a098da01857e965
Parents: 27cadc5
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: Wed Feb 22 10:06:13 2017 -0600

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


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/d6723527/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 9311837..738cfe4 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