couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch commit: updated refs/heads/master to 95b60be
Date Thu, 28 Aug 2014 22:55:05 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master 9d0ac7d34 -> 95b60be72


Use ioq to separately prioritise compaction requests


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

Branch: refs/heads/master
Commit: 95b60be72c271db1fc4317c9a1aa0a1537798fda
Parents: 9d0ac7d
Author: Robert Newson <rnewson@apache.org>
Authored: Thu Aug 28 23:45:34 2014 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 28 23:45:34 2014 +0100

----------------------------------------------------------------------
 src/couch.app.src        |  3 ++-
 src/couch_db_updater.erl |  2 ++
 src/couch_file.erl       | 14 +++++++-------
 3 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/95b60be7/src/couch.app.src
----------------------------------------------------------------------
diff --git a/src/couch.app.src b/src/couch.app.src
index ba12f41..a3a5e7d 100644
--- a/src/couch.app.src
+++ b/src/couch.app.src
@@ -44,6 +44,7 @@
         b64url,
         couch_log,
         couch_event,
-        couch_stats
+        couch_stats,
+        ioq
     ]}
 ]}.

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/95b60be7/src/couch_db_updater.erl
----------------------------------------------------------------------
diff --git a/src/couch_db_updater.erl b/src/couch_db_updater.erl
index d18463b..d8435a5 100644
--- a/src/couch_db_updater.erl
+++ b/src/couch_db_updater.erl
@@ -35,6 +35,7 @@
 }).
 
 init({DbName, Filepath, Fd, Options}) ->
+    erlang:put(io_class, compaction),
     case lists:member(create, Options) of
     true ->
         % create a new header and writes it to the file
@@ -1174,6 +1175,7 @@ copy_compact(Db, NewDb0, Retry) ->
 
 
 start_copy_compact(#db{}=Db) ->
+    erlang:put(io_class, compaction),
     #db{name=Name, filepath=Filepath, options=Options, header=Header} = Db,
     ?LOG_DEBUG("Compaction process spawned for db \"~s\"", [Name]),
 

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/95b60be7/src/couch_file.erl
----------------------------------------------------------------------
diff --git a/src/couch_file.erl b/src/couch_file.erl
index afb76a3..fe5aeee 100644
--- a/src/couch_file.erl
+++ b/src/couch_file.erl
@@ -118,14 +118,14 @@ append_term_md5(Fd, Term, Options) ->
 %%----------------------------------------------------------------------
 
 append_binary(Fd, Bin) ->
-    gen_server:call(Fd, {append_bin, assemble_file_chunk(Bin)}, infinity).
+    ioq:call(Fd, {append_bin, assemble_file_chunk(Bin)}).
     
 append_binary_md5(Fd, Bin) ->
-    gen_server:call(Fd,
-        {append_bin, assemble_file_chunk(Bin, couch_util:md5(Bin))}, infinity).
+    ioq:call(Fd,
+        {append_bin, assemble_file_chunk(Bin, couch_util:md5(Bin))}).
 
 append_raw_chunk(Fd, Chunk) ->
-    gen_server:call(Fd, {append_bin, Chunk}, infinity).
+    ioq:call(Fd, {append_bin, Chunk}).
 
 
 assemble_file_chunk(Bin) ->
@@ -160,7 +160,7 @@ pread_binary(Fd, Pos) ->
 
 
 pread_iolist(Fd, Pos) ->
-    case gen_server:call(Fd, {pread_iolist, Pos}, infinity) of
+    case ioq:call(Fd, {pread_iolist, Pos}) of
     {ok, IoList, <<>>} ->
         {ok, IoList};
     {ok, IoList, Md5} ->
@@ -266,7 +266,7 @@ init_delete_dir(RootDir) ->
 
 
 read_header(Fd) ->
-    case gen_server:call(Fd, find_header, infinity) of
+    case ioq:call(Fd, find_header) of
     {ok, Bin} ->
         {ok, binary_to_term(Bin)};
     Else ->
@@ -278,7 +278,7 @@ write_header(Fd, Data) ->
     Md5 = couch_util:md5(Bin),
     % now we assemble the final header binary and write to disk
     FinalBin = <<Md5/binary, Bin/binary>>,
-    gen_server:call(Fd, {write_header, FinalBin}, infinity).
+    ioq:call(Fd, {write_header, FinalBin}).
 
 
 init_status_error(ReturnPid, Ref, Error) ->


Mime
View raw message