You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/05/12 21:55:24 UTC
[1/2] couch-index commit: updated refs/heads/master to e15bed8
Repository: couchdb-couch-index
Updated Branches:
refs/heads/master 0c5f25b1c -> e15bed80e
Return pending_updates field from couch_index:get_info/1
COUCHDB-2526
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/commit/0905e9cc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/tree/0905e9cc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/diff/0905e9cc
Branch: refs/heads/master
Commit: 0905e9ccf9c3efa4a13aa7e45973fdb50c37e356
Parents: eb61626
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Mon Dec 22 14:04:44 2014 -0800
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Mon Dec 22 14:04:44 2014 -0800
----------------------------------------------------------------------
src/couch_index.erl | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/0905e9cc/src/couch_index.erl
----------------------------------------------------------------------
diff --git a/src/couch_index.erl b/src/couch_index.erl
index b44d351..eae5f70 100644
--- a/src/couch_index.erl
+++ b/src/couch_index.erl
@@ -157,14 +157,20 @@ handle_call({get_state, ReqSeq}, From, State) ->
end;
handle_call(get_info, _From, State) ->
#st{mod=Mod} = State,
- {ok, Info0} = Mod:get(info, State#st.idx_state),
+ IdxState = State#st.idx_state,
+ {ok, Info0} = Mod:get(info, IdxState),
IsUpdating = couch_index_updater:is_running(State#st.updater),
IsCompacting = couch_index_compactor:is_running(State#st.compactor),
+ IdxSeq = Mod:get(update_seq, IdxState),
+ GetCommSeq = fun(Db) -> couch_db:get_committed_update_seq(Db) end,
+ DbName = Mod:get(db_name, IdxState),
+ CommittedSeq = couch_util:with_db(DbName, GetCommSeq),
Info = Info0 ++ [
{updater_running, IsUpdating},
{compact_running, IsCompacting},
{waiting_commit, State#st.committed == false},
- {waiting_clients, length(State#st.waiters)}
+ {waiting_clients, length(State#st.waiters)},
+ {pending_updates, max(CommittedSeq - IdxSeq, 0)}
],
{reply, {ok, Info}, State};
handle_call(reset, _From, State) ->
[2/2] couch-index commit: updated refs/heads/master to e15bed8
Posted by kx...@apache.org.
Merge remote-tracking branch 'iilyak/2526-pending-updates-info'
This closes #3
COUCHDB-2526
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/commit/e15bed80
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/tree/e15bed80
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/diff/e15bed80
Branch: refs/heads/master
Commit: e15bed80e21e573c05945c23908dc0c7194ef8e9
Parents: 0c5f25b 0905e9c
Author: Alexander Shorin <kx...@apache.org>
Authored: Tue May 12 22:55:28 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue May 12 22:55:28 2015 +0300
----------------------------------------------------------------------
src/couch_index.erl | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/e15bed80/src/couch_index.erl
----------------------------------------------------------------------