A note to indicate you can't run schema commands on the slave
Merge pull request #3346 from mneedham/no-schema-on-slave

A note to indicate you can't run schema commands on the slave
Fixed issue with cancelling long running queries in server.

JsonGenerators were not properly closed in finally blocks which lead to
malformed json when queries were cancelled by the user.
Merge pull request #3385 from pontusmelke/malformed-json

Fixed issue with cancelling long running queries in server.
Merge remote-tracking branch 'upstream/2.0-maint' into 2.1-maint
Merge remote-tracking branch 'upstream/2.1-maint'

Conflicts:
	community/server/pom.xml
	pom.xml
Fixed broken pom.xml
Fix a bug where the stores did not properly check for consistent page cache reads.

* This fixes a bug where "Record not in use" exceptions could pop out of the various stores seemingly at random.
* Also removes the reliance on exceptions for control flow when asserting that records likely exists in the stores.
* Also makes the PageCacheRule automatically inject inconsistent reads by default.
* And makes the header read in KeyValueStore use a shared_lock
Merge pull request #3344 from chrisvest/2.2-inconsistent-reads

Make sure we only do the record-in-use check on consistent reads
Expose a way to ask a lucene index to sample index selectivity

o Scan a sample of index entries and compute uniqueSampledValues / sampleSize
Add a new CountsKey for index entry counts
Maintain index update counts from index proxies

o OnlineIndexProxy will ensure that the index counts are updated
o Fix bug when generate LazyIndexUpdates to never construct 'overlapping updates'
o Cleanup code in LazyIndexUpdates
o Make sure we update index update counts during population
Add minor version to CountsStore such that we can flush safely on index flip (outside of log rotation)

o Ensure we compare CountsKeys correctly by type
o Fix reading of index keys
o Add flushIndexCounts() to IndexStoreView
Remove index counts when dropping an index
Make index stats part of SchemaRead and add indexNumberOfEntries

Rationale: For planning to be sane, indices shouldn't appear or disappear out of nowhere, hence we need to be tied to the schema read lock
Add IndexStatisticsTest
Pass on transaction id to index updaters
Pull out and refactor IndexCountVisitor from CountingIndexUpdater
Only apply index count updates for unprocessed transactions during recovery

o Rename updateXYZ to incrementXYZ CountsStore related methods
o Push transactionId down to IndexUpdaters (and couple them to process only updates for a single transaction)
Replace use of LongRegister with DoubleLongRegister in counts store