MB-8012 Accept purge-before option for compactor

Adds a {purge_before, Timestamp} option, where Timestamp is a unix
timestamp in seconds.

Change-Id: I5ee537dc04ddcd17dfd54d1f1095a84943e1c76a
Reviewed-on: http://review.couchbase.org/27428
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Aaron Miller <apage43@ninjawhale.com>
MB-8012: actually made purge_before work

"--purge-before" and it's arguments have to be separate arguments

Change-Id: I0b7a517b6fa2a72f4e79cdb75e6f71bbe008abc7
Reviewed-on: http://review.couchbase.org/27720
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-8689 Add support for Couchbase-style purging

This mimics the behaviour for Couchbase style purging, where the
purge sequence in the header matches the highest sequence of the
purged doc_info records. This is meant to be used only in couchdb
standalone unit tests.

Change-Id: Ic0f9c5090128016d479cb45f73cd23afcfb882bd
Reviewed-on: http://review.couchbase.org/27862
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-8689 Reset index on missed deletions after purge

Change-Id: Ib0996a87979c2f8f6c22c7a4d63738dc9a336cc0
Reviewed-on: http://review.couchbase.org/27863
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-8689 Add couch_set_view:does_group_misses_deletes/2

This function checks if a view group missed processing of any
deleted documents that got purged by database compaction. This
performs an estimation only, as a 'true' response really means
'maybe'. This is because after a database compaction with purging
enabled, it's impossible for a view group to know exactly which
deleted documents were purged.

Change-Id: Ib8f661a820a52203be8d66ca0da647048749acdd
Reviewed-on: http://review.couchbase.org/27864
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-8689 Add couch_set_view:group_indexed_document_ids/4

This function allows a caller to know the ID of all the documents
for which a view map function emmitted at least one Key-Value pair.

Change-Id: I95c9e0d33ed0f0626834ee85eb90cdfbc3c15624
Reviewed-on: http://review.couchbase.org/27865
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Replace tabs with spaces

Change-Id: I47613d06dc34d1bfd854d1fac2a9099cb07f20ca
Reviewed-on: http://review.couchbase.org/27890
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-8689 Increase test 27-database-purges.t coverage

Change-Id: I2596e8eed4956af2815d7f4d10f7a1cdd1d7a454
Reviewed-on: http://review.couchbase.org/27891
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Merge remote-tracking branch 'origin/2.1.1'

* origin/2.1.1:
  MB-8689 Increase test 27-database-purges.t coverage
  Replace tabs with spaces
  MB-8689 Add couch_set_view:group_indexed_document_ids/4
  MB-8689 Add couch_set_view:does_group_misses_deletes/2
  MB-8689 Reset index on missed deletions after purge
  MB-8689 Add support for Couchbase-style purging
  MB-8012: actually made purge_before work
  MB-8012 Accept purge-before option for compactor

Conflicts:
	src/couch_set_view/Makefile.am
	src/couch_set_view/src/couch_set_view.erl

Change-Id: Id5d089344c5710bb55b5877a6ae10926f1150b9f