TxManager used to commit/rollback transactions
Merge pull request #3295 from lutovich/2.0-lock-release-during-db-shutdown

[2.0] TxManager used to commit/rollback transactions
Merge commit '4d0c1e24d2c660891b656ec25405baf3d33677be' into merge-2.0-to-2.1

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/TopLevelTransaction.java
Merge pull request #3316 from lutovich/merge-2.0-to-2.1

Merge 2.0 to 2.1
Merge commit '96043202414032c491d3022f816296cbb3e1b064' into merge-2.1-to-master

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/TopLevelTransaction.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/TxManager.java
	community/shell/src/test/java/org/neo4j/shell/ShellDocTest.java
Merge pull request #3319 from lutovich/merge-2.1-to-master

Merge 2.1 to master
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
Add prototype of IndexSamplingController
Hack IndexStatisticsTest to accept off-by-one caused by race from IndexPopulationJob
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
Add new type of IndexKey for storing sampling results