summaryrefslogtreecommitdiff
path: root/src/couchdb/mod_couch.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-04-07 19:51:17 +0000
committerDamien F. Katz <damien@apache.org>2008-04-07 19:51:17 +0000
commit9c27e4d7db0e2e6a1b458f8545f584fcfaea4ef2 (patch)
tree94cf96af696ab3042d2afd1f4e4e7d83a98b1568 /src/couchdb/mod_couch.erl
parent4708e70c612a797b5d15774149ed589996d0c2e3 (diff)
Compaction. Works, but still needs queueing and better handling for long reads/writes overlapping the compaction switchover.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@645661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/mod_couch.erl')
-rw-r--r--src/couchdb/mod_couch.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/couchdb/mod_couch.erl b/src/couchdb/mod_couch.erl
index 8373dbe9..0d157b1e 100644
--- a/src/couchdb/mod_couch.erl
+++ b/src/couchdb/mod_couch.erl
@@ -195,6 +195,8 @@ do(#mod{method="POST"}=Mod, #uri_parts{db="_restart", doc=""}) ->
send_ok(Mod, 201);
do(#mod{method="POST"}=Mod, #uri_parts{doc="_missing_revs"}=Parts) ->
handle_missing_revs_request(Mod, Parts);
+do(#mod{method="POST"}=Mod, #uri_parts{doc="_compact"}=Parts) ->
+ handle_compact(Mod, Parts);
do(#mod{method="PUT"}=Mod, #uri_parts{doc=""}=Parts) ->
handle_db_create(Mod, Parts);
do(#mod{method="DELETE"}=Mod, #uri_parts{doc=""}=Parts) ->
@@ -487,6 +489,10 @@ handle_missing_revs_request(#mod{entity_body=RawJson}=Mod, Parts) ->
JsonResults = [{Id, list_to_tuple(Revs)} || {Id, Revs} <- Results],
send_json(Mod, 200, {obj, [{missing_revs, {obj, JsonResults}}]}).
+handle_compact(Mod, Parts) ->
+ ok = couch_db:start_compact(open_db(Parts)),
+ send_ok(Mod, 202).
+
handle_replication_request(#mod{entity_body=RawJson}=Mod) ->
{obj, Props} = cjson:decode(RawJson),
Src = proplists:get_value("source", Props),