couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject couch-mrview commit: updated refs/heads/windsor-merge to cd338d6
Date Sun, 17 Aug 2014 20:14:01 GMT
Repository: couchdb-couch-mrview
Updated Branches:
  refs/heads/windsor-merge d6b5884a1 -> cd338d60f


Add an API to see if the index file exists


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

Branch: refs/heads/windsor-merge
Commit: cd338d60f76a699e9f8e222f930ef8afd83fe11e
Parents: d6b5884
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Sun Aug 17 15:13:55 2014 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Sun Aug 17 15:13:55 2014 -0500

----------------------------------------------------------------------
 src/couch_mrview_index.erl | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/cd338d60/src/couch_mrview_index.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_index.erl b/src/couch_mrview_index.erl
index 108d74a..709a6a9 100644
--- a/src/couch_mrview_index.erl
+++ b/src/couch_mrview_index.erl
@@ -17,6 +17,7 @@
 -export([init/2, open/2, close/1, reset/1, delete/1]).
 -export([start_update/3, purge/4, process_doc/3, finish_update/1, commit/1]).
 -export([compact/3, swap_compacted/2]).
+-export([check_index_file/1]).
 
 -include_lib("couch/include/couch_db.hrl").
 -include_lib("couch_mrview/include/couch_mrview.hrl").
@@ -164,3 +165,11 @@ compact(Db, State, Opts) ->
 swap_compacted(OldState, NewState) ->
     couch_mrview_compactor:swap_compacted(OldState, NewState).
 
+
+check_index_file(State) ->
+    #mrst{
+        db_name=DbName,
+        sig=Sig
+    } = State,
+    IndexFName = couch_mrview_util:index_file(DbName, Sig),
+    filelib:is_file(IndexFName).


Mime
View raw message