diff options
author | Adam Kocoloski <adam@cloudant.com> | 2010-09-06 18:10:16 -0700 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2010-09-06 22:36:45 -0700 |
commit | b8b2a9de28f4e74864f69e7681088d871e71820f (patch) | |
tree | 00f2a686de5b17f52b6004f6b3fb17073073680e /apps/fabric | |
parent | a55c40ce30d5279df93b5c475cc6718575a1e192 (diff) |
support for filtered _changes on multi-node clusters, closes #5
Diffstat (limited to 'apps/fabric')
-rw-r--r-- | apps/fabric/src/fabric_rpc.erl | 4 | ||||
-rw-r--r-- | apps/fabric/src/fabric_view_changes.erl | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/apps/fabric/src/fabric_rpc.erl b/apps/fabric/src/fabric_rpc.erl index 301fd46b..a7d555e0 100644 --- a/apps/fabric/src/fabric_rpc.erl +++ b/apps/fabric/src/fabric_rpc.erl @@ -338,10 +338,10 @@ send(Key, Value, #view_acc{limit=Limit} = Acc) -> end. changes_enumerator(DocInfo, {Db, _Seq, Args}) -> - #changes_args{include_docs=IncludeDocs, filter=FilterFun} = Args, + #changes_args{include_docs=IncludeDocs, filter=Acc} = Args, #doc_info{id=Id, high_seq=Seq, revs=[#rev_info{deleted=Del,rev=Rev}|_]} = DocInfo, - case [Result || Result <- FilterFun(DocInfo), Result /= null] of + case [X || X <- couch_changes:filter(DocInfo, Acc), X /= null] of [] -> {ok, {Db, Seq, Args}}; Results -> diff --git a/apps/fabric/src/fabric_view_changes.erl b/apps/fabric/src/fabric_view_changes.erl index 63ffc02a..a4421a92 100644 --- a/apps/fabric/src/fabric_view_changes.erl +++ b/apps/fabric/src/fabric_view_changes.erl @@ -182,10 +182,8 @@ handle_message({complete, EndSeq}, Worker, State) -> end end. -make_changes_args(#changes_args{style=main_only, filter=undefined}=Args) -> - Args#changes_args{filter = fun couch_changes:main_only_filter/1}; -make_changes_args(#changes_args{style=all_docs, filter=undefined}=Args) -> - Args#changes_args{filter = fun couch_changes:all_docs_filter/1}; +make_changes_args(#changes_args{style=Style, filter=undefined}=Args) -> + Args#changes_args{filter = Style}; make_changes_args(Args) -> Args. |